Sunday, May 15, 2011

RMAN Script: Backing up all the archivelog files


[call_arch_bkup.scp] (this scripts is calling the script arch_bkup.scp)

#!/bin/ksh
export ORACLE_HOME="/u01/app/oracle/product/10.2.0"
export ORACLE_SID="omr"
PATH=$PATH:$ORACLE_HOME/bin
echo rman ARCHIVE backup for  CATDB started `date` >> /u07/catdb/rmanbkup.log
rman target sys/password@omr catalog rman/rman@catdb cmdfile='/u04/catdb/scripts/arch_bkup.scp'
echo rman ARCHIVE backup for CATDB ended `date` >> /u07/catdb/rmanbkup.log
exit
 [arch_bkup.scp]
run
{
allocate channel c1 type disk;
backup
format '/u10/catdb/backup/arch_%d_%s_%p_%t'
(archivelog all);
release channel c1;
# deleting archive logs older than 8 days
allocate channel c2 type disk;
delete archivelog until time 'SYSDATE-5';
release channel c2;
}

No comments:

Post a Comment