推进scn号

环境是linux,11.2.0.4

  1. 进行不完全恢复
recover database until cancel;
ORA-01194: file 1 needs more recovery to be consistent 
ORA-01110: data file 1: '/u01/oracle/oradata/orcl/system01.dbf'
  1. 用隐含参数打开数据库
select file#,to_char(checkpoint_change#,'999999999999') from vdatafile;
select file#,online_status,to_char(change#,'999999999999') from vrecover_file;
select file#,to_char(checkpoint_change#,'999999999999') from v$datafile_header;

使用隐含参数打开数据库:

_allow_resetlogs_corruption= TRUE

alter database open resetlogs;
  1. open时报错

中间要是open报错,alert日志显示如ora-01555之类的,就需要使用oradebug在mount状态下推进SCN

1.当前数据库的Current SCN
select current_scn||'' from vdatabase;
2.重启到mount
3.使用oradebug poke推进SCN
SYS@orcl> oradebug setmypid
Statement processed.
SYS@orcl> oradebug dumpvar sga kcsgscn_
kcslf kcsgscn_ [06001AE70, 06001AEA0) = 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 6001AB50 00000000

查询scn是65351968,改成85351968
SYS@orcl> oradebug poke 0x06001AE70 8 85351968
SYS@orcl> oradebug dumpvar sga kcsgscn_

alter database open;
select current_scn||'' from vdatabase;

最后改回来
alter system set "_allow_resetlogs_corruption" = false scope=spfile;

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注