How to clone a single instance database to a RAC database

This blog post shows how to clone a single instance database using file system for datafiles to a RAC database using ASM. I am going to use a 11.2 RMAN feature named backup-based duplication that allows to run RMAN DUPLICATE without connecting to target database: in some environments this may be not possible for security reasons or you have just been given RMAN backup sets without physical network connection to target database.

Oracle version used is

Backup source database

Backup source database to file system with RMAN:

backup database format '/backup/%U' plus archivelog format '/backup/%U';

Copy backup sets to RAC node

$ scp /backup/* vmoe1:/backup

PFILE creation on single node database

You need to create a PFILE for the target database because backup-based duplication does not work with SPFILE.

SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/oracle/db11203/dbs/spfile
SQL> create pfile='/backup/initFS0.ora' from spfile;

File created.

Copy PFILE to RAC node database Oracle Home

$ scp ol6elsa0:/backup/initFS0.ora $ORACLE_HOME/dbs/initRAC0.ora

Note that the new PFILE name that matches the new database because we want to rename database.

Modify PFILE on RAC node

We want to rename database to RAC0: DB_NAME should be modified to RAC0. Source database is using Fast Recovery Area: we need to change it to the right ASM disk group. You need to remove CONTROL_FILES parameter and to define DB_CREATE_FILE_DEST to the right ASM diskgroup:


You may also need to adapt DIAGNOSTIC_DEST setting or AUDIT_FILE_DEST if directory name differ.

Modify ORACLE_SID on RAC node

You need to modify ORACLE_SID and to set it to new database name. At this stage database is still single instance database so you must not use a RAC instance name with a instance number suffix.

$ export ORACLE_SID=RAC0

Start the instance in NOMOUNT mode

SQL> startup nomount;

Duplicate target database

First connect only to auxiliary instance with RMAN on RAC node:

$ rman auxiliary /

Then launch following RMAN statement to ask RMAN:

– to store datafiles and tempfiles in ‘+DATA’ disk group

– to use backup sets located in /backup directory

– to create 2 redo logs groups:

run {
set newname for database to '+DATA';
duplicate target database to RAC0
backup location '/backup/'
group 1 ('+DATA','+RECO') size 50M,
group 2 ('+DATA','+RECO') size 50M;

Check that RMAN DUPLICATE statements does not report any error and ends with:

contents of Memory Script:
   Alter clone database open resetlogs;
executing Memory Script

database opened
Finished Duplicate Db at DD-MMM-YY


Retrieve CONTROL_FILES that have been generated by RMAN: you can retrieve them in RMAN DUPLICATE output when RMAN has restored the control files or simply use SQL*Plus statement:

show parameter control_files

Modify CONTROL_FILES parameter in PFILE with the right value.

Check that you can restart the database instance with the modified PFILE:

shutdown immediate

Configure database for RAC

For each new instance on RAC cluster, you need to:

– add an undo tablespace

– add groups of online redo logs (ORL)

– enable these ORL groups (redo log thread).

In our case we have a 2-node RAC cluster: we only need to add 1 undo tablespace and 1 additional set of ORL:

create undo tablespace UNDOTBS2 datafile '+DATA';
alter database add logfile thread 2 group 3 ('+DATA','+RECO') size 50M;
alter database add logfile thread 2 group 4 ('+DATA','+RECO') size 50M;
alter database enable public thread 2;

Add initialization parameters in PFILE for RAC cluster on first node. You need to prefix instance specific parameters with the right instance name (the existing undo tablespace parameter must be prefixed with node 1 instance name):


Rename the PFILE on node1 with instance name:

$ mv initRAC0.ora initRAC01.ora

Copy the PFILE from node 1 to node 2 and rename it with right instance name:

$ scp initRAC01.ora vmoe2:$ORACLE_HOME/dbs/initRAC02.ora

Check that you can start manually instances on each cluster node.
First you need to stop current instance on node 1 with current ORACLE_SID setting:

$ sqlplus / as sysdba
shutdown immediate

On node 1 with new RAC ORACLE_SID:

$ export ORACLE_SID=RAC01
$ sqlplus / as sysdba
shutdown immediate

On node 2 with RAC ORACLE_SID:

$ export ORACLE_SID=RAC02
$ sqlplus / as sysdba
shutdown immediate

Create SPFILE in ASM

$ sqlplus / as sysdba
create spfile='+DATA/RAC0/spfile' from pfile;

Modify PFILE to use ASM SPFILE on both nodes:

$ cat $ORACLE_HOME/dbs/initRAC01.ora
$ scp $ORACLE_HOME/dbs/initRAC01.ora vmoe2:$ORACLE_HOME/dbs/initRAC02.ora

Add database and database instances to cluster configuration

$ srvctl add database -d RAC0 -o $ORACLE_HOME  -p +DATA/RAC0/spfile
$ srvctl add instance -d RAC0 -i RAC01 -n vmoe1
$ srvctl add instance -d RAC0 -i RAC02 -n vmoe2

Check that you can start database with srvctl:

$ srvctl start database -d RAC0
$ srvctl status database -d RAC0

You also need to fix /etc/oratab to replace DB_NAME by ORACLE_SID on both nodes.

You may also need to update tnsnames.ora and to create a password file on both nodes for this new RAC database.

Post a comment or leave a trackback: Trackback URL.


  • Banti  On October 11, 2015 at 11:46 pm

    Hi Pierre,

    Kindly let me know if this is supported way. I am building my production. I have done cloning this way only. But is it supported way bu oracle support?


  • adhika  On November 28, 2016 at 12:06 pm

    Hello Pierre,

    Just wondering, since you’re restoring from single instance to RAC.
    Don’t you need to run the catclust.sql script from the %ORACLE_HOME%\rdbms\admin directory?

    • pforstmann  On November 29, 2016 at 4:56 pm

      Hello Adhika,
      Yes your are right. This step is missing and should be added.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: