Thursday, June 14, 2012

Database restore to diff location using rman backup

1. What we had is the RMAN Backup (all datafile,controlfile,archive logs).


2. Here we have to restore the database from the rman backup to different location.

3. We will set the ORACLE_SID and DBID

4. we will make changes in the INIT.ora file and nomount the database.

5. Then using the RMAN we will recover the controlfile from the rman backup.It is advisable that the backup of the controlfile should have been done by setting the rman parameters as (CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO /new_home/rman_bkp/ora_ctrl%F';)  Bcoz in this manner its easy to find the controlfile backup in the rman backp. but in our case it was not so and we had a little fight in finding the correct controlfile backup.

We can see below how we have restored the controlfile from the rman backup file

('/data/rman_bkp/dbf_8448_1_783414340.bak'). NOTE : (run{SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/data/rman_bkp/%F'; allocate channel t1 type DISK; restore controlfile from '/data/rman_bkp/dbf_8448_1_783414340.bak';})

6. After this mount the databaase.

7. As the backup is not placed at its default location so we have to tell rman the location of the backup where it is placed with the "catalog start with" command.

8. Then in rman we will set the newname for all the datafiles and for this we will allocate channel in rman.

9. Then we will restore database.

10.Then in the end switch datafile all.

11.Then we query the v$datafile after switching datafiles so check that all the datafiles are pointing to new location.

12.Now we will Recover the database in rman and it will failed for current archive log, so exit rman session and open the other session execute the following commands.

set the ORACLE_SID=;

export ORACLE_SID

sqlplus "/as sysdba"

And recover database using backup controlfile until cancel option enter CANCEL when promted and will give the message media recovery cancelled.

13.Then we will rename the redo logfiles location to their new location using the command ("alter database rename file '/old../old../log01a.dbf' to '/new../new../log01a.dbf';")

14.Then open the database with open resetlogs

15.Take the controlfile backup to trace (a trace file will be generated in udump)

16.Then shut immediate the database

17.Now recreate the control file using above trace file and change the "REUSE" to "SET" and "ARCHIVELOG" to "NOARCHIVELOG" and even chande the database name to UAT, Then open new session and create the controlfile as follows.

sqlplus "/as sysdba"

sql> startup nomount='inituat.ora'

sql>control.sql

sql>alter database open resetlogs;

18.Then create temp tablespace.



run the autoconfig on dbtier and run autoconfig on apps tier

No comments:

Post a Comment

ORA-12519: TNS:no appropriate service handler found error

ORA-12519: TNS: no appropriate service handler found error The real problem lies in the PROCESSES parameter All you need ...