zoukankan      html  css  js  c++  java
  • 解决ORA-00338,ORA-00312

    --测试库异常无法启动
    SQL> startup;
    ORACLE instance started.

    Total System Global Area 4977278976 bytes
    Fixed Size 2261768 bytes
    Variable Size 989859064 bytes
    Database Buffers 3976200192 bytes
    Redo Buffers 8957952 bytes
    Database mounted.
    ORA-00338: log 2 of thread 1 is more recent than control file
    ORA-00312: online log 2 thread 1: '/u02/oradata/GBK/redo02.log'

    --查询日志组
    SQL> select group#,thread#,members,status from v$log;

    GROUP# THREAD# MEMBERS STATUS
    ---------- ---------- ---------- ------------------------------------------------
    1 1 1 INACTIVE
    3 1 1 UNUSED
    2 1 1 CURRENT
    --清除日志组,切换redo日志
    SQL> alter database clear logfile group 1;

    Database altered.

    SQL> alter database clear logfile group 2;
    alter database clear logfile group 2
    *
    ERROR at line 1:
    ORA-01624: log 2 needed for crash recovery of instance GBK (thread 1)
    ORA-00312: online log 2 thread 1: '/u02/oradata/GBK/redo02.log'


    SQL> alter database clear logfile group 3;

    Database altered.

    SQL> alter system switch logfile;
    alter system switch logfile
    *
    ERROR at line 1:
    ORA-01109: database not open


    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 resetlogs;
    alter database open resetlogs
    *
    ERROR at line 1:
    ORA-01194: file 1 needs more recovery to be consistent
    ORA-01110: data file 1: '/u02/oradata/GBK/system01.dbf'

    ---删除日志组也不成功
    SQL> alter database drop logfile group 2;
    alter database drop logfile group 2
    *
    ERROR at line 1:
    ORA-01623: log 2 is current log for instance GBK (thread 1) - cannot drop
    ORA-00312: online log 2 thread 1: '/u02/oradata/GBK/redo02.log'

    最终解决办法:使用不完全恢复

    SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;

    System altered.

    SQL> startup force
    ORACLE instance started.

    Total System Global Area 285212672 bytes
    Fixed Size 1218992 bytes
    Variable Size 88082000 bytes
    Database Buffers 192937984 bytes
    Redo Buffers 2973696 bytes
    Database mounted.
    ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

    SQL> alter database open resetlogs;

    Database altered.

    SQL> alter system set "_allow_resetlogs_corruption"=false scope=spfile;

    System altered.

    不畏将来,不念过往,如此,安好。--vast desert
  • 相关阅读:
    洛谷 P2330 [SCOI2005]繁忙的都市
    2016-2017 ACM-ICPC, Asia Tsukuba Regional Contest D Hidden Anagrams
    HDU1792A New Change Problem(GCD规律推导)
    HDU1222Wolf and Rabbit(GCD思维)
    poj2635The Embarrassed Cryptographer(同余膜定理)
    poj3270Cow Sorting(置换+贪心)
    计数排序(O(n+k)的排序算法,空间换时间)
    POJ1222EXTENDED LIGHTS OUT(高斯消元)
    BZOJ 2038: [2009国家集训队]小Z的袜子(hose) (莫队算法)
    2301: [HAOI2011]Problem b ( 分块+莫比乌斯反演+容斥)
  • 原文地址:https://www.cnblogs.com/damo-h/p/14144628.html
Copyright © 2011-2022 走看看