控制文件重建,ORA-01207

語言: CN / TW / HK

故障現象:
SQL> startup
ORACLE instance started.

Total System Global Area 1202556928 bytes
Fixed Size 2252704 bytes
Variable Size 889192544 bytes
Database Buffers 301989888 bytes
Redo Buffers 9121792 bytes
Database mounted.
ORA-01122: database file 1 failed verification check
ORA-01110: data file 1: '+DATA/racdb/datafile/system.256.1045960621'
ORA-01207: file is more recent than control file - old control file







啟動數據庫報錯。

先執行如下命令生成controlfile trace
SQL> alter database backup controlfile to trace as '/home/oracle/control.ora';

查看文件內容,並修改control.ora文件保留如下部分:

STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "RACDB" NORESETLOGS ARCHIVELOG
MAXLOGFILES 192
MAXLOGMEMBERS 3
MAXDATAFILES 1024
MAXINSTANCES 32
MAXLOGHISTORY 292
LOGFILE
GROUP 1 (
'+DATA/racdb/onlinelog/group_1.261.1045960691',
'+OCR/racdb/onlinelog/group_1.257.1045960691'
) SIZE 50M BLOCKSIZE 512,
GROUP 2 (
'+DATA/racdb/onlinelog/group_2.262.1045960693',
'+OCR/racdb/onlinelog/group_2.258.1045960693'
) SIZE 50M BLOCKSIZE 512,
GROUP 3 (
'+DATA/racdb/onlinelog/group_3.265.1045960767',
'+OCR/racdb/onlinelog/group_3.259.1045960767'
) SIZE 50M BLOCKSIZE 512,
GROUP 4 (
'+DATA/racdb/onlinelog/group_4.266.1045960769',
'+OCR/racdb/onlinelog/group_4.260.1045960769'
) SIZE 50M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
'+DATA/racdb/datafile/system.256.1045960621',
'+DATA/racdb/datafile/sysaux.257.1045960621',
'+DATA/racdb/datafile/undotbs1.258.1045960621',
'+DATA/racdb/datafile/users.259.1045960621',
'+DATA/racdb/datafile/undotbs2.264.1045960735',
'/u01/app/oradata/ojbk.dbf',
'/u01/app/oradata/verygood.dbf',
'+DATA/racdb/datafile/benchmarksql.271.1051112775'
CHARACTER SET AL32UTF8
;
RECOVER DATABASEALTER SYSTEM ARCHIVE LOG ALL;
ALTER DATABASE OPEN;




































然後sqlplus 執行control.ora文件

SQL> @control.ora
ORACLE instance started.

Total System Global Area 1202556928 bytes
Fixed Size 2252704 bytes
Variable Size 889192544 bytes
Database Buffers 301989888 bytes
Redo Buffers 9121792 bytes



Control file created.

ORA-00283: recovery session canceled due to errors
ORA-00264: no recovery required

System altered.

Database altered.

控制文件重建完成

注:如果是RAC環境,重建控制文件前需要將 cluster_database設置為FALSE,重建後在改回來