RMAN BACKUP SCRIPT

RMAN BACKUP SCRIPT

rman backup script which I have scheduled on Oracle RAC of node1 and is working perfectly. backup is taking in compressed mode and after completing the backup will re-schedule for next day and next command will load backup to Tap media.

#!/bin/bash
export ORACLE_SID=prod1
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db1
cd /u01/app/oracle/product/10.2.0/db1/bin
./rman target 'system/idgroup' log=/rman/rman/rmanlog.`date '+%a'` <<EOF
run
{
allocate channel d1 type disk;
allocate channel d2 type disk;
delete noprompt backup;
BACKUP AS COMPRESSED BACKUPSET DATABASE
tag whole_database_open
format '/rman/rman/db_%t_%s_p%p';
sql 'alter system archive log current';
sql 'alter system archive log current';
backup AS COMPRESSED BACKUPSET archivelog all format '/rman/rman/al_%t_%s_p%p' delete all input;
backup current controlfile tag =cf1 format '/rman/rman/cf_%t_%s_p%p';
release channel d1;
release channel d2;
}
exit;
EOF
at 20:01 < /rman/rman/rman.sh  ==> this command will reschedule the backup for next day.
tar cvf /dev/st0 /rman/rman/ > /rman/rman/tapeout.log  ==> this command will load rman backup to tap media.
Advertisements

About Sher khan

Senior Oracle DBA, Oracle 10g , Oracle 11g OCE ,Oracle 12C and Oracle 11g OPN certified Specialist, OCP Certified in Oracle 9i,10g , 11g and 12C. I am working in Oracle technology since 2004. Currently working in U.A.E Email: sher487@hotmail.com
This entry was posted in rman. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s