Saturday 20 June 2015

                           RMAN LEVEL -2 Backup





This document describes how to take level 2 database backup using RMAN(Recovery Manager).First will create rmanbackup_Level-2.sh file/script to run from OS level. Inturn this scriptwill call another script/CMDfile named rmanfullbk_Level-2.rmn to take full database backup using RMAN.



vi rmanbackup_Level-2.sh
#!/bin/sh
ORACLE_SID=testinguatdb; export ORACLE_SID
ORACLE_HOME=/u01/app/oracle/11.2.0/dbhome_1; export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin export PATH
DD=`date +%d%h`
LNAME=/u01/createDB/scripts/${DD}rman_backup_Level-2.log
###############DELETE BACKUP ################
#rm /ora_backup/Rman_Backup_DB_File/DB_RMAN_PLI*
#rm /ora_backup/Rman_Backup_DB_Arch/DB_ARCH_PLI*

rman target sys/password@testinguatdb catalog catuser/password@catadb cmdfile '/u01/createDB/scripts/rmanfullbk_Level-2.rmn' log $LNAME




vi rmanfullbk_Level-2.rmn
crosscheck archivelog all;
crosscheck backup;
delete expired backup;
delete force noprompt expired backup;
delete expired archivelog all;

run
{
allocate channel c1 device type to sbt;
allocate channel c2 device type to sbt;
allocate channel c3 device type to sbt;
allocate channel c4 device type to sbt;
BACKUP INCREMENTAL LEVEL 2 as compressed backupset database include current controlfile;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
}
run
{
allocate channel c1 device type to sbt;
allocate channel c2 device type to sbt;
allocate channel c3 device type to sbt;
allocate channel c4 device type to sbt;
sql 'alter system switch logfile';
sql 'alter system archive log current';
BACKUP  as compressed backupset archivelog all ;

#delete input;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
}
delete archivelog until time 'SYSDATE-15';
crosscheck archivelog all;



No comments:

Post a Comment