Monday, April 9, 2012

Recreate Oracle Controlfile

Use the following example if you need to create a controlfile script. The script can be used to recreate a controlfile.


 


alter database backup controlfile to trace;

Once you run this head over to your trace files directory and locate the script. Find the following line in the control file script:


CREATE CONTROLFILE REUSE DATABASE "SID" RESETLOGS ARCHIVELOG

From here you can edit the path of the datafiles and redologfiles if necessary. Startup the database in nomount mode and run the script you created as sysdba.


Check on the status of the instance.


 


select status from v$instance;

Query to see the control files.


select name from v$controlfile;

It is a good idea to generate this trace file from time to time. If/when you lose a control file you can use this to rebuild it from scratch.

0 comments:

Post a Comment