Wednesday, September 14, 2011

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.

No comments:

Post a Comment

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