您好,登錄后才能下訂單哦!
案例
環(huán)境:2節(jié)點(diǎn)RAC asm + 單實(shí)例DG備庫(kù) ,備庫(kù)用的是文件系統(tǒng)來(lái)存放數(shù)據(jù)文件,未用ASM;RAC一節(jié)點(diǎn)上部署有ogg。
在主庫(kù)上通過(guò)在線重定義對(duì)表做分區(qū),創(chuàng)建分區(qū)表空間時(shí)備庫(kù)上創(chuàng)建數(shù)據(jù)文件失敗,
導(dǎo)致日志傳到備庫(kù)無(wú)法應(yīng)用,備庫(kù)停止日志應(yīng)用。
rman備份清理歸檔的腳本無(wú)法及時(shí)清理歸檔導(dǎo)到主庫(kù)、備庫(kù)歸檔磁盤空間均出現(xiàn)滿的現(xiàn)象,ogg進(jìn)程不工作,進(jìn)程正常,只是time since chkpt 持續(xù)升高。
清理了歸檔后,備庫(kù)可以接收日志但不應(yīng)用。查看DG switchover_status 為unresolvable gap 。下面進(jìn)行備庫(kù)的恢復(fù)。
備庫(kù)中的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.置分區(qū)表空間cdtbs_par2-10 ,idxtbs_2-10 readonly [表空間來(lái)源于下面的查詢create_change#>備庫(kù)當(dāng)前SCN號(hào),其中備庫(kù)的cdtbs_par1也沒(méi)有,但未查出來(lái)].
3.拷貝分區(qū)表空間對(duì)應(yīng)的數(shù)據(jù)文件。
4.增備,做恢復(fù)。
具體操作:
1.置表空間為read only:
--在此之前先查出備庫(kù)scn號(hào)。
select current_scn from v$database; 10329528031425
--主庫(kù)上查詢
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;
--因?yàn)榘l(fā)現(xiàn)備庫(kù)上是沒(méi)有cdtbs_par1表空間對(duì)應(yīng)的數(shù)據(jù)文件,處理方法如上,先read only后靜態(tài)拷貝到備庫(kù)。
alter tablespace CDTBS_PAR1 read only;
2.拷貝文件到備庫(kù)上。
先從ASM上拷貝到本地文件系統(tǒng)上:
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
--多個(gè)同時(shí)拷貝,批考例句:
scp IDXTBS_[2,3,4]* oracle@host:/datadg/center/datafile scp IDXTBS_[5,6,7,8,9]* oracle@host:/datadg/center/datafile
PS:拷貝后發(fā)現(xiàn)文件權(quán)限是對(duì)的,但是在備庫(kù)上文件名全部轉(zhuǎn)換成了小寫,為了避免linux系統(tǒng)文件名大小寫敏感,將文件名重命名為小寫,但未驗(yàn)證大寫的文件名是否有影響。
3.主庫(kù)基于備庫(kù)的SCN號(hào)做增備備份
--分配多通道加快速度,恢復(fù)時(shí)未用多通道耗時(shí)較長(zhǎng)。
主庫(kù)上做增備:
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.備庫(kù)上操作,清理有問(wèn)題的數(shù)據(jù)文件:
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; 用此句應(yīng)該等效上面2句,未驗(yàn)證。 --然后靜態(tài)read only將對(duì)應(yīng)的數(shù)據(jù)文件拷貝過(guò)來(lái) alter system set standby_file_management=auto;
5.備庫(kù)上恢復(fù)
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'
繼續(xù)備庫(kù)上操作:
SQL> set num 50 SQL> select current_scn from v$database; 此處先應(yīng)用 日志 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;
附加后續(xù)DG相關(guān)信息
備庫(kù)應(yīng)用日志及打開到read only狀態(tài)時(shí)alert中的一些信息:
備庫(kù)上一些操作alert日志中的提示信息,雖然顯示的是報(bào)錯(cuò),但其實(shí)可以不用管,只是一個(gè)信息提示。
mount狀態(tài) 取消日志應(yīng)用報(bào)錯(cuò)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
將備庫(kù)打開提示臨時(shí)表空間數(shù)據(jù)文件無(wú)法鎖定,可忽略,臨時(shí)表空間會(huì)自動(dòng)處理:
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
到此備庫(kù)已恢復(fù)成功。
在此附上惜紛飛的基于Data Guard出現(xiàn)gap sequence修復(fù)的案例,只是其中無(wú)創(chuàng)建數(shù)據(jù)文件。
http://www.xifenfei.com/1176.html
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。