Monday, 2 March 2015

Backup and restore controlfile using RMAN

Today we are gonna take the backup and then delete the controlfile and then again restore the same uing RMAN.

So let's do it. :)

Startup your target database.

Open RMAN prompt on the target environment and connect to your catalog database. If you haven't started the listener on the catalog host and the catalog database then please go ahead do it first.

Follow these steps. (rman/rman here are the username and the password catdb is the tns service on the target host for the catalog server).

RMAN> connect catalog rman/rman@catdb

connected to recovery catalog database

RMAN> connect target/

connected to target database: BASE (DBID=1899780213)

RMAN> backup current controlfile;

Wait until you see finished backup.

Then go to your RMAN backup location you will find the backup that has been just taken.

Now time to delete all the controlfile from every location. You might have 2 or more controlfile in different locations. Delete those.

Now shutdown your target database. And again then starup and see what happens :)

You will find this error

ORA-00205: error in identifying control file, check alert log for more info

Now open RMAN again and then connect to your catalog then

RMAN> connect target/

connected to target database:  (not mounted)

You see not mounted because you had that error identifying controlfile.

No worries you have the RMAN backup. So let's restore.

Do these

RMAN> restore controlfile;

RMAN> alter database mount;

RMAN> recover database;

RMAN> alter database open resetlogs; 

database opened
new incarnation of database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
 

So finally the target database is open now. You can check the status on the sql prompt.

That's all for now. Do not hesitate to correct or include any points or information that I have mentioned wrongly or missed completely. Your feedback is highly appreciated.

Thanks
Subhajit

No comments:

Post a Comment