重建控制檔案 recreate control file

tengrid發表於2011-01-21

簡單總結如下:
1) 啟動到mount
2) 執行Alter database backup controlfile to trace;
3) 找到第2步生成的trace檔案,並作相應修改. 只保留建立語句
4) shutdown並啟動到nomount, 執行建立語句
5) 啟動到mount
6) 執行下面指令碼,進行恢復
$more recover_db.sh
#!/bin/bash
source /home/oracle/.bash_profile
cd `dirname $0`

sqlplus / as sysdba  <startup mount;
recover database noparallel;
auto
EOD
7) 執行ALTER SYSTEM ARCHIVE LOG ALL;
8) ALTER DATABASE OPEN;
9) 註冊臨時檔案  (語句在第2步生成的trace檔案末尾)
ALTER TABLESPACE TEMP2 ADD TEMPFILE '+DATA1/isddw/datafile/temp2_01' REUSE;
....

附Metalink中的步驟
Applies to:
Oracle Server - Enterprise Edition
Information in this document applies to any platform.
"Checked for relevance on 12-March-2008"
***Checked for relevance on 25-Jul-2010***

Symptoms
ORA-1122 :database file %s failed verification check
ORA-1110 : datafile :
ORA-1207: ORA 1207 file is more recent than control file

Cause
The information in this file is inconsistent with information from the control file.
The datafile header CHECKPOINT count is beyond the controlfile CHECKPOINT count.

Solution
1.Mount the database
SQL>Startup mount

2. trace the control file

SQL> Alter database backup controlfile to trace;

3. Create a control file creation script. from the tracefile generated in user_dump_dest.

Use the Noresetlogs option

4.shutdown the database and start it NOMOUNT mode

SQL>shutdown abort
SQL>startup NoMount

5.Create the control file

Use the script. generated by the 'backup controlfile to trace' command above.

Reference: Note:1012929.6 How to Recreate the Controlfile

6.Recover database

SQL>recover database ;

7.Open the database

SQL>Alter database open

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/94384/viewspace-684444/,如需轉載,請註明出處,否則將追究法律責任。

相關文章