ITPub博客

首页 > 数据库 > Oracle > oracle redo各种状态(inactive、active、current)损坏的处理方式

oracle redo各种状态(inactive、active、current)损坏的处理方式

原创 Oracle 作者:wanglinghua0907 时间:2024-01-24 14:43:57 0 删除 编辑

1.inactive状态的redo损坏

如果这个日志是inactive,手动执行clearing操作:

SQL> alter database clear logfile group 2;

alter database clear logfile group 2

*

第 1 行出现错误:

ORA-00350: 日志 2 (实例 orcl 的日志, 线程 1) 需要归档

ORA-00312: 联机日志 2 线程 1:

F:ORACLEPRODUCT10.2.0ORADATAORCLREDO02.LOG

 

执行如下操作:

SQL> alter database clear unarchived logfile group 2;

数据库已更改。


2.active状态的redo损坏

存在归档直接使用归档恢复即可

SYS@orcl11g>recover database until cancel; --指定恢复的时间点(如果不知道,就是untill cancel)

ORA-00279: change 1763218 generated at 06/24/2021 12:02:00 needed for thread 1

ORA-00289: suggestion : /u01/app/oracle/arch/1_74_816622368.dbf

ORA-00280: change 1763218 for thread 1 is in sequence #74

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

/u01/app/oracle/arch/1_74_816622368.dbf

ORA-00279: change 1769094 generated at 06/24/2021 13:34:43 needed for thread 1

ORA-00289: suggestion : /u01/app/oracle/arch/1_75_816622368.dbf

ORA-00280: change 1769094 for thread 1 is in sequence #75

ORA-00278: log file '/u01/app/oracle/arch/1_74_816622368.dbf' no longer needed for this recovery

 

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

/u01/app/oracle/oradata/orcl11g/redo01.log --指定current日志

Log applied.

Media recovery complete.


3.current状态redo损坏

查看隐藏参数
col name for a30
col VALUE for a10
col DESCRIB for a40
set lines 200
SELECT x.ksppinm NAME, y.ksppstvl VALUE, x.ksppdesc describ
FROM SYS.x$ksppi x, SYS.x$ksppcv y
WHERE x.inst_id = USERENV ('Instance')
AND y.inst_id = USERENV ('Instance')
AND x.indx = y.indx
AND x.ksppinm LIKE '%&par%';

设置隐藏参数:(默认是FALSE)

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


SYS@orcl11g> recover database until cancel;

ORA-00279: change 1789650 generated at 06/24/2021 13:40:21 needed for thread 1

ORA-00289: suggestion : /u01/app/oracle/arch/1_2_818948248.dbf

ORA-00280: change 1789650 for thread 1 is in sequence #2

 

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

/u01/app/oracle/arch/1_2_818948248.dbf

ORA-00279: change 1789904 generated at 06/24/2021 13:41:02 needed for thread 1

ORA-00289: suggestion : /u01/app/oracle/arch/1_3_818948248.dbf

ORA-00280: change 1789904 for thread 1 is in sequence #3

ORA-00278: log file '/u01/app/oracle/arch/1_2_818948248.dbf' no longer needed

for this recovery

 

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: '/u01/app/oracle/oradata/orcl11g/system01.dbf'

 

SYS@orcl11g> alter database open resetlogs;

Database altered.



生产数据库需谨慎,建议在专业dba帮助下操作。


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69980685/viewspace-3004960/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
Oracle ACE、sql server、oceanbase数据库专家,拥有7年以上的大型数据库运维经验,主方向oracle,擅长故障排除、诊断,大体量(TB)迁移,异常故障修复等。拥有丰富主导大型项目经验。服务行业包括:运营商、银行、金融业、政府单位、医疗、制造业、高校等等。

注册时间:2020-07-31

  • 博文量
    116
  • 访问量
    88779