ORA-01194: file 1 needs more recovery to be consistent

今天在做循序渐进oracle第421页的实验时,按照老盖的步骤居然打不开数据库!于是网上左右百度google,终于使用下面的方法解决!
使用shutdown immediate,等了一会没有结束,于是直接结束了进程,后来又出来一个问题
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/u01/app/oracle/oradata/orcl/system01.dbf'

估计应该是日志的问题,又试了下:
SYS@orcl>recover database using backup controlfile until cancel;
ORA-00279: change 747999 generated at 04/09/2014 15:03:10 needed for thread 1
ORA-00289: suggestion : /opt/oracle/archive/arch_1_46_808410282.dbf
ORA-00280: change 747999 for thread 1 is in sequence #46


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
cancel
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/opt/oracle/oradata/orcl/system01.dbf'

ORA-01112: media recovery not started

根据上面提示的内容,注意到 ‘change 747999’ 和 ‘sequence #46’
从网上看到一条语句,可以查出redo logs ,注意要用sys:
SQL> conn sys/oracle as sysdba                        
Connected.
SYS@orcl>select v1.group#, member, sequence#, first_change#
  2   from v$log v1, v$logfile v2
  3   where v1.group# = v2.group#;

    GROUP# MEMBER                                              SEQUENCE# FIRST_CHANGE#
---------- -------------------------------------------------- ---------- -------------
         1 /opt/oracle/oradata/orcl/redo01.log                         0             0
         3 /opt/oracle/oradata/orcl/redo03.log                         0             0
         2 /opt/oracle/oradata/orcl/redo02.log                         0             0;

从结果里根据 sequence# 和 first_change# 找到了要用到的log file name:
/opt/oracle/oradata/orcl/redo01.log

在 Specify log: {<RET>=suggested | filename | AUTO | CANCEL} 下面输入:

/u01/app/oracle/oradata/orcl/redo03.log


SYS@orcl>recover database using backup controlfile until cancel;
ORA-00279: change 747999 generated at 04/09/2014 15:03:10 needed for thread 1
ORA-00289: suggestion : /opt/oracle/archive/arch_1_46_808410282.dbf
ORA-00280: change 747999 for thread 1 is in sequence #46


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/opt/oracle/oradata/orcl/redo01.log
Log applied.
Media recovery complete.

接着:
SYS@orcl>alter database open resetlogs;

Database altered.
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值