Monday, 7 April 2014

Recovering database using cold backup

How to perform cold backup? How to recover database using cold backup?

Taking Cold backup:
As we already know cold backup is offline backup , we have to take it by making database offline/shutdown.
shut down should be graceful shutdown,why because during graceful shutdown the transactions will be completed and every datafile, controlfile will be in sync with respect to SCN.This cold backup can be done even if database is in archivelog mode or no archivelog mode.
if it is in archive log mode we don't need to take redo log files backup because redo logs are already emptied during graceful shutdown and all transactions were written to db files and archive log.so it wont contain further more transactions.
if it in no archivelog mode we can take backup of redo logs also. but in both the cases taking redo log backup is not mandatory.
1.Before shutting down database just verify all the datafiles path and control file path.
sql>select FILE_NAME from dba_data_files;
2.shut down database
sql>shutdown/shut immediate
3.find the mount point/file system for space where we are going to keep our cold backup.
]~ df -kh
4.make a directory for backup.
/u01/oracle/app/oradata/pavan/database_1/COLD_BKP
5.copy the files from datafiles location to /u01/oracle/app/oradata/pavan/database_1/COLD_BKP path. this step is called cold backup.
cp /u01/oracle/app/oradata/pavan/database_1/*.dbf /u01/oracle/app/oradata/pavan/database_1/COLD_BKP
cp /u01/oracle/app/oradata/pavan/database_1/*.ctl /u01/oracle/app/oradata/pavan/database_1/COLD_BKP

6.start the database
sql>startup

we don't need to take backup of temp datafile because it will be automatically created when DB is restarted.If want we can keep the backup of archive logs also in the above steps.

Recovering using Cold backup:
When you have lost any of CRD files and you want to recover database using cold backup then simply shut down the database and restore backup.
1.shut down the database
sql>shut immediate/abort
2.copy the files from backup location to CRD files location. this step is called restoring of database.
cp /u01/oracle/app/oradata/pavan/database_1/COLD_BKP u01/oracle/app/oradata/pavan/database_1/*.dbf
cp /u01/oracle/app/oradata/pavan/database_1/COLD_BKP /u01/oracle/app/oradata/pavan/database_1/*.ctl
3.start the database
sql>startup mount
sql>RECOVER DATABASE UNTIL CANCEL USING BACKUP CONTROLFILE;
sql>alter database open resetlogs;
 database opened.
cold backup recovery is not required if it is in no-archive log mode(you can directly startup the database).


Cheers.....!!!

No comments:

ORA-600 [kwqitnmphe:ltbagi], [1], [0] reported in the alert log file.

ORA-00600 [kwqitnmphe:ltbagi] Cause: This issue arises in 12.1.0.2. The error occurs because there are still Historical Messages without...