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;
原文地址:https://www.cnblogs.com/binliubiao/p/15185961.html