数据库在启动时,提示以下错误:
ora-01122:database file failed verification check
ora-0110:datafile :/home/oracle/oradata/ora8/system01.dbf
Ora-01207:file is more recent than controlfile - old control file
是数据文件和控制文件不同步造成的。用以下步骤恢复:
SQL> startup mount
ORACLE instance started.
Total System Global Area 536870912 bytes
Fixed Size 1220408 bytes
Variable Size 201326792 bytes
Database Buffers 327155712 bytes
Redo Buffers 7168000 bytes
Database mounted.
SQL> alter database backup controlfile to trace;
Database altered.
SQL> !
[oracle@DB1 ~]$ cd admin/orcl/udump/
在udump目录去找最新一个文件,里面有创建控制文件的脚本
[oracle@DB1 udump]$vi orcl_ora_4457.trc
[oracle@DB1 udump]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Mar 23 10:41:05 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 536870912 bytes
Fixed Size 1220408 bytes
Variable Size 197132488 bytes
Database Buffers 331350016 bytes
Redo Buffers 7168000 bytes
SQL> CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS FORCE LOGGING NOARCHIVELOG
2 MAXLOGFILES 16
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 100
5 MAXINSTANCES 8
6 MAXLOGHISTORY 292
7 LOGFILE
8 GROUP 1 '/oradata/orcl/redo01.log' SIZE 50M,
9 GROUP 2 '/oradata/orcl/redo02.log' SIZE 50M,
10 GROUP 3 '/oradata/orcl/redo03.log' SIZE 50M
11 -- STANDBY LOGFILE
12 DATAFILE
13 '/oradata/orcl/system01.dbf',
14 '/oradata/orcl/undotbs01.dbf',
15 '/oradata/orcl/sysaux01.dbf',
16 '/oradata/orcl/users01.dbf'
17 CHARACTER SET ZHS16GBK
18 ;
Control file created.
SQL> alter database mount;
alter database mount
*
ERROR at line 1:
ORA-01100: database already mounted
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open resetlog;
alter database open resetlog
*
ERROR at line 1:
ORA-02288: invalid OPEN mode
SQL> alter database open resetlogs;
Database altered.
--转自