Dataguard還原測試故障ORA-10458

主機備份拷貝到備機上進行Rman 還原,完成後用standy controlfile替換。

SQL*Plus: Release 12.2.0.1.0 Production on Fri May 15 11:06:00 2020
Copyright (c) 1982, 2016, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 5.3687E+10 bytes
Fixed Size           12174808 bytes
Variable Size         6710889000 bytes
Database Buffers     4.6842E+10 bytes
Redo Buffers          122040320 bytes
SQL> alter database mount standby database;
Database altered.

但是打開只讀的時候出現錯誤:
SQL> alter database open read only;
alter database open read only
*
ERROR at line 1:
ORA-10458: standby database requires recovery
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/u01/app/oracle/oradata/ep/system01.dbf'
嘗試修復失敗
SQL> recover database;    
ORA-00283: recovery session canceled due to errors
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done

比對文件和控制文件的sn ,發現文件比控制文件要小。
SQL> select distinct CHECKPOINT_CHANGE# from v$datafile;

CHECKPOINT_CHANGE#
------------------
     335610152

SQL> select CURRENT_SCN from v$database;

CURRENT_SCN
-----------
  335617437

將最近的歸檔日誌拷貝到standby機器上
RMAN> catalog start with '/u01/app/oracle/logfiles';

using target database control file instead of recovery catalog
searching for all files that match the pattern /u01/app/oracle/logfiles

List of Files Unknown to the Database
=====================================
File Name: /u01/app/oracle/logfiles/1_17714_1021954304.dbf
File Name: /u01/app/oracle/logfiles/1_17715_1021954304.dbf

RMAN> recover database;

Starting recover at 15-MAY-20
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=463 device type=DISK

starting media recovery
archived log for thread 1 with sequence 17715 is already on disk as file /u01/app/oracle/logfiles/1_17715_1021954304.dbf
archived log file name=/u01/app/oracle/logfiles/1_17715_1021954304.dbf thread=1 sequence=17715
media recovery complete, elapsed time: 00:01:29
Finished recover at 15-MAY-20

RMAN> quit

--重新打開數據庫,成功。
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> alter database open read only;

Database altered.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章