Oracle Database Cold Backup & Recovery

1. Backup is a copy of original data which will be used to recover databases

2. If the data is reproducible and backup not existing, still we can recover the data. But it is a tedious and time consuming task

3. Taking backup after shutting down the database is called cold backup and because no transactions exist, the backup will be consistent

4. In real time, we will perform cold backup very rarely

Steps to take cold backup

SQL> select name from v$datafile;
SQL> select member from v$logfile; 
SQL> select name from v$controlfile; 
SQL> shutdown immediate
[[email protected] ~]$ mkdir /u03/coldbkp
[[email protected] ~]$ cp /datafiles/prod/*.dbf /u03/coldbkp
[[email protected] ~]$ cp /datafiles/prod/*.log /u03/coldbkp
[[email protected] ~]$ cp /datafiles/prod/*.ctl /u03/coldbkp
[[email protected] ~]$ cp $ORACLE_HOME/dbs/*.ora /u03/coldbkp
[[email protected] ~]$ sqlplus "/ as sysdba" 
SQL> startup 
SQL> alter database backup controlfile to trace;

Note: archives are not required to take back up with cold backup

Steps to recover datafile (noarchivelog)

SQL> shutdown immediate 
SQL> !cp /u03/coldbkp/*.dbf /datafiles/prod 
SQL> !cp /u03/coldbkp/*.ctl /datafiles/prod 
SQL> !cp /u03/coldbkp/*.log /datafiles/prod 
SQL>startup

Steps to recover redologfile (noarchivelog)

SQL> shutdown immediate 
SQL> !cp /u03/coldbkp/*.dbf /datafiles/prod 
SQL> !cp /u03/coldbkp/*.ctl /datafiles/prod 
SQL> recover database until cancel; 
SQL> alter database open resetlogs;

Steps to recover controlfile (noarchivelog)

SQL> shutdown immediate 
SQL> !cp /u03/coldbkp/*.ctl /datafiles/prod 
SQL> startup mount 
SQL> recover database using backup controlfile until cancel; 
SQL> alter database open resetlogs;

Was this article helpful?

Related Articles

Leave a Comment