Complete Oracle Cold Backup Routine

Cold backup is done when database is not open. While performing cold backup using RMAN the database need to be in MOUNT mode. This is because RMAN needs the data file details which are available while database is in MOUNT mode. Cold backup is also called consistent backup. This is because before bringing the database in MOUNT mode, the database is first shutdown with IMMEDIATE or TRANSACTIONAL option. As this backup is a cold backup the, the archive log files will be not required to restore and recover the database. Hence archive log files are not added. I use for this task two script : cold_bkp.rman - is holding the rman commands exec_cold_bkp.sh - is holding the environment variables and execution string.

This are the scripts i use for this task:

cold_bkp.rman
run
{
allocate channel P1 device type disk;
allocate channel P2 device type disk;
allocate channel P3 device type disk;
crosscheck backup;
delete noprompt expired backup;
shutdown abort;
startup;
shutdown immediate;
startup mount;
backup database;
alter database open;
}

 

exec_cold_bkp.sh
  • the script will hold the environment variables need and also the rman connector string where you need to provide it with a tns entry and with a user and password account.
export ORACLE_HOME=/u00/app/oracle/product/11.2.0.2/db_1
export ORACLE_SID=SID_DB
export PATH=/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin:/u00/app/oracle/product/11.2.0.2/db_1/bin
nohup rman target sys/password@SID_DB nocatalog @/home/oracle/scripts/cold_bkp.rman log=/home/oracle/scr/cold_bkp.out &

 How to run the script

  • you just need to make them execuables and run them.
./exec_cold_bkp.sh

 To monitor the execution just run tail on the log file.

tail -f /home/oracle/scr/cold_bkp.out

 

 Make sure you follow up the next Article on how you can restore the cold backup we just did now on top of the same database.