昨天有一哥们把日志文件给清了,现在数据库起不来了,唉...哪位大侠知道该咋办呀???? SQL> startup 
ORA-32004: obsolete and/or deprecated parameter(s) specified 
ORACLE instance started. Total System Global Area 3340451840 bytes 
Fixed Size                  2149000 bytes 
Variable Size            2013267320 bytes 
Database Buffers        1308622848 bytes 
Redo Buffers              16412672 bytes 
Database mounted. 
ORA-00320: cannot read file header from log 2 of thread 1 
ORA-00312: online log 2 thread 1: '/opt/oracle/oradata/ora11/redo02.log' 
ORA-27069: attempt to do I/O beyond the range of the file 
Additional information: 1 
Additional information: 1 
SQL> select group#,sequence#,archived,status from v$log;     GROUP#  SEQUENCE# ARCHIVED  STATUS 
---------- ---------- --------- ------------------------------------------------ 
        2      1694 NO        CURRENT 
        1      1693 NO        INACTIVE 

解决方案 »

  1.   

    只有一组吗?
    利用addlog新建日志
      

  2.   

    try:
    conn / as sysdba;
    startup mount;
    recover database until cancel;
    alter database open resetlogs;
      

  3.   

    SQL> recover database until cancel;ORA-00279: change 83957998 generated at 06/11/2009 08:51:27 needed for thread 1
    ORA-00289: suggestion :
    /opt/oracle/flash_recovery_area/ORA11/archivelog/2009_06_11/o1_mf_1_1694_%u_.arc
    ORA-00280: change 83957998 for thread 1 is in sequence #1694
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    ORA-00308: cannot open archived log
    '/opt/oracle/flash_recovery_area/ORA11/archivelog/2009_06_11/o1_mf_1_1694_%u_.ar
    c'
    ORA-27037: unable to obtain file status
    Linux-x86_64 Error: 2: No such file or directory
    Additional information: 3
    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/ora11/system01.dbf'
      

  4.   

    SQL> recover database until cancel;ORA-00279: change 83957998 generated at 06/11/2009 08:51:27 needed for thread 1
    ORA-00289: suggestion :
    /opt/oracle/flash_recovery_area/ORA11/archivelog/2009_06_11/o1_mf_1_1694_%u_.arc
    ORA-00280: change 83957998 for thread 1 is in sequence #1694
    Specify log: { <RET>=suggested | filename | AUTO | CANCEL} 在这里输入cancel
      

  5.   

    是所有的redo log都删除了是吧。如果都删除了的话,可以用类似ls的方法
    先到mount状态。SQL> recover database until cancel using backup controlfile;
    到指定用redo来recovery的时候,输入cancel。因为你的redo文件已经没有了如果提示media recovery complete的话就成功了。然后
    SQL>alter database open resetlogs;
      

  6.   

    recover database until cancel 似乎是失败了,各们大侠看看还有得救么,谢谢了!!!
    SQL> recover database until cancel;
    ORA-00279: change 84105402 generated at 06/12/2009 09:04:52 needed for thread 1
    ORA-00289: suggestion :
    /opt/oracle/flash_recovery_area/ORA11/archivelog/2009_06_12/o1_mf_1_8_%u_.arc
    ORA-00280: change 84105402 for thread 1 is in sequence #8
    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/ora11/system01.dbf'
    ORA-01112: media recovery not started
    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: '/opt/oracle/oradata/ora11/system01.dbf'
      

  7.   

    Oracle数据库联机日志文件丢失处理方法 试验一:用命令清空日志组方法 
    1、 查看原来表中数据 
    SQL>; conn test/test 
    Connected. 
    SQL>; select * from test;       TEL 
    ---------- 
            1 
            2 
            3 
    2、插入新数据 
    SQL>; insert into test values(4); 
    1 row created. 
    SQL>; commit; 
    Commit complete. 
    SQL>; 
    3、 正常关闭数据库 
    4、 利用os command删除所有redo文件 
    5、 启动数据库 
    SQL>; startup 
    ORACLE instance started. 
    Total System Global Area  353862792 bytes 
    Fixed Size                   730248 bytes 
    Variable Size             285212672 bytes 
    Database Buffers           67108864 bytes 
    Redo Buffers                 811008 bytes 
    Database mounted. 
    ORA-00313: open failed for members of log group 1 of thread 1 
    ORA-00312: online log 1 thread 1: '/T3/ORACLE/oradata/ORA9/redo01.log' 
    6、 查看当前日志状态 
    SQL>; select * from v$log;    GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS 
    ---------- ---------- ---------- ---------- ---------- --- ---------------- 
    FIRST_CHANGE# FIRST_TIME 
    ------------- ---------- 
            1          1          2  104857600          1 YES INACTIVE 
          487837 01-9月 -05         2          1          4  104857600          1 NO  CURRENT 
          487955 01-9月 -05         3          1          3  104857600          1 YES INACTIVE 
          487839 01-9月 -05 
    看来redo01.log不是当前日志,对于这类非当前日志可以直接clear,系统会重新自动生成一个redo文件 7、SQL>; alter database clear logfile group 1; 
    Database altered. 
    7、 继续启动db 
    SQL>; alter database open; 
    alter database open 

    ERROR at line 1: 
    ORA-00313: open failed for members of log group 2 of thread 1 
    ORA-00312: online log 2 thread 1: '/T3/ORACLE/oradata/ORA9/redo02.log' 
    8、 看来redo也得恢复,但是redo02是当前redo,直接clear是不行的 
    SQL>; alter database clear logfile group 2; 
    alter database clear logfile group 2 

    ERROR at line 1: 
    ORA-00350: log 2 of thread 1 needs to be archived 
    ORA-00312: online log 2 thread 1: '/T3/ORACLE/oradata/ORA9/redo02.log' 
    尝试clear unarchived logfile group ,报错: 
    SQL>; alter database clear unarchived logfile group 2; 
    alter database clear unarchived logfile group 2 

    ERROR at line 1: 
    ORA-00313: open failed for members of log group 2 of thread 1 
    ORA-00312: online log 2 thread 1: '/T3/ORACLE/oradata/ORA9/redo02.log' 
    ORA-27037: unable to obtain file status 
    SVR4 Error: 2: No such file or directory 
    Additional information: 3 
    看来他是因为找不到这个文件,从有效的备份中cp一个过来看看 
    SQL>; host cp /T3/ORACLE/oradatabak/redo02* /T3/ORACLE/oradata/ORA9 SQL>; alter database clear unarchived logfile group 2; Database altered. 
    搞定………. 9、 按照oracle的某些做法也是可以的 
    SQL>; alter database clear unarchived logfile group 1 unrecoverable datafile; Database altered. 10、但是对于非当前日志就都可以,下面看看redo03 
    SQL>;  alter database clear logfile group 3; Database altered. 结论: 
    如果数据库是正常shutdown,非当前日志都可以直接clear来重新生成,而且不丢失数据,因为正常关闭db,数据已经写入dbf文件了。唯独当前日志不可以,当前日志必须首先从有效的备份中拷贝一个日志文件过来,然后用 
    alter database clear unarchived logfile group n 或alter database clear unarchived logfile group n,除此之外,还可以用下面的方法来做 方法二:用cancel模式恢复数据库 
    前面的出错提示,步骤都一样,唯独恢复的方法不一样 
    SQL>; startup 
    ORACLE instance started. 
    Total System Global Area  353862792 bytes 
    Fixed Size                   730248 bytes 
    Variable Size             285212672 bytes 
    Database Buffers           67108864 bytes 
    Redo Buffers                 811008 bytes 
    Database mounted. 
    ORA-00313: open failed for members of log group 1 of thread 1 
    ORA-00312: online log 1 thread 1: '/T3/ORACLE/oradata/ORA9/redo01.log' 
    看看丢失了哪些redo 
    SQL>; host ls /T3/ORACLE/oradarta/ORA9/redo* 
    /T3/ORACLE/oradarta/ORA9/redo*: No such file or directory 
    看来redo都丢了 
    直接recover 
    本贴来自天极网群乐社区--http://q.yesky.com/group/review-6992095.html
      

  8.   

    SQL> archive log list;
    Database log mode              No Archive Mode
    Automatic archival             Disabled
    Archive destination            USE_DB_RECOVERY_FILE_DEST
    Oldest online log sequence     7
    Current log sequence           8
      

  9.   

    in mount mode ,execute:
    alter system set "_allow_resetlogs_corruption"=true scope=spfile;
    shutdown immeidate;
    startup mount;
    recover database until cancel;
    alter database open resetlogs;_allow_resetlogs_corruption强制启动数据库,设置此参数之后,在数据库Open过程中,Oracle会跳过某些一致性检查,从而使数据库可能跳过不一致状态,Open打开
      

  10.   


    非常不幸,这样的问题被你碰到了,根据我做的实验,一般情况下,失去logfile可以通过我和welyngj说介绍的方法来进行恢复的,但是,估计是你的机器没有正常的关机,比如说断电,或者直接关系统,造成了恢复不成功的问题。我在我自己的机器上通过shutdown abort的方式,和可以模拟出你的情况实验如下
    一 可恢复状况
    SQL> insert into test1.tt1 values(3,'111','');
    SQL> insert into test1.tt1 values(4,'111','');
    SQL> insert into test1.tt1 values(5,'111','');
    SQL> commit;
    SQL>shutdown immedaite;待shutdown后,删除掉redon.log恢复
    SQL>startup mount;
    SQL>recover database until cancel using backup controlfile; 
    指定日志: {<RET>=suggested | filename | AUTO | CANCEL}
    cancel
    Media recovery cancel.SQL>alter database open resetlogs数据库打开,恢复成功
    二 不可恢复状况
    SQL> insert into test1.tt1 values(6,'111','');
    SQL> insert into test1.tt1 values(7,'111','');
    SQL> insert into test1.tt1 values(8,'111','');
    SQL> commit;
    SQL>shutdown abort;
    拷贝redon.log到其他的地方。SQL>startup mount;
    SQL>recover database until cancel using backup controlfile; 
    指定日志: {<RET>=suggested | filename | AUTO | CANCEL}
    cancel
    Media recovery cancel.提示数据库不一致,已经无法恢复了(如果没有redo的备份的话)。由于我已经备份过redo了
    所以我还是可以恢复我的database还是使用上面的方法,不过是到
    SQL>recover database until cancel using backup controlfile; 
    指定日志: {<RET>=suggested | filename | AUTO | CANCEL}
    这里
    输入你备份的那个redo.log路径就可以了指定日志: {<RET>=suggested | filename | AUTO | CANCEL}
    F:\developer\oracle\product\10.2.0\oradata\REDO03.LOG
    已应用的日志。
    完成介质恢复。不过这里你没有redo的备份,还是可以通过设置隐含参数来启动数据库,
    如welyngj所说的_allow_resetlogs_corruption设置为true
    可以create pfile='init.ora的路径' from spfile;  把spfile导出到pfile后,在导出的init.ora里加入_allow_resetlogs_corruption=true然后从pfile启动
    startup pfile='init.ora的路径';这时数据库可以起来,但是这个数据库是很危险的,把数据库的数据exp出来,重建数据库。
      

  11.   

    运行到  recover database until cancel;  的时候还是出错了!!!
    SQL> in mount mode ,execute:
    SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;
    SP2-0640: Not connected
    SQL> connect /as sysdba
    Connected.
    SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;System altered.SQL> shutdown immeidate;
    SP2-0717: illegal SHUTDOWN option
    SQL> shutdown immediata
    SP2-0717: illegal SHUTDOWN option
    SQL> shutdown immediate;
    ORA-01109: database not open
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup mount;
    ORA-32004: obsolete and/or deprecated parameter(s) specified
    ORACLE instance started.Total System Global Area 3340451840 bytes
    Fixed Size                  2149000 bytes
    Variable Size            2013267320 bytes
    Database Buffers         1308622848 bytes
    Redo Buffers               16412672 bytes
    Database mounted.
    SQL> recover database until cancel;
    ORA-00283: recovery session canceled due to errors
    ORA-01610: recovery using the BACKUP CONTROLFILE option must be done
      

  12.   

    加上 BACKUP CONTROLFILE option以后运行如下:
    SQL> recover database until cancel using backup controlfile;
    ORA-00279: change 84105402 generated at 06/12/2009 09:04:52 needed for thread 1
    ORA-00289: suggestion :
    /opt/oracle/flash_recovery_area/ORA11/archivelog/2009_06_12/o1_mf_1_8_%u_.arc
    ORA-00280: change 84105402 for thread 1 is in sequence #8
    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/ora11/system01.dbf'
    ORA-01112: media recovery not started
      

  13.   


    非常不幸,这样的问题被你碰到了, 根据我做的实验,一般情况下,失去logfile可以通过我和welyngj说介绍的方法来进行恢复的,但是,估计是你的机器没有正常的关机,比如说断电,或者直接关系统,造成了恢复不成功的问题。 我在我自己的机器上通过shutdown abort的方式,和可以模拟出你的情况 实验如下 
    一 可恢复状况 
    SQL> insert into test1.tt1 values(3,'111',''); 
    SQL> insert into test1.tt1 values(4,'111',''); 
    SQL> insert into test1.tt1 values(5,'111',''); 
    SQL> commit; 
    SQL>shutdown immedaite; 待shutdown后,删除掉redon.log 恢复 
    SQL>startup mount; 
    SQL>recover database until cancel using backup controlfile; 
    指定日志: { <RET>=suggested | filename | AUTO | CANCEL} 
    cancel 
    Media recovery cancel. SQL>alter database open resetlogs 数据库打开,恢复成功 
    二 不可恢复状况 
    SQL> insert into test1.tt1 values(6,'111',''); 
    SQL> insert into test1.tt1 values(7,'111',''); 
    SQL> insert into test1.tt1 values(8,'111',''); 
    SQL> commit; 
    SQL>shutdown abort; 
    拷贝redon.log到其他的地方。 SQL>startup mount; 
    SQL>recover database until cancel using backup controlfile; 
    指定日志: { <RET>=suggested | filename | AUTO | CANCEL} 
    cancel 
    Media recovery cancel. 提示数据库不一致,已经无法恢复了(如果没有redo的备份的话)。 由于我已经备份过redo了 
    所以我还是可以恢复我的database 还是使用上面的方法,不过是到 
    SQL>recover database until cancel using backup controlfile; 
    指定日志: { <RET>=suggested | filename | AUTO | CANCEL} 
    这里 
    输入你备份的那个redo.log路径就可以了 指定日志: { <RET>=suggested | filename | AUTO | CANCEL} 
    F:\developer\oracle\product\10.2.0\oradata\REDO03.LOG 
    已应用的日志。 
    完成介质恢复。 不过这里你没有redo的备份,还是可以通过设置隐含参数来启动数据库, 
    如welyngj所说的_allow_resetlogs_corruption设置为true 
    可以create pfile='init.ora的路径' from spfile;  把spfile导出到pfile后,在导出的init.ora里加入_allow_resetlogs_corruption=true 然后从pfile启动 
    startup pfile='init.ora的路径'; 这时数据库可以起来,但是这个数据库是很危险的,把数据库的数据exp出来,重建数据库。 
      

  14.   

    /opt/oracle/oradata/ora11/system01.dbf 有没有备份过??
      

  15.   

    我是这样做的:
    1.SQL>create pfile='/opt/oracle/product/11g/db/dbs/init.ora' from spfile;2.修改/opt/oracle/product/11g/db/dbs/init.ora在文件最后加上一行:_allow_resetlogs_corruption=true 3.SQL> connect /as sysdba
      Connected to an idle instance.
      SQL> startup pfile='/opt/oracle/product/11g/db/dbs/init.ora';
      ORA-32006: USER_DUMP_DEST initialization parameter has been deprecated
      ORACLE instance started.  Total System Global Area 3340451840 bytes
      Fixed Size                  2149000 bytes
      Variable Size            2013267320 bytes
      Database Buffers         1308622848 bytes
      Redo Buffers               16412672 bytes
      Database mounted.
      ORA-00603: ORACLE server session terminated by fatal error
      Process ID: 15711
      Session ID: 665 Serial number: 5不知中间是否缺少步骤?
      

  16.   

    看能不能打开
    alter database open resetlogs;
      

  17.   

    SQL> alter database open resetlogs;
         alter database open resetlogs
         *
         ERROR at line 1:
         ORA-01034: ORACLE not available
         Process ID: 0
         Session ID: 0 Serial number: 0
      

  18.   

    先到mount状态,才能再alter open的SQL>startup pfile='/opt/oracle/product/11g/db/dbs/init.ora' mount;SQL>alter database open resetlogs; 
      

  19.   

    SQL> startup pfile='/opt/oracle/product/11g/db/dbs/init.ora' mount
         ORA-32006: USER_DUMP_DEST initialization parameter has been deprecated
         ORACLE instance started.    Total System Global Area 3340451840 bytes
        Fixed Size                  2149000 bytes
        Variable Size            2013267320 bytes
        Database Buffers         1308622848 bytes
        Redo Buffers               16412672 bytes
        Database mounted.
        
        SQL> alter database open resetlogs;
        alter database open resetlogs
        *
        ERROR at line 1:
        ORA-01139: RESETLOGS option only valid after an incomplete database recovery
      

  20.   

    感觉你的参数_allow_resetlogs_corruption=true好像没有生效,你确定加进去了么
    show一把看看
    show parameter _allow_
    如果加进去了这个隐含参数,是可以打开
      

  21.   

    SQL> show parameter _allow_NAME                                 TYPE
    ------------------------------------ ---------------------------------
    VALUE
    ------------------------------
    _allow_resetlogs_corruption          boolean
    TRUE
    SQL> shutdown immediate
    ORA-01109: database not open
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup pfile='/opt/oracle/product/11g/db/dbs/init.ora' mount;
    ORA-32006: USER_DUMP_DEST initialization parameter has been deprecated
    ORACLE instance started.Total System Global Area 3340451840 bytes
    Fixed Size                  2149000 bytes
    Variable Size            2013267320 bytes
    Database Buffers         1308622848 bytes
    Redo Buffers               16412672 bytes
    Database mounted.
    SQL> show parameter _allow_NAME                                 TYPE
    ------------------------------------ ---------------------------------
    VALUE
    ------------------------------
    _allow_resetlogs_corruption          boolean
    TRUE
    SQL> alter database open resetlogs;
    alter database open resetlogs
    *
    ERROR at line 1:
    ORA-01139: RESETLOGS option only valid after an incomplete database recovery
      

  22.   

    再来一次试试看:
    上一次恢复有可能没有用那个参数:
    recover database until cancel;
    alter database open resetlogs;
    如果不行,不知道大家还有没有招?
      

  23.   


    应该可以的,我以前做过这样的恢复,而且刚刚又做了一次实验,没有问题的。不过recovery应该不需要做了,他现在一没有归档,而没有redo,做也是直接cancel。直接设置好隐性参数,open resetlogs,就可以了。
      

  24.   


    sorry,反馈的好快,刚才没有看到上面的内容,隐性都已经做了,你就在recovery一把吧,要不他一直觉得你是completely的。
      

  25.   


    也可以先查看一下,redo的文件有没有生成,如果有的话,就先直接alter database open一下试试
      

  26.   

    全部删除了?还是怎么?删除前是clear shutdown 的吗?如果是,重建控制.如果不是,要看了.如果undo中还有active ts的话,就会比较麻烦些.
      

  27.   

    楼主,最好是把出事前的东西描述清楚些.是在什么操作下删除了?  删除的时候数据库是已经干净关闭的吗?如果不是的,那么删除时,有活动事务吗?先把现场备份一下再说.你需要再recover,以更新控制文件中的信息.cancel就可.再尝试是否能open;