Sunday, November 27, 2011

how to do complete recovery if controlfiles are lost

Take the trace of controlfile using below command
sql> alter database backup controlfile to trace;

Note : The above command will work fortunately if you have database still up and running. If not, you need to have the latest controlfile trace. If not available and still you have all redolog and datafile information, then you can take trace of other database and modify the name, path and sizes of redolog files and datafiles

From the controlfile trace, copy second CREATE CONTROLFILE command till characterset to another text file and save it with .sql extension (generally i will save it as create_control.sql)

change RESETLOGS option to NORESETLOGS in that sql file.

sql> shutdown immediate;

sql> startup nomount;

sql> @create_control.sql (your current directory should be the location of this file or you can give path also before file name)

Note : This will create controlfile and will place the database in MOUNT state. If any errors, observed, we need to debug them.

sql> alter database open;

No comments:

Post a Comment