情景: Dataguard 物理備庫執行恢復報錯: Errors in file /home/u01/app/diag/rdbms/rzorcl11g/ORCL/trace/ORCL_pr00_35893.trc:ORA-01111: name for data file 20 is unknown ...
情景:
Dataguard 物理備庫執行恢復報錯:
Errors in file /home/u01/app/diag/rdbms/rzorcl11g/ORCL/trace/ORCL_pr00_35893.trc:
ORA-01111: name for data file 20 is unknown - rename to correct file
ORA-01110: data file 20: '/home/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00020'
ORA-01157: cannot identify/lock data file 20 - see DBWR trace file
ORA-01111: name for data file 20 is unknown - rename to correct file
ORA-01110: data file 20: '/home/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00020'
Recovery Slave PR00 previously exited with exception 1111
MRP0: Background Media Recovery process shutdown (ORCL)
原因:參數standby_file_management 值是manual,導致主庫增加數據文件時候備庫沒有自動增加。
SQL> show parameter standby_file_management
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
standby_file_management string MANUAL
SQL> select file#,name from v$datafile where file#=20;
FILE# NAME
---------- ----------------------------------------------------------------------------------------
20 /home/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00020
解決方法: 將該文件rename到正確的目錄中,然後設置standby_file_management參數的值為auto。
SQL> alter database create datafile '/home/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00020' as '/home/u01/app/oradata/orcl11g/fsownbox04.dbf';
SQL> alter system set standby_file_management = auto;
再執行恢復:
SQL> alter database recover managed standby database disconnect from session;