You may clone the database from an rman archive bachup or from open active instance.
Here is the sequence of steps:
1. prepare the instance into which the database will be copied. This instance is called auxiliary .
Auxiliary instance will be initialized with parameters identical to the source database parameters except db_name, db_unique_name and various directory names.
If we make clone from an open instance then we should copy into the auxiliary instance the password file.
In order to avoid errors when connecting from rman to the auxiliary database we should add the following record to the tnsnames.ora for the auxiliary database
test =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = test)(UR=A)
(SRVR = DEDICATED)
)
)
After the service name tnsnames must contain "(UR=A)"
2. Auxiliary instance should be available for remote startup through sqlplus connection "as sysdba".
To achieve this the instance should be staticaly registered with listener such as:
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=dup)
(SID_NAME=dup)
(ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2))
(SID_DESC=
(GLOBAL_DBNAME=orcl)
(SID_NAME=orcl)
(ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2))
)
Before running duplication try the remote startup :
sqlplus sys/sys@dup as sysdba
startup nomount pfile=init.ora
Pfile init.ora may contain only one line:
db_name=dup
Futher commands:
$ rman target /
RMAN> connect auxiliary sys/sys@dup
RMAN> duplicate target database to dup from active database password file spfile nofilenamecheck;
|