Hot Backup and Cloning
Hot Backup :
A hot backup is taken when the database needs totally open and available to its users. It is an online backup. All files of the database are copied and there may be changes to the database during the copy.For the hot backup the database must be running in the ARCHIVELOG Mode.
The benefit of taking a hot backup is that the database is available for use while the backup is occurring and one can recover the database to any point in time.
For Hot Backup the database must be informed when the backup is starting and when it is going to complete.
- Alter database begin backup
- Alter database end backup
Backup Procedure :
Gather all the Info for the backup Purpose .
- select name from v$datafile ;
- select * from v$controlfile ;
- select name from v$logfile ;
- select
NAME from v$archived_log ;
- create pfile from spfile ;
Perform a log switch and note down the old and current log sequence of database
- Alter system archivelog current ;
- archive log list ;
Place or inform source database to be in backup mode
- alter database begin backup
select * from v$backup;
Copy all the datafilse and log files to remote server or backup location . Once the copy is completed end the backup mode of database .
- alter database end backup
Perform a log switch and note down the old and current log sequence of database
- Alter system archivelog current ;
- archive log list ;
Take the control file trace backup in source Database .
- alter database backup contorfile to trace as '/tmp/ctrl_hotbkup.sql';
Cloning
Copy all archive log files generated on the source database during begin backup and the end backup mode to the target server.
Modify the contents of trace file and edit the database name and modify the location of data files and log files .
Note: Change the “REUSE” parameter to “SET” and RESETLOGS option.
Make sure to copy the archivelogs in the same location on target server as on the source server
Move the pfile to DBS location and modify the pfile to change the DB name an control file locations
Steps :
- Startup the database in nomount stage using modified pfile .
- Create the control file for the clone database using the trace control file.
- Recover the database using backup control file option
- " recover database using backup controlfile until cancel ; "
- Open the database in Resetlogs mode
- "alter database open :"
Comments
Post a Comment