Pages

Monday 17 December 2012

Duplicate database fails with RMAN-05537


Error statement

[oracle@blr221012 dbs]$ rman TARGET sys/*****@B12500DV AUXILIARY sys/****@B12500DV_DEST

Recovery Manager: Release 11.2.0.2.0 - Production on Mon Dec 17 11:11:24 2012

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: B12500DV (DBID=3563904870)
connected to auxiliary database: B12500DV (not mounted)

RMAN> RUN
{
2> 3>   SET NEWNAME FOR DATAFILE 1 TO '/orasw/oracle/app/oracle/oradata/B12500DV/system01.dbf';
  SET NEWNAME FOR DATAFILE 2 TO '/orasw/oracle/app/oracle/oradata/B12500DV/sysaux01.dbf';
  SET NEWNAME FOR DATAFILE 3 TO '/orasw/oracle/app/oracle/oradata/B12500DV/undotbs01.dbf';
4> 5> 6>   SET NEWNAME FOR DATAFILE 4 TO '/orasw/oracle/app/oracle/oradata/B12500DV/users01.dbf';
  SET NEWNAME FOR DATAFILE 5 TO '/orasw/oracle/app/oracle/oradata/B12500DV/example01.dbf';
  SET NEWNAME FOR DATAFILE 6 TO '/orasw/oracle/app/oracle/oradata/B12500DV/cists01.dbf';
7> 8> 9>   SET NEWNAME FOR TEMPFILE 1 TO '/oradatat/temp01.dbf';
  DUPLICATE TARGET DATABASE TO 'B12500DV' FROM ACTIVE DATABASE
10> 11>   SPFILE
  SET LOG_FILE_NAME_CONVERT '/orasw/oracle/app/oracle/oradata/B12500DV/','/orasw/oracle/app/oracle/oradata/B12500DV/'
12> 13>   SET DB_FILE_NAME_CONVERT  '/orasw/oracle/app/oracle/oradata/B12500DV/','/orasw/oracle/app/oracle/oradata/B12500DV/'
    LOGFILE
14> 15>       GROUP 3 ('/orasw/oracle/app/oracle/oradata/B12500DV/redo03.log') SIZE 50M REUSE,
16>       GROUP 4 ('/orasw/oracle/app/oracle/oradata/B12500DV/redo04.log') SIZE 100M REUSE,
17> GROUP 5 ('/orasw/oracle/app/oracle/oradata/B12500DV/redo05.log') SIZE 100M REUSE,
18> GROUP 6 ('/orasw/oracle/app/oracle/oradata/B12500DV/redo06.log') SIZE 100M REUSE,
GROUP 7 ('/orasw/oracle/app/oracle/oradata/B12500DV/redo07.log') SIZE 100M REUSE,
19> 20> GROUP 8 ('/orasw/oracle/app/oracle/oradata/B12500DV/redo08.log') SIZE 100M REUSE,
21> GROUP 9 ('/orasw/oracle/app/oracle/oradata/B12500DV/redo09.log') SIZE 100M REUSE;
}
22>
executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting Duplicate Db at 17-DEC-12
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 12/17/2012 11:11:37
RMAN-05501: aborting duplication of target database
RMAN-05537: DUPLICATE without TARGET connection when auxiliary instance is started with spfile cannot use SPFILE clause




Reason: 

Auxiliary instance was started with spfile and we specified spfile in duplicate command as below. RMAN cannot restore the server parameter file if the auxiliary database is already started with a server parameter file

RUN
 {
  SET NEWNAME FOR DATAFILE 1 TO '/orasw/oracle/app/oracle/oradata/B12500DV/system01.dbf';
  SET NEWNAME FOR DATAFILE 2 TO '/orasw/oracle/app/oracle/oradata/B12500DV/sysaux01.dbf';
  SET NEWNAME FOR DATAFILE 3 TO '/orasw/oracle/app/oracle/oradata/B12500DV/undotbs01.dbf';
  SET NEWNAME FOR DATAFILE 4 TO '/orasw/oracle/app/oracle/oradata/B12500DV/users01.dbf';
  SET NEWNAME FOR DATAFILE 5 TO '/orasw/oracle/app/oracle/oradata/B12500DV/example01.dbf';
  SET NEWNAME FOR DATAFILE 6 TO '/orasw/oracle/app/oracle/oradata/B12500DV/cists01.dbf';
  SET NEWNAME FOR TEMPFILE 1 TO '/oradatat/temp01.dbf';
  DUPLICATE TARGET DATABASE TO 'B12500DV' FROM ACTIVE DATABASE
  SPFILE
  PASSWORD FILE
  NOFILENAMECHECK
  LOGFILE
  GROUP 3 ('/orasw/oracle/app/oracle/oradata/B12500DV/redo03.log') SIZE 50M REUSE,
  GROUP 4 ('/orasw/oracle/app/oracle/oradata/B12500DV/redo04.log') SIZE 100M REUSE,
  GROUP 5 ('//orasw/oracle/app/oracle/oradata/B12500DV/redo05.log') SIZE 100M REUSE,
  GROUP 6 ('/orasw/oracle/app/oracle/oradata/B12500DV/redo06.log') SIZE 100M REUSE,
  GROUP 7 ('/orasw/oracle/app/oracle/oradata/B12500DV/redo07.log') SIZE 100M REUSE,
 GROUP 8 ('/orasw/oracle/app/oracle/oradata/B12500DV/redo08.log') SIZE 100M REUSE,
 GROUP 9 ('/orasw/oracle/app/oracle/oradata/B12500DV/redo09.log') SIZE 100M REUSE;
 }


Solution:


Start the auxiliary database with a client parameter file or do not specify SPFILE in duplicate command if you had started auxiliary database using spfile.

Eg:
[oracle@blr221012 dbs]$ sqlplus '/as sysdba'

SQL*Plus: Release 11.2.0.2.0 Production on Mon Dec 17 11:03:30 2012

Copyright (c) 1982, 2010, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> shut immediate;
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> startup nomount pfile='/orasw/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/initB12500DV.ora';
ORACLE instance started.

Total System Global Area  217157632 bytes
Fixed Size                  2225064 bytes
Variable Size             159386712 bytes
Database Buffers           50331648 bytes
Redo Buffers                5214208 bytes
SQL> exit


OR

Use duplicate command as below.

RUN
 {
  SET NEWNAME FOR DATAFILE 1 TO '/orasw/oracle/app/oracle/oradata/B12500DV/system01.dbf';
  SET NEWNAME FOR DATAFILE 2 TO '/orasw/oracle/app/oracle/oradata/B12500DV/sysaux01.dbf';
  SET NEWNAME FOR DATAFILE 3 TO '/orasw/oracle/app/oracle/oradata/B12500DV/undotbs01.dbf';
  SET NEWNAME FOR DATAFILE 4 TO '/orasw/oracle/app/oracle/oradata/B12500DV/users01.dbf';
  SET NEWNAME FOR DATAFILE 5 TO '/orasw/oracle/app/oracle/oradata/B12500DV/example01.dbf';
  SET NEWNAME FOR DATAFILE 6 TO '/orasw/oracle/app/oracle/oradata/B12500DV/cists01.dbf';
  SET NEWNAME FOR TEMPFILE 1 TO '/oradatat/temp01.dbf';
  DUPLICATE TARGET DATABASE TO 'B12500DV' FROM ACTIVE DATABASE
  PASSWORD FILE
  NOFILENAMECHECK
  LOGFILE
  GROUP 3 ('/orasw/oracle/app/oracle/oradata/B12500DV/redo03.log') SIZE 50M REUSE,
  GROUP 4 ('/orasw/oracle/app/oracle/oradata/B12500DV/redo04.log') SIZE 100M REUSE,
  GROUP 5 ('//orasw/oracle/app/oracle/oradata/B12500DV/redo05.log') SIZE 100M REUSE,
  GROUP 6 ('/orasw/oracle/app/oracle/oradata/B12500DV/redo06.log') SIZE 100M REUSE,
  GROUP 7 ('/orasw/oracle/app/oracle/oradata/B12500DV/redo07.log') SIZE 100M REUSE,
 GROUP 8 ('/orasw/oracle/app/oracle/oradata/B12500DV/redo08.log') SIZE 100M REUSE,
 GROUP 9 ('/orasw/oracle/app/oracle/oradata/B12500DV/redo09.log') SIZE 100M REUSE;
 }



No comments:

Post a Comment