Prerequisite Setup Steps for Creating a Duplicate Database

The following procedure describes the prerequisite setup steps for creating a duplicate database:

Before You Begin:

wedge.gif (136 bytes)Prerequisite setup steps:

Add the option UR=A in the CONNECT_DATA part of your tnsnames.ora entry to connect to your auxiliary database. The syntax should be as follows:
DUPDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = powerpc02)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dupdb) (UR=A)
)
)

Ensure that the duplicate database connect string should be the same as duplicate database name if the duplicate database is not configured from CommCell console.

-------------------

Sample RMAN Script:

-------------------

connect catalog rman9i/password@XXXX

connect target sys/password@XXXX

connect auxiliary sys/password

 

run {

# Allocate the channel for the duplicate work

Allocate auxiliary channel ch1 type disk;

# set the new file names and locations for all datafiles

#

SET NEWNAME FOR DATAFILE 1 to 'C:\U01\ORADATA\DUP\SYSTEM01.DBF';

SET NEWNAME FOR DATAFILE 2 to 'C:\U01\ORADATA\DUP\UNDOTBS01.DBF';

...

...

SET NEWNAME FOR DATAFILE 11 to 'C:\U01\ORADATA\DUP\OEM_REPOSITORY.DBF';

SET NEWNAME FOR DATAFILE 12 to 'C:\U01\ORADATA\DUP\TEST01.DBF';

#

# Duplicate the database to DUP

#

DUPLICATE TARGET DATABASE TO DUP

LOGFILE

    GROUP 1 ('C:\U01\ORADATA\DUP\REDO01.LOG') SIZE 1000K,

    GROUP 2 ('C:\U01\ORADATA\DUP\REDO02.LOG') SIZE 1000K,

    GROUP 3 ('C:\U01\ORADATA\DUP\REDO03.LOG') SIZE 1000K

SKIP TABLESPACE 'TEST' ;

}

------------

Error Stack:

------------

.....

   set newname for datafile  11 to

 "C:\U01\ORADATA\DUP\OEM_REPOSITORY.DBF";

   restore

   clone database

   skip tablespace  TEST   ;

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-00601: fatal error in recovery manager

RMAN-03012: fatal error during compilation of command

RMAN-03028: fatal error code for command Duplicate Db : 600

RMAN-00600: internal error, arguments [8049] [] [] [] []

RMAN-01005: syntax error: found "test":

            expecting one of: "double-quoted-string, identifier,

                               single-quoted-string"

RMAN-01007: at line 27 column 21 file: Memory Script

This is because TEST is an Oracle reserved word, so it fails with RMAN-600 [8049] while compiling the memory script.  Do not use reserved words for tablespace name. Please refer V$RESERVED_WORDS to get a list of Oracle Server reserved words.