Showing posts with label scripts. Show all posts
Showing posts with label scripts. Show all posts

Wednesday, September 14, 2011

Duplicate Script for implementing Physical Standby

After you create backup of primary database using the BACKUP SCRIPT and transfered the files to the standby server run the following script to create the physical standby.

export ORACLE_BASE=/home/oracle
export ORACLE_HOME=/home/oracle/OraHome1
export PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:/home/oracle/OraHome1/bin:.
export ORACLE_SID=LCDR

v_bdest=/backup/RMANBKUP/spool
####################### DUPLICATE DATABASE ##########################

rman target sys/password@PRDB auxiliary / << EOF
spool log to $v_bdest/StandbyDB.log append;
run {
allocate auxiliary channel a1 type disk format '/backup/RMANBKUP/%U';
allocate auxiliary channel a2 type disk format '/backup/RMANBKUP/%U';
duplicate target database for standby;
}
exit
EOF


Thanks

Backup Script for implementing Physical Standby Database.

The following script is used for creating RMAN backup required for implementing Physical Standby database.

export ORACLE_BASE=/home/oracle
export ORACLE_HOME=/home/oracle/OraHome1
export PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:/home/oracle/OraHome1/bin:.
export ORACLE_SID=PRDB

v_bdest=/backup/RMANBKUP
lev0="'$v_bdest/%U'"
ctlbak="'$v_bdest/%U'"

rman target sys/password@PRDB nocatalog << EOF
spool log to $v_bdest/spool/BACKUP.log append;
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
run {
allocate channel c1 type disk;
allocate channel c2 type disk;
backup as compressed backupset incremental level 0 format $lev0 database plus archivelog;
backup current controlfile for standby format $ctlbak;
backup spfile;
release channel c1;
release channel c2;
}
exit
EOF

After the backup is finished, copy the backup files to the standby server and run the RMAN duplicate command to create the standby database.

Followers

Powered By Blogger
 

RAC Database Administration. Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com