window操作系统,oracle 11.2.0.1.0版本,意外断电后计算机服务中可以启动oracle服务和监听服务,但是无法连接; 使用sqlplus连接上去发现数据库未启动,尝试手动starup启动数据库,提示”ORA-03113:通信通道的文件结尾,进程id:7776 会话 ID: 322 序列号:25”的错误。 进入到oracle 日志目录下,在alter_yangquan123.log发现有明显报错“ORA-00338: log 1 of thread 1 is more recent than control file”,该错误意思是redo日志中的记录比控制文件新。
ORA-00338: log 1 of thread 1 is more recent than control file
手动创建控制文件
1 2 3 4
oradebug setmypid oradebug tracefile_name alter database backup controlfile to trace; select value from v$diag_info where name ='Diag Trace';
查看错误日志
在alert_yangquan123.log日志中,我们可以看到以下这段
1 2 3
alter database backup controlfile to trace Backup controlfile written to trace file e:\app\adminsilu\diag\rdbms\yangquan123\trace\yangquan123_ora_20768.trc Completed: alter database backup controlfile to trace
SQL> select tablespace_name, status, segment_name from dba_rollback_segs where status != 'OFFLINE'; TABLESPACE_NAME STATUS SEGMENT_NAME ------------------------------ ---------------- ------------------------------ SYSTEM ONLINE SYSTEM
SQL> drop tablespace UNDOTBS including contents and datafiles;
关闭数据库实例
1
SQL> shutdown immediate;
启动数据库实例到NOMOUNT状态
1
SQL> startup nomount;
修改spfile中的undo_tablespace参数
1
SQL> alter system set undo_tablespace='UNDOTBS1' scope=spfile;
启动数据库实例(使用spfile)
1 2
SQL> startup; SQL> select name,open_mode from v$database; #查看数据库状态并监测
几分钟后发现数据库未关闭,但是日志中依然有报错
ORA-08102: index key not found,obj#289,file 1,block 2025(2);
删除索引
1 2 3 4 5 6 7 8 9
SQL> col object_name format a15; SQL> col owner format a10; SQL> select o.owner, o.object_name, o.object_id, o.object_type from dba_objects o where o.object_id = 289;