首页 > 数据库 > mysql教程 > shutdownabort模式丢失redo,使用隐含参数启库

shutdownabort模式丢失redo,使用隐含参数启库

WBOY
发布: 2016-06-07 16:06:45
原创
1406 人浏览过

shutdown abort模式 丢失redo log 无法open数据库 通过告警报错ORA-00354: corrupt redo log block header 从该错误可以看出当前日志的redo block的header出现问题,导致oracle无法读取redo进行恢复。通过以下检查发现数据库文件头都一致,没有需要恢复的文件

shutdown abort模式
丢失redo log
无法open数据库
通过告警报错ORA-00354: corrupt redo log block header 从该错误可以看出当前日志的redo block的header出现问题,导致oracle无法读取redo进行恢复。通过以下检查发现数据库文件头都一致,没有需要恢复的文件,但是由于数据库是非正常关闭,last_change scn没有被写入,数据库判断需要恢复,则读取相应的redo log group 3,但是此时该文件已经损坏。
SYS@orcl11g>alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery

SYS@orcl11g>recover database;
ORA-00283: recovery session canceled due to errors
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/opt/oracle/oradata/orcl11g/redo03.log'
ORA-27046: file size is not a multiple of logical block size
Additional information: 1

SYS@orcl11g>recover database until cancel;
ORA-00279: change 5168496 generated at 10/29/2014 23:48:23 needed for thread 1
ORA-00289: suggestion : /opt/oracle/flash_recovery_area/ORCL11G/archivelog/2014_10_29/o1_mf_1_159_%u_.arc
ORA-00280: change 5168496 for thread 1 is in sequence #159

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

ORA-00308: cannot open archived log &#39;/opt/oracle/flash_recovery_area/ORCL11G/archivelog/2014_10_29/o1_mf_1_159_%u_.arc&#39;
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

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: &#39;/opt/oracle/oradata/orcl11g/system01.dbf&#39;
登录后复制
加入以下隐含参数:
SYS@orcl11g>show parameter _allow
NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
_allow_error_simulation              boolean                TRUE
_allow_resetlogs_corruption          boolean                TRUE
登录后复制
这时候发现数据库时可以打开的
SYS@orcl11g>
SYS@orcl11g>
SYS@orcl11g>alter database open resetlogs;

Database altered.

SYS@orcl11g>

发现日志文件已经被重建:
SYS@orcl11g>select group#,status from v$log;
    GROUP# STATUS
---------- ------------------------------------------------------------
         1 CURRENT
         2 UNUSED
         3 UNUSED

SYS@orcl11g>alter system switch logfile;

System altered.

SYS@orcl11g>/

System altered.

SYS@orcl11g>/

System altered.

SYS@orcl11g>select group#,status from v$log;
    GROUP# STATUS
---------- ------------------------------------------------------------
         1 CURRENT
         2 INACTIVE
         3 ACTIVE
登录后复制
相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板