Sunday, December 28, 2008

Steps to Re-Create the Control File

The follwing are the steps to re-create the control file....

1. First of all take the database to the "Mount" stage.
-->Alter database close;

2. Trace the control file.
The Trace file will be created in the "udump" directory.
-->Alter database backup controlfile to trace;
Note:-Trace the control file in "Mount" stage only.

3. Now shutdown the database gracefully and exit from sql.
-->shutdown immediate.
-->exit

4. Go to "udump" directory and pick the lastest trace file created.
-->You can use the following command to get the latest trace file in linux.
Issue this command in the "udump" directory.
-->ls -lrt

5. Open the lastest trace file.
-->vi latest_trace_file.trc
Note: In this trace file there will be two scripts.
1st one is used create the control file(which i'm telling in this post)
2nd one is used to rename the database(while i will be telling in the next post)

6. Remove everything in the trace file except the 1st script.

7. Save the trace file.

8. Copy the trace file to the home directory.
-->cp ~/cont.sql

9. Remove any old control file if it is there.

10. Connect to datbase as sysdba.
-->sqlplus / as sysdba

11. Start the database to "nomont" stage.
-->startup nomont.

12. Run the script file that we have created from the trace file.
-->@cont.sql

13. Now open the database.
-->Alter database open.

Now the crotrol file has been created, you can go to the control file diretory and check.

No comments: