Oracle Data Recovery Advisor
實驗說明:
(1)資料庫CHENJCH2出現故障(當前Redo logfile和USERS資料檔案丟失),導致CHENJCH2資料庫無法OPEN;
(2)資料庫CHENJCH2啟用歸檔模式,有RMAN全備和歸檔備份,Catalog資料庫為CHENJCH4;
(3)
透過Oracle 11g New Feature: RMAN Data Recovery Advisor進行CHENJCH2資料庫修復;
實現具體步驟如下:
---1 CHENJCH2例項無法OPEN;
SYS@CHENJCH2>startup
ORACLE instance started.
Total System Global Area 941600768 bytes
Fixed Size 1348860 bytes
Variable Size 524290820 bytes
Database Buffers 411041792 bytes
Redo Buffers 4919296 bytes
Database mounted.
ORA-01157
: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: '/u01/app/oracle/oradata/CHENJCH2/users01.dbf'
---2 連線RMAN
[oracle@edbjr2p1 Skillset]$ rman target / catalog rc_admin/RC_ADMIN@CHENJCH4
Recovery Manager: Release 11.2.0.3.0 - CHENJCHuction on Sun Jul 9 15:11:52 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: CHENJCH2 (DBID=1512727797, not open)
connected to recovery catalog database
---3 透過list failure列出當前資料庫故障
RMAN> list failure;
starting full resync of recovery catalog
full resync complete
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
102 CRITICAL OPEN 09-JUL-17
Redo log group 1 is unavailable
108 HIGH OPEN 09-JUL-17
One or more non-system datafiles are missing
105 HIGH OPEN 09-JUL-17
Redo log file /u01/app/oracle/oradata/CHENJCH2/redo01.log is missing
---4 透過advise failure列出故障修復建議
RMAN> advise failure;
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
102 CRITICAL OPEN 09-JUL-17
Redo log group 1 is unavailable
108 HIGH OPEN 09-JUL-17
One or more non-system datafiles are missing
105 HIGH OPEN 09-JUL-17
Redo log file /u01/app/oracle/oradata/CHENJCH2/redo01.log is missing
analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=137 device type=DISK
analyzing automatic repair options complete
Mandatory Manual Actions
========================
no manual actions available
Optional Manual Actions
=======================
1. If file /u01/app/oracle/oradata/CHENJCH2/redo01.log was unintentionally renamed or moved, restore it
Automated Repair Options
========================
Option Repair Description
------ ------------------
1 Perform incomplete database recovery to SCN 1015718
Strategy: The repair includes point-in-time recovery with some data loss
Repair script:
/u01/app/oracle/diag/rdbms/CHENJCH2/CHENJCH2/hm/reco_3227818300.hm
---5 檢視Oracle自動生成的故障修復建議
[oracle@edbjr2p1 Skillset3]$ cat /u01/app/oracle/diag/rdbms/CHENJCH2/CHENJCH2/hm/reco_3227818300.hm
# database point-in-time recovery
restore database until scn
1015718;
recover database until scn
1015718;
alter database open resetlogs;
為什麼要將SCN恢復到1015718呢?
檢視v$log檢視可以發現,redo logfile 1,是從
1015718
開始,但是由於
redo logfile 1丟失,導致
redo logfile 1無法繼續寫入,也就是資料庫
最多隻能恢復到
1015718
;
SYS@CHENJCH2>
select group#,status,first_change#,next_change# from v$log;
GROUP# STATUS FIRST_CHANGE# NEXT_CHANGE#
---------- ---------------- ------------- ------------
1 CURRENT
1015718 2.8147E+14
3 INACTIVE 1015635
1015718
2 INACTIVE 1007775 1015635
---6 執行自動恢復
repair failure
RMAN> repair failure;
Strategy: The repair includes point-in-time recovery with some data loss
Repair script: /u01/app/oracle/diag/rdbms/CHENJCH2/CHENJCH2/hm/reco_2527946308.hm
contents of repair script:
# database point-in-time recovery
restore database until scn 1015718;
recover database until scn 1015718;
alter database open resetlogs;
Do you really want to execute the above repair (enter YES or NO)?
YES
executing repair script
Starting restore at 09-JUL-17
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/CHENJCH2/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/CHENJCH2/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/CHENJCH2/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/CHENJCH2/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/CHENJCH2/example01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/CHENJCH2/backupset/2017_07_08/o1_mf_nnndf_TAG20170708T181811_dp1dc4w0_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/CHENJCH2/backupset/2017_07_08/o1_mf_nnndf_TAG20170708T181811_dp1dc4w0_.bkp tag=TAG20170708T181811
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:05:29
Finished restore at 09-JUL-17
Starting recover at 09-JUL-17
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:03
Finished recover at 09-JUL-17
database opened
new incarnation of database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
repair failure complete
---7 修復完成,CHENJCH2資料庫自動OPEN;
SYS@CHENJCH2>select status from v$instance;
STATUS
------------
OPEN
歡迎關注我的微信公眾號"IT小Chen",共同學習,共同成長!!!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29785807/viewspace-2141785/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle優化案例-關閉auto space advisor和sql tuning advisor(十九)Oracle優化SQL
- Oracle SQL優化之sql tuning advisorOracleSQL優化
- 資料恢復:FonePaw Data Recovery for Mac資料恢復Mac
- Oracle 11 sql tuning advisor sql access advisor關閉以及job檢視與停止OracleSQL
- John Deere Service Advisor EDL V3 Electronic Data Link Diagnostic Kit
- oracle SQL最佳化器SQL Tuning Advisor (STA)OracleSQL
- 硬碟資料恢復工具:Eassiy Data Recovery for mac硬碟資料恢復Mac
- Joyoshare iPhone Data Recovery MaciPhone資料恢復工具iPhoneMac資料恢復
- iPhone資料恢復工具:TunesKit iPhone Data Recovery for MaciPhone資料恢復Mac
- EaseUS Data Recovery Wizard Mac資料恢復軟體Mac資料恢復
- SQL Access Advisor、SQL Tuning Advisor 測試SQL
- Macos專業資料恢復工具:Aiseesoft Data Recovery for MacMac資料恢復AI
- Bitwar Data Recovery-最快的資料救援解決方案
- AOP - Advisor
- Oracle data link建立Oracle
- 安卓資料恢復工具:Mac FoneLab Android Data Recovery for Mac安卓資料恢復MacAndroid
- 資料恢復軟體:FonePaw Data Recovery mac中文版資料恢復Mac
- 4.1.6 Oracle Restart 與 Oracle Data Guard 整合OracleREST
- Oracle Data Guard Broker元件Oracle元件
- Oracle Data Guard簡介Oracle
- 資料恢復:FonePaw Data Recovery for Mac v3.6.0啟用版資料恢復Mac
- Do Your Data Recovery 安全可靠的資料恢復軟體資料恢復
- FonePaw Data Recovery for Mac(資料恢復) v2.6.0啟用版Mac資料恢復
- Oracle RAC 重置db_recovery_file_dest_size引數Oracle
- Oracle10g釋放flash_recovery_area(轉)Oracle
- 1 關於 Oracle Data GuardOracle
- 2 Oracle Data Guard 安裝Oracle
- 1 Oracle Data Guard Broker 概念Oracle
- Oracle Data Guard和Broker概述Oracle
- SQL Access Advisor(zt)SQL
- Macos專業資料恢復工具:Aiseesoft Data Recovery for Mac中文版Mac資料恢復AI
- 安卓手機資料恢復軟體:FonePaw Android Data Recovery for Mac安卓資料恢復AndroidMac
- AnyMP4 iPhone Data Recovery for Mac iOS Toolkit資料恢復軟體iPhoneMaciOS資料恢復
- Do Your Data Recovery for Mac安全可靠的資料恢復軟體Mac資料恢復
- Oracle資料泵(Oracle Data Pump) 19cOracle
- 【ASK_ORACLE】Oracle Data Guard(一)DG架構Oracle架構
- Oracle自帶工具sql優化集-SQL Tuning Advisor (使用心得體會)OracleSQL優化
- ORACLE SELECT INTO NO_DATA_FOUND問題Oracle
- Step by Step Data Replication Using Oracle GoldenGateOracleGo