2017年11月27日 星期一

Active DataGuard 出現 MRP0: Background Media Recovery terminated with error 1111 錯誤


錯誤訊息
一開始出現

MRP0: Background Media Recovery terminated with error 1274
Errors in file /ORA/db/diag/rdbms/lg_st/LG/trace/LG_pr00_2553.trc:
ORA-01274: cannot add datafile '+DATA_TAB03/lg/datafile/LG_TAB04.dbf' - file could not be created
Managed Standby Recovery not using Real Time Apply
Recovery interrupted!
Recovered data files to a consistent state at change 24982363193
Tue Jun 12 17:40:06 2018

MRP0: Background Media Recovery process shutdown (LG)

後來出現

Serial Media Recovery started
Managed Standby Recovery starting Real Time Apply
MRP0: Background Media Recovery terminated with error 1111
Errors in file /ORA/11.2.4/diag/rdbms/ora28/LG/trace/LG_mrp0_19769.trc:
ORA-01111: name for data file 10 is unknown - rename to correct file
ORA-01110: data file 10: '/ORA/11.2.4/db/dbs/UNNAMED00010'
ORA-01157: cannot identify/lock data file 10 - see DBWR trace file
ORA-01111: name for data file 10 is unknown - rename to correct file
ORA-01110: data file 10: '/ORA/11.2.4/db/dbs/UNNAMED00010'
Managed Standby Recovery not using Real Time Apply
MRP0: Background Media Recovery process shutdown (LG)
Tue Nov 28 14:47:33 2017


表示 Active DataGuard  這邊的 db_file_name_convert 參數沒有設定好


----

以下是解決方式 , 可線上處理

1.先把 db_file_name_convert  設定好 

alter system set db_file_name_convert='+ORA/datafile','/ORA/file1' scope=spfile;
2.將備庫的standby_file_management參數修改為手動管理模式
 alter system set standby_file_management='MANUAL' scope=both;

3.把UNNAMED數據文件放到正確路徑
alter database create datafile '/ORA/11.2.4/db/dbs/UNNAMED00010' as '/ORA/file2/LG_TAB04.dbf';
  

4.將備庫的standby_file_management參數修改回自動模式
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO scope=both;

5.備庫啟動同步

要是線上處理直接執行 就可以
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;



---

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

ALTER DATABASE OPEN READ ONLY;

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;



6.完成



以上的方法比較快, 要是可以的話也可以重做 DATA GUARD