oracle可恢复的等待,【案例】Oracle RAC恢复报错RMAN-06004 RMAN-20003解决办法笔记
天萃荷凈
Oracle研究中心案例分析:運維DBA反映在對Oracle數據庫進行恢復時報錯,執行recover database報RMAN-06004 RMAN-20003錯誤。
最近遇到11.2.0.3 RAC FOR AIX平臺在出賬高峰期生成的歸檔日志有損壞,導致歸檔日志文件備份失敗。
關鍵在此系統上有DG,并且在出賬的期間,由于需要,將備庫轉換成SNAPSHOT STANDBY,此時遇到主庫已經成功傳輸到備庫的歸檔文件在主庫不能刪除的BUG,還由于其它一些原因,禁用主機傳輸到備庫的歸檔路徑。悲劇來了,歸檔日志文件壞了,沒有辦法,月初高峰期后,使用增量備份來前滾物理備庫吧,但是不巧的是又遇到下面的報錯。
released channel: t1
released channel: t2
released channel: t3
released channel: t4
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 05/05/2016 16:29:47
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20003: target database incarnation not found in recovery catalog
下面是整個操作過程
1,主庫進行增量備份
提供命令給備份工程師,讓備份工程師完成增量備份
SELECT MIN(checkpoint_change#) FROM V$DATAFILE;
BACKUP INCREMENTAL FROM SCN xxxxx DATABASE FOR 'STANDBY_20160000';
大概幾個小時后,增量備份完成。
2,主庫備份控制文件
主庫備份控制文件,并傳輸到備庫主機
backup current? controlfile? for standby format='/tmp/con_standby.ctl';
scp con_standby.ctl 192.168.111.12:/tmp
3,備庫還原控制文件
QL> !rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Thu May 5 16:14:46 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates.? All rights reserved.
connected to target database: ACCT (not mounted)
RMAN> restore controlfile from '/tmp/con_standby.ctl';這里應該使用restore standby controlfile
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
4,更改數據文件路徑
由于主庫與備庫的數據文件路徑不一樣,需要手動修改
RMAN> catalog start with '/linshi/dev';
修改數據文件的路徑
RMAN> switch database to copy;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of switch to copy command at 05/05/2016 16:17:32
RMAN-06571: datafile 1 does not have recoverable copy
這里數據文件1有報錯,感覺不好,正常情況這里應該。下面使用手動的方式來實現
SQL> select 'set newname for datafile '||file#||' to '||chr(39)||name||chr(39)||';' from v$backup_copy_details order by file#;
'SETNEWNAMEFORDATAFILE'||FILE#||'TO'||CHR(39)||NAME||CHR(39)||';'
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
set newname for datafile 1 to '/linshi/dev/vx/rdsk/htz/lv_system_111.dbf';
set newname for datafile 2 to '/linshi/dev/vx/rdsk/htz/lv_sysaux_111.dbf';
set newname for datafile 3 to '/linshi/dev/vx/rdsk/htz/lv_undo_111.dbf';
set newname for datafile 4 to '/linshi/dev/vx/rdsk/htz/lv_users_111.dbf';
...............................................................................
5,recover數據庫
oracle@htz#[/linshi/shell]nohup sh ./recover_database.sh &
[1]???? 30671256
oracle@htz#[/linshi/shell]Sending output to /home/oracle/nohup.out
Starting recover at 05-MAY-16
released channel: t1
released channel: t2
released channel: t3
released channel: t4
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 05/05/2016 16:29:47
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20003: target database incarnation not found in recovery catalog
6,查看數據庫的角色
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PRIMARY
這里看到數據庫主庫模式,下面重新還原一次控制文件
SQL> !rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Fri May 6 00:47:09 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates.? All rights reserved.
connected to target database: ACCT (not mounted)
RMAN> restore standby controlfile from '/tmp/standby.ctl';
Starting restore at 06-MAY-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=2002 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/linshi/control.ctl
Finished restore at 06-MAY-16
SQL> select database_role from v$database;
DATABASE_ROLE
--------------------------------
PHYSICAL STANDBY
RMAN> list incarnation;
using target database control file instead of recovery catalog
List of Database Incarnations
DB Key? Inc Key DB Name? DB ID??????????? STATUS? Reset SCN? Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1?????? 1?????? ACCT???? 3716340531?????? PARENT? 1????????? 29-MAR-12
2?????? 2?????? ACCT???? 3716340531?????? CURRENT 14754146318553 30-APR-16
RMAN> reset database to INCARNATION? 1;
database reset to incarnation 1
RMAN> list incarnation;
List of Database Incarnations
DB Key? Inc Key DB Name? DB ID??????????? STATUS? Reset SCN? Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1?????? 1?????? ACCT???? 3716340531?????? CURRENT 1????????? 29-MAR-12
2?????? 2?????? ACCT???? 3716340531?????? ORPHAN? 14754146318553 30-APR-16
7,還原數據文件
SQL> alter system set standby_file_management=manual;
System altered.
run
{
ALLOCATE channel t1 type 'sbt_tape';
ALLOCATE channel t2 TYPE 'sbt_tape';
ALLOCATE channel t3 TYPE 'sbt_tape';
ALLOCATE channel t4 TYPE 'sbt_tape';
send 'NSR_ENV=(NSR_SERVER=htzback,NSR_CLIENT=htz01)';
restore datafile 647,645,646 from tag 'FORSTANDBY2319';
}
8,RECOVER數據庫
RMAN>? run
2> {
3> allocate channel t1 type 'sbt_tape' PARMS 'ENV=(NSR_SERVER=htzback,NSR_CLIENT=htz02)';
4> allocate channel t2 type 'sbt_tape' PARMS 'ENV=(NSR_SERVER=htzback,NSR_CLIENT=htz02)';
5> allocate channel t3 type 'sbt_tape' PARMS 'ENV=(NSR_SERVER=htzback,NSR_CLIENT=htz01)';
6> allocate channel t4 type 'sbt_tape' PARMS 'ENV=(NSR_SERVER=htzback,NSR_CLIENT=htz01)';
7> recover database;
8> release channel t1;
9>? release channel t2;
10>? release channel t3;
11>? release channel t4;
12>? }
這里沒有在報錯了
9,添加STANDBY日志文件
SQL>
alter database add standby logfile? thread 1 '/htz/standby11.dbf'? reuse
alter database add standby logfile? thread 1 '/htz/standby12.dbf'? reuse ;
alter database add standby logfile? thread 1 '/htz/standby13.dbf'? reuse ;
alter database add standby logfile? thread 1 '/htz/standby14.dbf'? reuse ;
alter database add standby logfile? thread 1 '/htz/standby15.dbf'? reuse ;
alter database add standby logfile? thread 1 '/htz/standby16.dbf'? reuse ;
alter database add standby logfile? thread 1 '/htz/standby17.dbf'? reuse ;
alter database add standby logfile thread 2 '/htz/standby21.dbf'?? reuse ;
alter database add standby logfile thread 2 '/htz/standby22.dbf'?? reuse ;
alter database add standby logfile thread 2 '/htz/standby23.dbf'?? reuse ;
alter database add standby logfile thread 2 '/htz/standby24.dbf'?? reuse ;
alter database add standby logfile thread 2 '/htz/standby25.dbf'?? reuse ;
alter database add standby logfile thread 2 '/htz/standby26.dbf'?? reuse ;
alter database add standby logfile thread 2 '/htz/standby27.dbf'?? reuse ;
10,時時運用模式
SQL> recover managed standby database using current logfile disconnect;
Media recovery complete.
11,啟用塊跟蹤與修改文件管理參數
整個增量前滾DG完成
本文固定鏈接: http://www.htz.pw/2016/05/09/recover-database-rman-06004-rman-20003.html | 認真就輸
--------------------------------------ORACLE-DBA----------------------------------------
最權威、專業的Oracle案例資源匯總之【案例】Oracle RAC恢復報錯RMAN-06004 RMAN-20003解決辦法筆記
總結
以上是生活随笔為你收集整理的oracle可恢复的等待,【案例】Oracle RAC恢复报错RMAN-06004 RMAN-20003解决办法笔记的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: IPD解读——市场管理(MM)方法论
- 下一篇: 搜狗站长html标签验证,悦然建站分享: