1. 程式人生 > >【RMAN】RMAN-05001: auxiliary filename conflicts with the target database

【RMAN】RMAN-05001: auxiliary filename conflicts with the target database

cat 主庫 check unique lin 創建 庫文件 lgwr err

oracle 11.2.0.4 運行以下腳本,使用活動數據庫復制技術創建dataguard備庫報錯rman-005001:


run{
duplicate target database
for standby
from active database
spfile
set db_unique_name=‘dbkingstd‘
set log_file_name_convert ‘/u01/app/oracle/oradata/dbking‘,‘/u01/app/oracle/oradata/dbking‘
set db_file_name_convert ‘/u01/app/oracle/oradata/dbking‘,‘/u01/app/oracle/oradata/dbking‘

set control_files=‘/u01/app/oracle/oradata/dbking/control.ctl‘
set log_archive_dest_2=‘service=dbkingpri lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=dbkingpri‘
set fal_client=‘dbkingstd‘
set fal_server=‘dbkingpri‘
;
}

報錯信息如下:

RMAN-05538: WARNING: implicitly using DB_FILE_NAME_CONVERT

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 06/28/2017 17:51:19
RMAN-05501: aborting duplication of target database
RMAN-05001: auxiliary file name /u01/app/oracle/oradata/dbking/users01.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /u01/app/oracle/oradata/dbking/undotbs01.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /u01/app/oracle/oradata/dbking/sysaux01.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /u01/app/oracle/oradata/dbking/system01.dbf conflicts with a file used by the target database


原因:如果在RMAN恢復時不指定 nofilenamecheck 參數,則在數據文件相同文件名恢復時會出現RMAN-005001錯誤,當主庫,備庫的數據庫文件目錄是一樣的時候,必須使用 nofilenamecheck參數告訴rman主庫和被創建的備份庫擁有一樣的文件目錄和文件名。
修改腳本如下,再次嘗試創建備庫成功:

run{
duplicate target database
for standby nofilenamecheck
from active database
spfile
set db_unique_name=‘dbkingstd‘
set log_file_name_convert ‘/u01/app/oracle/oradata/dbking‘,‘/u01/app/oracle/oradata/dbking‘
set db_file_name_convert ‘/u01/app/oracle/oradata/dbking‘,‘/u01/app/oracle/oradata/dbking‘
set control_files=‘/u01/app/oracle/oradata/dbking/control.ctl‘
set log_archive_dest_2=‘service=dbkingpri lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=dbkingpri‘
set fal_client=‘dbkingstd‘
set fal_server=‘dbkingpri‘
;
}

【RMAN】RMAN-05001: auxiliary filename conflicts with the target database