您好,登錄后才能下訂單哦!
案例
環境:2節點RAC asm + 單實例DG備庫 ,備庫用的是文件系統來存放數據文件,未用ASM;RAC一節點上部署有ogg。
在主庫上通過在線重定義對表做分區,創建分區表空間時備庫上創建數據文件失敗,
導致日志傳到備庫無法應用,備庫停止日志應用。
rman備份清理歸檔的腳本無法及時清理歸檔導到主庫、備庫歸檔磁盤空間均出現滿的現象,ogg進程不工作,進程正常,只是time since chkpt 持續升高。
清理了歸檔后,備庫可以接收日志但不應用。查看DG switchover_status 為unresolvable gap 。下面進行備庫的恢復。
備庫中的alert日志信息如下:
Managed Standby Recovery starting Real Time Apply Tue Apr 07 08:39:57 2015 Errors in file /u01/app/oracle/diag/rdbms/centerdg/center/trace/center_dbw0_4645.trc: ORA-01186: file 63 failed verification tests ORA-01157: cannot identify/lock data file 63 - see DBWR trace file ORA-01111: name for data file 63 is unknown - rename to correct file ORA-01110: data file 63: '/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00063' File 63 not verified due to error ORA-01157 Errors in file /u01/app/oracle/diag/rdbms/centerdg/center/trace/center_dbw0_4645.trc: ORA-01186: file 201 failed verification tests ORA-01157: cannot identify/lock data file 201 - see DBWR trace file ORA-01110: data file 201: '+DATA' File 201 not verified due to error ORA-01157 MRP0: Background Media Recovery terminated with error 1111 Errors in file /u01/app/oracle/diag/rdbms/centerdg/center/trace/center_pr00_5770.trc: ORA-01111: name for data file 63 is unknown - rename to correct file ORA-01110: data file 63: '/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00063' ORA-01157: cannot identify/lock data file 63 - see DBWR trace file ORA-01111: name for data file 63 is unknown - rename to correct file ORA-01110: data file 63: '/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00063' Managed Standby Recovery not using Real Time Apply Slave exiting with ORA-1111 exception
處理思路:
1.停ogg
2.置分區表空間cdtbs_par2-10 ,idxtbs_2-10 readonly [表空間來源于下面的查詢create_change#>備庫當前SCN號,其中備庫的cdtbs_par1也沒有,但未查出來].
3.拷貝分區表空間對應的數據文件。
4.增備,做恢復。
具體操作:
1.置表空間為read only:
--在此之前先查出備庫scn號。
select current_scn from v$database; 10329528031425
--主庫上查詢
select 'alter tablespace '||b.name||' read only;' from v$datafile a, v$tablespace b where a.CREATION_CHANGE#> =10329528031425 and a.TS#=b.TS#; alter tablespace CDTBS_PAR2 read only; alter tablespace CDTBS_PAR3 read only; alter tablespace CDTBS_PAR4 read only; alter tablespace CDTBS_PAR5 read only; alter tablespace CDTBS_PAR6 read only; alter tablespace CDTBS_PAR7 read only; alter tablespace CDTBS_PAR8 read only; alter tablespace CDTBS_PAR9 read only; alter tablespace CDTBS_PAR10 read only; alter tablespace IDXTBS_2 read only; alter tablespace IDXTBS_3 read only; alter tablespace IDXTBS_4 read only; alter tablespace IDXTBS_5 read only; alter tablespace IDXTBS_6 read only; alter tablespace IDXTBS_7 read only; alter tablespace IDXTBS_8 read only; alter tablespace IDXTBS_9 read only; alter tablespace IDXTBS_10 read only;
--因為發現備庫上是沒有cdtbs_par1表空間對應的數據文件,處理方法如上,先read only后靜態拷貝到備庫。
alter tablespace CDTBS_PAR1 read only;
2.拷貝文件到備庫上。
先從ASM上拷貝到本地文件系統上:
cp CDTBS_PAR1.345.875609233 /home/grid cp CDTBS_PAR2.346.875609279 /home/grid/arch cp CDTBS_PAR3.347.875609293 /home/grid/arch cp CDTBS_PAR4.348.875609307 /home/grid/arch cp CDTBS_PAR5.349.875609319 /home/grid/arch cp CDTBS_PAR6.350.875609333 /home/grid/arch cp CDTBS_PAR7.351.875609345 /home/grid/arch cp CDTBS_PAR8.352.875609359 /home/grid/arch cp CDTBS_PAR9.353.875609371 /home/grid/arch cp CDTBS_PAR10.354.875609385 /home/grid/arch cp IDXTBS_10.363.875609811 /home/grid/arch cp IDXTBS_2.355.875609535 /home/grid/arch cp IDXTBS_3.356.875609679 /home/grid/arch cp IDXTBS_4.357.875609687 /home/grid/arch cp IDXTBS_5.358.875609693 /home/grid/arch cp IDXTBS_6.359.875609699 /home/grid/arch cp IDXTBS_7.360.875609707 /home/grid/arch cp IDXTBS_8.361.875609713 /home/grid/arch cp IDXTBS_9.362.875609719 /home/grid/arch
grid用戶直接scp 拷貝,例句:
scp CDTBS_PAR10.354.875609385 oracle@host:/datadg/center/datafile scp CDTBS_PAR[3,4,5,6]* oracle@host:/datadg/center/datafile
--多個同時拷貝,批考例句:
scp IDXTBS_[2,3,4]* oracle@host:/datadg/center/datafile scp IDXTBS_[5,6,7,8,9]* oracle@host:/datadg/center/datafile
PS:拷貝后發現文件權限是對的,但是在備庫上文件名全部轉換成了小寫,為了避免linux系統文件名大小寫敏感,將文件名重命名為小寫,但未驗證大寫的文件名是否有影響。
3.主庫基于備庫的SCN號做增備備份
--分配多通道加快速度,恢復時未用多通道耗時較長。
主庫上做增備:
rman target / run{ allocate channel c1 type disk; allocate channel c2 type disk; allocate channel c3 type disk; allocate channel c4 type disk; BACKUP INCREMENTAL FROM SCN 10329528031425 DATABASE FORMAT '/home/oracle/upstd_%U_%p' tag 'upstd'; release channel c1; release channel c2; release channel c3; release channel c4; } backup current controlfile for standby format '/home/oracle/upstdctl_%U';
4.備庫上操作,清理有問題的數據文件:
alter system set standby_file_management=manual; alter database create datafile '/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00063' as '/datadg/center/datafile/cdtbs_par1.345.875609233'; alter database datafile '/datadg/center/datafile/cdtbs_par1.345.875609233' offline drop; --alter database datafile '/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00063' offline drop; 用此句應該等效上面2句,未驗證。 --然后靜態read only將對應的數據文件拷貝過來 alter system set standby_file_management=auto;
5.備庫上恢復
rman target / catalog start with '/home/oracle/dgbak'; recover database noredo; shutdown immediate; STARTUP NOMOUNT; RESTORE STANDBY CONTROLFILE FROM '/home/oracle/dgbak/upstdctl_9uq3rv22_1_1'; alter database mount; RMAN> alter database open; RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of alter db command at 04/08/2015 16:32:47 ORA-10458: standby database requires recovery ORA-01194: file 1 needs more recovery to be consistent ORA-01110: data file 1: '/datadg/center/datafile/system.260.797342827'
繼續備庫上操作:
SQL> set num 50 SQL> select current_scn from v$database; 此處先應用 日志 SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION; SQL> select file#,status,name from v$datafile; SQL>select * from v$dataguard_status; ARC4: Beginning to archive thread 1 sequence 171370 (10331448528074-10331448899608) SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE cancel; SQL>alter database open read only; SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE using current logfile DISCONNECT FROM SESSION;
附加后續DG相關信息
備庫應用日志及打開到read only狀態時alert中的一些信息:
備庫上一些操作alert日志中的提示信息,雖然顯示的是報錯,但其實可以不用管,只是一個信息提示。
mount狀態 取消日志應用報錯ORA 16037:
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL MRP0: Background Media Recovery cancelled with status 16037 Errors in file /u01/app/oracle/diag/rdbms/centerdg/center/trace/center_pr00_6282.trc: ORA-16037: user requested cancel of managed recovery operation Thu Apr 09 08:32:09 2015 Recovery interrupted! Recovered data files to a consistent state at change 10331906716894 Thu Apr 09 08:32:10 2015 MRP0: Background Media Recovery process shutdown (center) Thu Apr 09 08:32:10 2015 Managed Standby Recovery Canceled (center) Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL Thu Apr 09 08:32:38 2015
將備庫打開提示臨時表空間數據文件無法鎖定,可忽略,臨時表空間會自動處理:
Data Guard Broker initializing... Data Guard Broker initialization complete Thu Apr 09 08:32:41 2015 SMON: enabling cache recovery Dictionary check beginning Thu Apr 09 08:32:46 2015 RFS[6]: Selected log 26 for thread 2 sequence 189031 dbid -68775212 branch 797342936 Thu Apr 09 08:32:53 2015 Errors in file /u01/app/oracle/diag/rdbms/centerdg/center/trace/center_dbw0_4855.trc: ORA-01157: cannot identify/lock data file 201 - see DBWR trace file ORA-01110: data file 201: '+DATA/center/tempfile/temp.264.797342939' ORA-17503: ksfdopn:2 Failed to open file +DATA/center/tempfile/temp.264.797342939 ORA-15001: diskgroup "DATA" does not exist or is not mounted ORA-15077: could not locate ASM instance serving a required diskgroup ORA-29701: unable to connect to Cluster Synchronization Service Errors in file /u01/app/oracle/diag/rdbms/centerdg/center/trace/center_dbw0_4855.trc: ORA-01186: file 201 failed verification tests ORA-01157: cannot identify/lock data file 201 - see DBWR trace file ORA-01110: data file 201: '+DATA/center/tempfile/temp.264.797342939' File 201 not verified due to error ORA-01157 Thu Apr 09 08:32:53 2015 Dictionary check complete Cannot re-create tempfile +DATA/center/tempfile/temp.264.797342939, the same name file exists Errors in file /u01/app/oracle/diag/rdbms/centerdg/center/trace/center_dbw0_4855.trc: ORA-01157: cannot identify/lock data file 201 - see DBWR trace file ORA-01110: data file 201: '+DATA/center/tempfile/temp.264.797342939' ORA-17503: ksfdopn:2 Failed to open file +DATA/center/tempfile/temp.264.797342939 ORA-15001: diskgroup "DATA" does not exist or is not mounted ORA-15077: could not locate ASM instance serving a required diskgroup ORA-29701: unable to connect to Cluster Synchronization Service Database Characterset is ZHS16GBK No Resource Manager plan active replication_dependency_tracking turned off (no async multimaster replication found) Thu Apr 09 08:32:55 2015 Archived Log entry 485 added for thread 2 sequence 189030 ID 0xfd3d5b54 dest 1: Physical standby database opened for read only access. Completed: alter database open read only
到此備庫已恢復成功。
在此附上惜紛飛的基于Data Guard出現gap sequence修復的案例,只是其中無創建數據文件。
http://www.xifenfei.com/1176.html
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。