2010年9月8日

(Oracle)how to recreate control file(Linux)

1. login in as sysdba, export trc file:

[oracle@cs66 orcl]$ sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.4.0 - Production on Wed Sep 8 01:48:43 2010

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> alter database backup controlfile to trace;

Database altered.

SQL>

2. The new trc file is under $ORACLE_BASE/product/10.2.0/oradata/$ORACLE_SID, check the timestamp for newly created trc file. Here for me it’s as following:

-rw-rw----  1 oracle oracle   6711 Sep  8 01:48 orcl_ora_32195.trc

3. Check the orcl_ora_32195.trc file, save content from the line “--     Set #1. NORESETLOGS case” to the end, you may check the comments for what they are doing, the contents saved to another file, I named it as reCreate.sql.

4. login in as sysdba again, shutdown instance, and delete all control files, then run the file reCreate.sql.

[oracle@cs66 orcl]$ sqlplus " / as sysdba"

SQL*Plus: Release 10.2.0.4.0 - Production on Wed Sep 8 01:57:42 2010

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> @/home/oracle/oracle/product/10.2.0/db_1/admin/orcl/udump/reCreate.sql

5. check your control files, they are recreated again.

没有评论: