#30 20 * * 5 /home/oracle/clone_scripts/clone_fopsfat1.sh
-------------------clone_fopsfat1.sh-----------------
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
TMP=/tmp; export TMP
ORACLE_HOME_LISTENER=$ORACLE_BASE ;export ORACLE_HOME_LISTENER
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/data/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=${PATH}:$ORACLE_HOME/bin/ export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
export ORACLE_SID=fopsfat1
lsnrctl stop listenerfat1
cd /data/fopsfat1
rm *.*
cd /data/fops
cp *.* /data/fopsfat1/
cd /data/fopsfat1
rm *.ctl
rm temp01.dbf
cd /data/app/oracle/admin/fopsfat1
rm -rf udump bdump cdump adump
mkdir udump bdump cdump adump
sqlplus 'sys/fopsdb2008 as sysdba' @/home/oracle/clone_scripts/fopsfat1conttrc.sql
exit
---------------fopsfat1conttrc.sql--------------------------
SHUTDOWN ABORT;
STARTUP NOMOUNT pfile='$ORACLE_HOME/dbs/initfopsfat1.ora'
CREATE CONTROLFILE SET DATABASE "fopsfat1" RESETLOGS NOARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 887
LOGFILE
GROUP 1 '/data/fopsfat1/redo01.log' SIZE 50M,
GROUP 2 '/data/fopsfat1/redo02.log' SIZE 50M,
GROUP 3 '/data/fopsfat1/redo03.log' SIZE 50M
-- STANDBY LOGFILE
DATAFILE
'/data/fopsfat1/system01.dbf',
'/data/fopsfat1/undotbs01.dbf',
'/data/fopsfat1/sysaux01.dbf',
'/data/fopsfat1/users01.dbf',
'/data/fopsfat1/admin_data_01.dbf',
'/data/fopsfat1/admin_data_02.dbf',
'/data/fopsfat1/load_data_01.dbf',
'/data/fopsfat1/navdata_data_01.dbf',
'/data/fopsfat1/spatial_data_01.dbf',
'/data/fopsfat1/statw_data_01.dbf',
'/data/fopsfat1/statw_data_02.dbf',
'/data/fopsfat1/tools_data_01.dbf',
'/data/fopsfat1/weather_data_01.dbf'
CHARACTER SET WE8ISO8859P15
;
alter database open resetlogs;
-- re-create incarnation records.
ALTER TABLESPACE TEMP ADD TEMPFILE '/data/fopsfat1/temp01.dbf'
SIZE 1097M REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M;
alter user system account unlock;
alter user system identified by fopsdb2008;
!lsnrctl start listenerfat1
exit
------------------------------
Note: 1.add a entry in oratab file
2.create a pfile and edit pfile whit new db name and file locations
3.create a password file
4.edit the contents inside controlfile trace and rename it.
No comments:
Post a Comment