oracle 11g ADG 由於磁碟空間不足導致同步問題
應用軟體廠商反映adg 備庫端資料已經好幾天沒有同步了,問題檢視
發現adg備庫沒有應用日誌程序:
SQL> select PROCESS,PID, STATUS ,CLIENT_PROCESS from v$managed_standby; PROCESS PID STATUS CLIENT_P --------- ---------- ------------ -------- ARCH 14981 CONNECTED ARCH ARCH 14983 CONNECTED ARCH ARCH 14985 CONNECTED ARCH ARCH 14987 CONNECTED ARCH
開啟應用日誌:
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
Database altered.
SQL> select open_mode,PROTECTION_LEVEL,DATABASE_ROLE,SWITCHOVER_STATUS from v$database;
OPEN_MODE PROTECTION_LEVEL DATABASE_ROLE SWITCHOVER_STATUS -------------------- -------------------- ---------------- -------------------- READ ONLY MAXIMUM PERFORMANCE PHYSICAL STANDBY NOT ALLOWED
發現日誌還是沒有正常運用,於是檢視告警日誌發現:
Errors in file /u01/app/dbBase/diag/rdbms/jgbadg/jgbadg/trace/jgbadg_dbw0_116630.trc: ORA-01186: file 81 failed verification tests ORA-01157: cannot identify/lock data file 81 - see DBWR trace file ORA-01111: name for data file 81 is unknown - rename to correct file ORA-01110: data file 81: '/u01/app/11.2.0/product/db_1/dbs/UNNAMED00081' File 81 not verified due to error ORA-01157 MRP0: Background Media Recovery terminated with error 1111 Errors in file /u01/app/dbBase/diag/rdbms/jgbadg/jgbadg/trace/jgbadg_pr00_89050.trc: ORA-01111: name for data file 81 is unknown - rename to correct file ORA-01110: data file 81: '/u01/app/11.2.0/product/db_1/dbs/UNNAMED00081' ORA-01157: cannot identify/lock data file 81 - see DBWR trace file ORA-01111: name for data file 81 is unknown - rename to correct file ORA-01110: data file 81: '/u01/app/11.2.0/product/db_1/dbs/UNNAMED00081' Managed Standby Recovery not using Real Time Apply
檢視作業系統中無此檔案,
adg[/home/oracle]file /u01/app/11.2.0/product/db_1/dbs/UNNAMED00081 /u01/app/11.2.0/product/db_1/dbs/UNNAMED00081: cannot open `/u01/app/11.2.0/product/db_1/dbs/UNNAMED00081' (No such file or directory)
但是資料庫中又有檔案記錄:
SQL> select name from v$datafile;
NAME ------------------------------------------------------------ +DATADG/adg/datafile/base.374.989050553 /u01/app/11.2.0/product/db_1/dbs/UNNAMED00081
懷疑備庫空間不足時,在主庫中新建檔案導致備庫在asm磁碟外建立了檔案,應用廠商也有次懷疑進而確認了;
進行修改:
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=manual;
alter database create datafile '/u01/app/11.2.0/product/db_1/dbs/UNNAMED00081' as new;
重新檢視後發現此檔案已經在asm中重新建立
SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO scope=both;
System altered.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
Database altered.
SQL> select open_mode,PROTECTION_LEVEL,DATABASE_ROLE,SWITCHOVER_STATUS from v$database;
OPEN_MODE PROTECTION_LEVEL DATABASE_ROLE SWITCHOVER_STATUS -------------------- -------------------- ---------------- -------------------- READ ONLY WITH APPLY MAXIMUM PERFORMANCE PHYSICAL STANDBY NOT ALLOWED
此次由於備庫磁碟空間不足的導致主備同步異常處理完畢。參考mos文章 739618.1