Backup Script

0

cat > /home/oracle/scripts/rman.sh

!/bin/sh

DATE=date +%m%d%y%H%M
$ORACLE_HOME/bin/rman target / log=/home/oracle/scripts/log/backup_PROD_$DATE.log @/home/oracle/scripts/db.rman

cat > /home/oracle/scripts/db.rman
run {
allocate channel d1 type disk;
allocate channel d2 type disk;
allocate channel d3 type disk;
backup AS COMPRESSED BACKUPSET format ‘/d02/oracle/PROD/backup/EBSPROD_bu_db_%d_t%t_s%s_p%p’ database;
sql ‘alter system archive log current’;
sql ‘alter system archive log current’;
sql ‘alter system archive log current’;
sql ‘alter system archive log current’;
sql ‘alter system archive log current’;
backup AS COMPRESSED BACKUPSET format ‘/d02/oracle/PROD/backup/EBSPROD_bu_al_t%t_s%s_p%p’ archivelog all skip inaccessible delete input;
backup format ‘/d02/oracle/PROD/backup/EBSPROD_control%U’ current controlfile;
release channel d1;
release channel d2;
release channel d3;
allocate channel d1 type disk;
crosscheck backup;
delete noprompt obsolete;
release channel d1;
}

Share.

About Author

Leave A Reply