Tuesday 18 March 2014

Taking HOT backup/ Database in begin backup mode

How to take HOT backup? What happens when HOT backup/begin backup mode started?


Hot backup is considered as online backup. this means we are going to take backup when database is in up and running condition.This is more similar to cold backup but we will take the backup by keeping database in begin backup mode.
when we put database in begin backup mode the transactions will continue but will not complete. this means checkpoint will try to update the information to datafiles but SCN in the datafile headers wont increase beyond.but the datafiles wont be freezed. So entire information will be in redo logs only. Log writer takes the full images of modified data block(data+block image. but in general case only transaction data has to be logged).because of this effect heavy redo generation will happen.
once the backup mode is ended it will continue to update the SCN in file headers.
Note:By keeping above in mind it is not suggested to to use hot backup for recovering purpose  in case of big databases that generates GB's of redo per day ; because it will generate huge amount of redo.

Steps to take HOT backup of Full database:

SQL>select log_mode from v$database;     ------make sure database in archive log mode
if the database is in no archive log mode make it to archive log mode by following http://orcl11gdba.blogspot.in/2014/03/enabling-archive-log-mode.html

SQL>alter database begin backup;
now copy the data files from one location to backup location.
cp /u01/oracle/app/oradata/pavan/database_1/*.dbf  /u01/oracle/app/oradata/pavan/database_1/HOT_BKP
once copying done then end the begin backup mode

SQL> alter database end backup;
after performing transactions take log switches to clear the pending redo.

SQL>alter system switch logfile;
now take the copy of archive logs to backup location
cp /u01/oracle/app/oradata/pavan/database_1/flash_recovery_area/database_1/archivelog/* /u01/oracle/app/oradata/pavan/database_1/HOT_BKP
now finally take the backup of control file

SQL>alter database backup controlfile to '/u01/oracle/app/oradata/pavan/database_1/HOT_BKP/control.ctl';



now we have all files taken backup and whenever DB got crashed/media failure happened we can restore the database and recover it.


For recovering database scenario using HOT backup see link http://orcl11gdba.blogspot.in/2014/03/restoring-recovering-database-using-hot.html


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...