Friday 16 December 2011

RMAN SAMPLE SCRIPTS



rman target / catalog sekiazu0140_sekiazu0141_Q0153X/work4cts@RMAN06;
run {
allocate channel t1 type 'SBT_TAPE'
parms 'ENV=(TDPO_OPTFILE=/u001/app/TDP/Q0153X/tdpo.opt)';
allocate channel t2 type 'SBT_TAPE'
parms 'ENV=(TDPO_OPTFILE=/u001/app/TDP/Q0153X/tdpo.opt)';
allocate channel t3 type 'SBT_TAPE'
parms 'ENV=(TDPO_OPTFILE=/u001/app/TDP/Q0153X/tdpo.opt)';
set until time "to_date('Aug 07 2011 23:00:00','Mon DD YYYY HH24:MI:SS')";
restore database;
release channel t1;
release channel t2;
release channel t3;
}



rman target /

run {
ALLOCATE CHANNEL disk1 DEVICE TYPE DISK FORMAT '/s105/rbackup/%U';
ALLOCATE CHANNEL disk2 DEVICE TYPE DISK FORMAT '/s001/rbackup/%U';
BACKUP AS COMPRESSED BACKUPSET DATABASE PLUS ARCHIVELOG;
backup current controlfile;
release channel disk1;
release channel disk2;
}

run {
ALLOCATE CHANNEL disk1 DEVICE TYPE DISK FORMAT '/u03/oradata/invivo/fbackup/%U';
backup current controlfile;
BACKUP AS COMPRESSED BACKUPSET DATABASE PLUS ARCHIVELOG;
release channel disk1;
}

Rman target system/password@cdssv


Connect catalog system/password@CDSSV

rman>Backup database plus archivelog all;
Backup the database
run {
allocate channel 'dev0' type 'disk0/backups/%U';
allocate channel 'dev1' type 'disk1/backups/%U’;
backup full tag Full_Oracle_Backup filesperset 5 format '%d_%t_%s_%p.dbf'
database;

backup filesperset 5  format '%d_%t_%s_%p.cf'
current controlfile;

sql 'alter system archive log current';
backup filesperset 50 archivelog all format '%d_%t_%s_%p.arch';
release channel dev0;
release channel dev1;
}



allocate channel for delete type disk;
# validate backups older than 8 days. If they are no longer on tape then mark then for deletion
crosscheck backup completed before 'SYSDATE-8';

# delete expired backups
delete expired backup;

No comments:

Post a Comment