处理 Dataguard 与 rman RMAN-05501
Dataguard 备库恢复时报rman-05501
RMAN> duplicate target database for standby;
Starting Duplicate Db at 09-JUN-15
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=345 device type=DISK
contents of Memory Script:
{
restore clone standby controlfile;
}
executing Memory Script
Starting restore at 09-JUN-15
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: copied control file copy
input file name=/u01/oradata_backup/full_backup/db.ctl
output file name=/opt/oracle/database/oradata/db/control01.ctl
output file name=/opt/oracle/database/fast_recovery_area/db/control02.ctl
Finished restore at 09-JUN-15
contents of Memory Script:
{
sql clone 'alter database mount standby database';
}
executing Memory Script
sql statement: alter database mount standby database
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 06/09/2015 16:54:16
RMAN-05501: aborting duplication of target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/adv_ts_main_f18.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/adv_ts_main_f17.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/adv_ts_main_f16.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/adv_ts_main_f15.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/adv_ts_main_f14.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/adv_ts_main_f13.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/adv_ts_main_f12.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/adv_ts_main_f11.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/adv_ts_main_f10.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/adv_ts_main_f09.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/adv_ts_main_f08.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/adv_ts_main_f07.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/adv_ts_main_f06.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/adv_ts_main_f05.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/adv_ts_main_f04.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/warehouse_f05.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/warehouse_f04.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/warehouse_f03.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/warehouse_f02.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/warehouse_f01.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/adv_ts_main_f03.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/adv_ts_main_f02.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/adv_ts_main_f01.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/users01.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/undotbs01.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/sysaux01.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name /opt/oracle/database/oradata/db/system01.dbf conflicts with a file used by the target database
原因:
主库和备库的datafile目录一样,且在初始化参数中没有添加 *.db_file_name_convert和*.log_file_name_convert两个参数。所以在这里duplicate 时需要加上 nofilenamecheck;
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup pfile='/u01/oradata_backup/standby.pfile' nomount;
ORACLE instance started.
Total System Global Area 3.1935E+10 bytes
Fixed Size 2268992 bytes
Variable Size 2.8119E+10 bytes
Database Buffers 3758096384 bytes
Redo Buffers 55840768 bytes
SQL> create spfile='/opt/oracle/database/product/11.2.0/db_1/dbs/initdkhlstd.ora' from pfile='/u01/oradata_backup/standby.pfile';
File created.
[oracle@wx ~]$ rman target sys/dk2014_oracle@db auxiliary /
Recovery Manager: Release 11.2.0.4.0 - Production on Tue Jun 9 17:03:10 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: db (DBID=4232991297)
connected to auxiliary database: db (not mounted)
RMAN> duplicate target database for standby nofilenamecheck;
Starting Duplicate Db at 09-JUN-15
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=296 device type=DISK
contents of Memory Script:
{
restore clone standby controlfile;
}
executing Memory Script
Starting restore at 09-JUN-15
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: copied control file copy
input file name=/u01/oradata_backup/full_backup/db.ctl
output file name=/opt/oracle/database/oradata/db/control01.ctl
output file name=/opt/oracle/database/fast_recovery_area/db/control02.ctl
Finished restore at 09-JUN-15
contents of Memory Script:
{
sql clone 'alter database mount standby database';
}
executing Memory Script
sql statement: alter database mount standby database
contents of Memory Script:
{
set newname for tempfile 1 to
"/opt/oracle/database/oradata/db/temp01.dbf";
switch clone tempfile all;
set newname for datafile 1 to
"/opt/oracle/database/oradata/db/system01.dbf";
set newname for datafile 2 to
"/opt/oracle/database/oradata/db/sysaux01.dbf";
set newname for datafile 3 to
"/opt/oracle/database/oradata/db/undotbs01.dbf";
set newname for datafile 4 to
"/opt/oracle/database/oradata/db/users01.dbf";
set newname for datafile 5 to
"/opt/oracle/database/oradata/db/adv_ts_main_f01.dbf";
set newname for datafile 6 to
"/opt/oracle/database/oradata/db/adv_ts_main_f02.dbf";
set newname for datafile 7 to
"/opt/oracle/database/oradata/db/adv_ts_main_f03.dbf";
set newname for datafile 8 to
"/opt/oracle/database/oradata/db/warehouse_f01.dbf";
set newname for datafile 9 to
"/opt/oracle/database/oradata/db/warehouse_f02.dbf";
set newname for datafile 10 to
"/opt/oracle/database/oradata/db/warehouse_f03.dbf";
set newname for datafile 11 to
"/opt/oracle/database/oradata/db/warehouse_f04.dbf";
set newname for datafile 12 to
"/opt/oracle/database/oradata/db/warehouse_f05.dbf";
set newname for datafile 13 to
"/opt/oracle/database/oradata/db/adv_ts_main_f04.dbf";
set newname for datafile 14 to
"/opt/oracle/database/oradata/db/adv_ts_main_f05.dbf";
set newname for datafile 15 to
"/opt/oracle/database/oradata/db/adv_ts_main_f06.dbf";
set newname for datafile 16 to
"/opt/oracle/database/oradata/db/adv_ts_main_f07.dbf";
set newname for datafile 17 to
"/opt/oracle/database/oradata/db/adv_ts_main_f08.dbf";
set newname for datafile 18 to
"/opt/oracle/database/oradata/db/adv_ts_main_f09.dbf";
set newname for datafile 19 to
"/opt/oracle/database/oradata/db/adv_ts_main_f10.dbf";
set newname for datafile 20 to
"/opt/oracle/database/oradata/db/adv_ts_main_f11.dbf";
set newname for datafile 21 to
"/opt/oracle/database/oradata/db/adv_ts_main_f12.dbf";
set newname for datafile 22 to
"/opt/oracle/database/oradata/db/adv_ts_main_f13.dbf";
set newname for datafile 23 to
"/opt/oracle/database/oradata/db/adv_ts_main_f14.dbf";
set newname for datafile 24 to
"/opt/oracle/database/oradata/db/adv_ts_main_f15.dbf";
set newname for datafile 25 to
"/opt/oracle/database/oradata/db/adv_ts_main_f16.dbf";
set newname for datafile 26 to
"/opt/oracle/database/oradata/db/adv_ts_main_f17.dbf";
set newname for datafile 27 to
"/opt/oracle/database/oradata/db/adv_ts_main_f18.dbf";
restore
clone database
;
}
executing Memory Script
......
RMAN>
RMAN> exit
Recovery Manager complete.