Monday, 26 October 2015
SWITCH DATABASE TO COPY
In the previous post we looked at the incremental image copy backup, today it’ time to try the recovery process out.
There are two different ways to do so, let’s see how, shall we ?
1)Using the conventional restore and recovery process, where you have to restore the datafiles copy to the original path and what’s more recover them using the level 1 image copy backup and archived logs too.
2) Using the ‘switch database to copy’ command where you don’t need to restore any datafiles because, they are already available in the backup directory.
It is only required to apply on them the level 1 image copy and all the archived logs available.
If it is necessary to recover the database immediately, it is the best way to do so.
Let’s get started, shall we ?
1) Startup the database in a MOUNT state :
SQL > startup mount
2) Execute the following command :
RMAN> switch database to copy;
Short log file:
Using target database control file instead of recovery catalog
datafile 1 switched to datafile copy "/backup/datafile/o1_mf_system.dbf"
datafile 2 switched to datafile copy "/backup/datafile/o1_mf_undotbs1.dbf"
ecc
As you can verify on Oracle view, now the datafiles path are different, indeed our instance has started to work with the image copy datafiles backup.
SQL> select NAME from v$datafile;
NAME
--------------------------------------------------------------------------------
/backup/datafile/o1_mf_system_.dbf
/backup/datafile/o1_mf_undotbs1..dbf
Ecc
Also the Alert log files can confirm it as you can see below :
WARNING: switching recovery area datafile copy
/backup/datafile/ o1_mf_system.dbf" as database area datafile
3) Now it is time to recover those image copy datafiles :
RMAN > recover database;
Log :
Starting recover at 13-OCT-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=236 devtype=DISK
channel ORA_DISK_1: starting incremental datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00002: /backup/datafile/o1_mf_system_.dbf
As I mentioned before RMAN is going to apply the last level 1 image copy backup and archived logs too (if available).
4) Open the database and keep your fingers crossed !!!
SQL> alter database open;
All those steps end up starting the database infact we ‘ve been able to figure the problem out and what’s more in a short time.
Well done !
Remember to try it out on a test environment and please redo a complete database backup , since the previous one is now online and no longer available to restore it.
Byeeeee
Labels:
database copy,
RMAN switch
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment