ORA-01195: online backup of file 1 needs more recovery to be consistent

问题背景:
客户测试环境启动报错,协助排查处理


1> 启动日志

复制代码
 1 SQL> startup;
 2 ORACLE instance started.
 3 
 4 Total System Global Area 1603411968 bytes
 5 Fixed Size    2213776 bytes
 6 Variable Size    1056966768 bytes
 7 Database Buffers    536870912 bytes
 8 Redo Buffers    7360512 bytes
 9 Database mounted.
10 ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
复制代码
1 SQL> alter database open RESETLOGS;
2 alter database open RESETLOGS
3 *
4 ERROR at line 1:
5 ORA-01195: online backup of file 1 needs more recovery to be consistent
6 ORA-01110: data file 1: '/data/oracle/oradata/ecology/system01.dbf'

 

原因分析:
2> 数据库恢复的时侯有一个问题:
DB恢复需要这个归档日志文件/data/oracle/flash_recovery_area/ECOLOGY/archivelog/2020_01_14/o1_mf_1_165_%u_.arc,
但是在备份中没有。

复制代码
 1 SQL> recover database using backup controlfile until cancel;
 2 ORA-00279: change 28004892 generated at 11/24/2019 02:00:30 needed for thread 1
 3 ORA-00289: suggestion :
 4 /data/oracle/flash_recovery_area/ECOLOGY/archivelog/2020_01_14/o1_mf_1_165_%u_.arc
 5 ORA-00280: change 28004892 for thread 1 is in sequence #165
 6 
 7 Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
 8 
 9 ORA-00308: 无法打开归档日志
10 '/data/oracle/flash_recovery_area/ECOLOGY/archivelog/2020_01_14/o1_mf_1_165_%u_.
11 arc'
12 ORA-27037: 无法获得文件状态
13 Linux-x86_64 Error: 2: No such file or directory
14 Additional information: 3
15 
16 ORA-10879: error signaled in parallel recovery slave
17 ORA-01547: 警告: RECOVER 成功但 OPEN RESETLOGS 将出现如下错误 ORA-01195:
18 文件 1 的联机备份需要更多的恢复来保持一致性 ORA-01110: 数据文件
19 1: '/data/oracle/oradata/ecology/system01.dbf'
复制代码


解决过程:
准备使用隐含参数_allow_resetlogs_corruption强制启动DB:
提示:Oracle的隐含参数只应该在测试环境或者在Oracle Support的支持下使用。
设置此参数之后,在数据库Open过程中,Oracle会跳过某些一致性检查,从而使数据库可能跳过不一致状态。

复制代码
 1 SQL> shutdown immediate;
 2 ORA-01109: database not open
 3 
 4 Database dismounted.
 5 ORACLE instance shut down.
 6 SQL> startup;
 7 ORACLE instance started.
 8 
 9 Total System Global Area 1603411968 bytes
10 Fixed Size    2213776 bytes
11 Variable Size    1056966768 bytes
12 Database Buffers    536870912 bytes
13 Redo Buffers    7360512 bytes
14 Database mounted.
15 ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
16 
17 SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;
18 System altered.
19 
20 SQL> alter database open resetlogs;
21 alter database open resetlogs
22 *
23 ERROR at line 1:
24 ORA-00603: ORACLE server session terminated by fatal error
25 ORA-00600: internal error code, arguments: [2662], [0], [28004903], [0],
26 [28017149], [12583040], [], [], [], [], [], []
27 ORA-00600: internal error code, arguments: [2662], [0], [28004902], [0],
28 [28017149], [12583040], [], [], [], [], [], []
29 ORA-01092: ORACLE instance terminated. Disconnection forced
30 ORA-00600: internal error code, arguments: [2662], [0], [28004900], [0],
31 [28017149], [12583040], [], [], [], [], [], []
32 Process ID: 5434
33 Session ID: 115 Serial number: 3
复制代码

 

以上强制启动后,产生Ora-600错误了,在预料之中

强制启动

复制代码
 1 [oracle@oat ecology]$ sqlplus / as sysdba
 2 
 3 SQL*Plus: Release 11.2.0.1.0 Production on Tue Jan 14 13:21:18 2020
 4 Copyright (c) 1982, 2009, Oracle. All rights reserved.
 5 Connected to an idle instance.
 6 
 7 SQL> startup force;
 8 ORACLE instance started.
 9 
10 Total System Global Area 1603411968 bytes
11 Fixed Size    2213776 bytes
12 Variable Size    1056966768 bytes
13 Database Buffers    536870912 bytes
14 Redo Buffers    7360512 bytes
15 Database mounted.
16 Database opened.
17 SQL>
复制代码

 

现在没问题了,把隐含参数改回默认的:

1 SQL> 
2 SQL> alter system set "_allow_resetlogs_corruption" =false scope=spfile;
4 System altered.

 

关闭测试启动

复制代码
 1 SQL> shutdown immedaite;
 2 SP2-0717: illegal SHUTDOWN option
 3 SQL> shutdown immediate;
 4 Database closed.
 5 Database dismounted.
 6 ORACLE instance shut down.
 7 
 8 SQL> startup;
 9 ORACLE instance started.
10 
11 Total System Global Area 1603411968 bytes
12 Fixed Size    2213776 bytes
13 Variable Size    1056966768 bytes
14 Database Buffers    536870912 bytes
15 Redo Buffers    7360512 bytes
16 Database mounted.
17 Database opened.
18 SQL>
复制代码

 

问题解决

posted on 2020-06-12 10:46  数据与人文  阅读(843)  评论(0编辑  收藏  举报