Search

Join this Blog for direct reference of any post into your inbox. To join just click on "Join this Site" under "Follower" then Login with your Email.*** DECLARATION: I Maintain this Blog for Helping Myself While at Work and Welcome any body Needing Help!!!.*** CAUTION: Using any of the script from this Blog may contain at Own Risk. These scripts May or May not have been Tested.***

Tuesday, 23 July 2013

Shell Script for Scheduled RMAN Backup

The script will first automatically create the directory and will move the old backup into it then will perform the fresh backup.
The script will manage the full backup of database (Noarchivelog). If you need you can slightly change the scripts to perform datafiles as well as archivelog backup.
################ SHELL SCRIPT FOR RMAN SCHEDULED BACKUP#################
cd /home/oraback
mkdir 'date '+%d%m%y''
mv * /home/oraback/'date '+%d%m%y''
cd /d01/oravis/db/tech_st/11.1.0
. VIS_sadhan.env
rman target /
@/home/oravis/rman_bkp.sql
EOF

rman_bkp.sql
run
{
allocate channel d1 type disk MAXPIECESIZE 5G;
allocate channel d2 type disk MAXPIECESIZE 5G;
backup full tag full_db format '/home/oraback/db_%t_%s_p%p'
(database);
release channel d1;
release channel d2;
BACKUP CURRENT CONTROLFILE FORMAT '/home/oraback/CTL%s_%t_%p';
SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
}

2 comments:

  1. Thank you for providing shell script to backup databases. It is really useful.

    ReplyDelete
  2. Quantum Binary Signals

    Professional trading signals sent to your cell phone daily.

    Follow our trades right now & gain up to 270% per day.

    ReplyDelete