29 October 2015

Typical RMAN backup

Hello friends,

Configured RMAN backup on one of the servers today. We already had a catalog in place in this project. If I get an opportunity to create/configure the catalog, will update it here.

There was no big deal in this server, we had a backup mount provided for the database by the storage team. The team responsible for moving the backups to TAPE had to be intimated or we could raise a schedule ticket for doing so.

I had a shell script and a parameter file to configure the backup.

shell script as below, save it as rman_bkp.sh(or any name as per your convenience):

ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_HOME
ORACLE_SID=savprdpr
export ORACLE_SID
LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/dbhome_1/lib
export LD_LIBRARY_PATH
/u01/app/oracle/product/11.2.0/dbhome_1/bin/rman target system/********* catalog RMANCAT/**********@grid12cp @/dbprdbkp/scripts/rman_incr_daily_bkp_savprdpr.rcv > /dbprdbkp/rmanbkp/rman_incr_daily_bkp_savprdpr.log


The parameter file with *.rcv as below:(full backup)

run
{
allocate channel c1 device type disk format '/dbprdbkp/rmanbkp/Backup_%d_DB_%u_%s_%p_%T';
allocate channel c2 device type disk format '/dbprdbkp/rmanbkp/Backup_%d_DB_%u_%s_%p_%T';
allocate channel c3 device type disk format '/dbprdbkp01/rmanbkp/Backup_%d_DB_%u_%s_%p_%T';
allocate channel c4 device type disk format '/dbprdbkp01/rmanbkp/Backup_%d_DB_%u_%s_%p_%T';
crosscheck backup;
crosscheck archivelog all;
report obsolete;
delete noprompt obsolete;
sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 0 tag='FULL_BACKUP_WEEKLY' DATABASE INCLUDE CURRENT CONTROLFILE FILESPERSET 1;
BACKUP AS COMPRESSED BACKUPSET ARCHIVELOG ALL;
delete noprompt archivelog all backed up 1 times to disk;
copy current controlfile to '/dbprdbkp/rmanbkp/control_%d_%T_%U.ctl';
backup current controlfile for standby format '/dbprdbkp/rmanbkp/standbycontrol_%d_%T_%U.ctl';
release channel c1;
release channel c2;
release channel c3;
release channel c4;
}



The parameter file with *.rcv as below:(daily incremental backup)

run
{
allocate channel c1 device type disk format '/dbprdbkp/rmanbkp/Backup_%d_DB_%u_%s_%p_%T';
allocate channel c2 device type disk format '/dbprdbkp/rmanbkp/Backup_%d_DB_%u_%s_%p_%T';
allocate channel c3 device type disk format '/dbprdbkp01/rmanbkp/Backup_%d_DB_%u_%s_%p_%T';
allocate channel c4 device type disk format '/dbprdbkp01/rmanbkp/Backup_%d_DB_%u_%s_%p_%T';
crosscheck backup;
crosscheck archivelog all;
report obsolete;
delete noprompt obsolete;
sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 1 tag='INCR_BACKUP_DAILY' DATABASE INCLUDE CURRENT CONTROLFILE FILESPERSET 1;
BACKUP AS COMPRESSED BACKUPSET ARCHIVELOG ALL;
delete noprompt archivelog all backed up 1 times to disk;
copy current controlfile to '/dbprdbkp/rmanbkp/control_%d_%T_%U.ctl';
backup current controlfile for standby format '/dbprdbkp/rmanbkp/standbycontrol_%d_%T_%U.ctl';
release channel c1;
release channel c2;
release channel c3;
release channel c4;
}


The full backup would run on Sundays and the daily backup, daily.

No comments:

Post a Comment