zoukankan      html  css  js  c++  java
  • Oracle-redo logfile损坏问题

    查看redo状态

    col member for a60
    col status for a12
    col SCN_NUM for a20
    set lines 168 pages 99
    
    SELECT thread#
          ,a.sequence#
          ,a.group#
          ,to_char(first_change#, '999999999999') SCN_NUM
           ,a.status
           ,MEMBER
      FROM v$log a, v$logfile b
     WHERE a.group# = b.group#
     ORDER BY a.sequence# DESC;
    
    

    inactive redo logfile恢复

    清理日志即可

    不需重启数据库

    -- 归档模式
    alter database clear unarchived logfile group 2;
    
    -- 非归档模式
    alter database clear logfile group 2;
    

    current/active redo logfile

    数据库正常关闭的情况

    启动到mount状态下,然后clear损坏日志

    shutdown immediate;
    startup mount;
    alter system switch logfile;
    alter database clear unarchived logfile group 2;
    alter database open;
    

    数据库非正常关闭的情况

    使用备份进行恢复

    
    

    使用隐含参数

    startup mount;
    
    select ksppinm, ksppstvl from x$ksppi x, x$ksppcv y  where (x.indx = y.indx) and (translate(ksppinm, '_', '#')) like '_allow_resetlogs_corruption';
    
    -- 在数据不一致的情况下,重置日志文件
    alter system set "_allow_resetlogs_corruption"=true scope=spfile;
    
    shutdown immediate;
    startup mount;
    recover database until cancel;
    
    alter database open resetlogs;
    
  • 相关阅读:
    centos6.4下django1.11.3项目的部署
    inner join和left join 、right join 的区别?
    php中的对象赋值
    windows下Call to undefined function curl_init() error问题
    include和require的区别误区
    第一车网笔试题
    借贷宝笔试题
    40斤西瓜3人分,求分法
    走楼梯算法
    ip地址分类
  • 原文地址:https://www.cnblogs.com/binliubiao/p/15185961.html
Copyright © 2011-2022 走看看