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

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: {=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: {=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: {=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: {=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帮助下操作。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

汪灵骅

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值