Wednesday, May 7, 2008

Recreating control file manually-Basic method

Sql>alter system backup controlfile to trace;
It will generate control file trace in udump. Edit the file manually remove unnecessary lines except below lines.
---edit the db-name---and remove resetlogs----
STARTUP NOMOUNT
CREATE CONTROLFILE set DATABASE "tnd" NOARCHIVELOG
MAXLOGFILES 32
MAXLOGMEMBERS 5
MAXDATAFILES 512
MAXINSTANCES 8
MAXLOGHISTORY 14607
LOGFILE
GROUP 1 (
'/dev01/oracle/PROD/db/apps_st/data/log01a.dbf',
'/dev01/oracle/PROD/db/apps_st/data/log01b.dbf'
) SIZE 1000M,
GROUP 2 (
'/dev01/oracle/PROD/db/apps_st/data/log02a.dbf',
'/dev01/oracle/PROD/db/apps_st/data/log02b.dbf'
) SIZE 1000M resetlogs
-- STANDBY LOGFILE---edit the path of the datafiles-----
DATAFILE
'/dev01/oracle/PROD/db/apps_st/data/ctxd01.dbf',
'/dev01/oracle/PROD/db/apps_st/data/owad01.dbf',
'/dev01/oracle/PROD/db/apps_st/data/a_queue02.dbf',
'/dev01/oracle/PROD/db/apps_st/data/odm.dbf',
'/dev01/oracle/PROD/db/apps_st/data/olap.dbf',
'/dev01/oracle/PROD/db/apps_st/data/sysaux01.dbf',
'/dev01/oracle/PROD/db/apps_st/data/undo01.dbf',
'/dev01/oracle/PROD/db/apps_st/data/a_txn_data01.dbf',
CHARACTER SET UTF8
;
This is the way to create control file manually. Save it as a .sql script. Connect to sqlplus as sysdba and execute this script.
Sql>@create.sql
After execting this it’ll take some time to create the control file and finally you can see the message Control file created.
After that execute this,
Sql>ALTER DATABASE OPEN RESETLOGS;
If database require any recovery issue,
Sql>recover database using backup controlfile;
And apply the redolog file.
It’ll recover from the redo log files.
Eg:
/oracle/db/redo1.log
Recovered.