Saturday 20 June 2015

                       RMAN Level-1 Backup



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




vi rmanbackup_Level-1.sh

#!/bin/shORACLE_SID=testinguatdb; export ORACLE_SIDORACLE_HOME=/u01/app/oracle/11.2.0/dbhome_1; export ORACLE_HOMEPATH=$PATH:$ORACLE_HOME/bin export PATHDD=`date +%d%h`LNAME=/u01/createDB/scripts/${DD}rman_backup_Level-1.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-1.rmn' log $LNAME





vi rmanfullbk_Level-1.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 1 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