标题: RMAN Active Duplicate Fails With RMAN-03009 ORA-01537 [打印本页] 作者: 刘泽宇 时间: 2023-8-6 10:32 标题: RMAN Active Duplicate Fails With RMAN-03009 ORA-01537 现象:
RMAN active duplicate to create the standby database fails with the below errors
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 12/12/2021 11:35:46
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of switch command on clone_default channel at 12/12/2021 11:35:46
ORA-01537: cannot add file '/data/xxxxxx/datafile/temp4.dbf' - file already part of database
原因:
RMAN script contains the below set newname clause for the tempfiles. Since the script contains all the set newname clauses for the same tempfile (tempfile 1 in this case), the error was reported
SET NEWNAME FOR TEMPFILE 1 TO '/data/xxxxxx/datafile/temp1.dbf';
SET NEWNAME FOR TEMPFILE 1 TO '/data/xxxxxx/datafile/temp2.dbf';
SET NEWNAME FOR TEMPFILE 1 TO '/data/xxxxxx/datafile/temp3.dbf';
SET NEWNAME FOR TEMPFILE 1 TO '/data/xxxxxx/datafile/temp4.dbf';
duplicate target database for standby from active database NOFILENAMECHECK;
解决方法:
Modify the RMAN script to contain the set newname with the correct tempfile id
The below command can be used on the source database to confirm the tempfile id
select file_id, file_name from dba_temp_files where tablespace_name='&temp_tablespace_name';
--Substitute the temp tablespace name in the above command
After correcting the set newname clauses, the RMAN duplicate was successful