Heim >Datenbank >MySQL-Tutorial >shutdownabort模式丢失redo,使用隐含参数启库

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

WBOY
WBOYOriginal
2016-06-07 16:06:451408Durchsuche

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
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:简析三层架构Nächster Artikel:并发问题:大数据量的访问