top of page

11gR2 Non-RAC to RAC Migration

Migrate from a non-RAC Oracle environment to Oracle RAC 11gR2.

In this article, we will be looking at Non-RAC to RAC migration using DBCA. I have RACN1 and RACN2 where I will show you how to migrate a single instance database running on machine DT_VM.

11gr2 non-rac to rac migration - single instance to two node rac


Create Template Using DBCA


Under DBCA, we have an option where you can create a template.  A Template is basically like the entire structure of the database. And you can even include the data with the structure.


We are going to create (rather export) a DBCA template on DT_VM machine along with source data.


Let’s take when you are creating the template file. Basically, by default it will have structure of all the tables and all the objects of database and you can optionally choose to also include the content of the table. Like let’s take I have a table which having one lakh rows then I can even have the rows in the template so that when I create database on the destination side using DBCA, I will first get all the object and I will also get the data.


That is why for all the small scale databases mostly DBCA can be used as a Replication method or a Cloning method  rather going for RMAN or other tool.


Let us create a template using single instance database.

On DT_VM (non-rac database)
===========================

# su - oracle
$ echo $ORACLE_SID

Just to make sure that this is not a RAC database, we will check the CLUSTER parameter.

SQL> show parameter cluster;
Create Template Using DBCA - show parameter cluster_database

Now let us start DBCA and follow the below screenshots

On DT_VM (non-rac database)
===========================

$ dbca

Click Next

database configuration assistant - start dbca

Select Manage Templates and Click Next

database configuration assistant - manage templates

Choose Create a Database Template and select From an existing database (structure as well as data). Click on Next

database configuration assistant - create a database template from an existing database

Select the database which you are going to convert into RAC database and click on Next

database configuration assistant - select database instance

Give a name to template, make a note of the Template Datafile location and click Next

database configuration assistant - template datafile

Choose Convert the file locations to use OFA structure and click on Finish

database configuration assistant - convert the file locations to use of OFA structure

Click on OK

dbca confirmation - create template from source database
database configuration assistant - template generation in progress

Click on No

database configuration assistant - template creation successful

Goto the Template Datafile location

On DT_VM (non-rac database)
===========================

$ cd /u01/app/oracle/product/11.2.0/dbhome_1/assistants/dbca/tmplates
$ ls -lrt my_rac*
dbca - database template files

Now we can see three files are created. In the next step, we need to copy these files to RAC node 1.



Copy Template Files to RAC Node 1


Scp the DBCA template files to RAC node 1

On DT_VM (non-rac database)
===========================

$ scp my_rac_migration.* oracle@192.168.1.50:/u01/app/oracle/product/11.2.0/dbhome_1/assistants/dbca/tmplates


Create RAC Database From Template Files


Start DBCA on RAC node 1

On RACN1
========

$ dbca

Select Oracle Real Application Clusters database and click on Next

database configuration assistant - oracle real application cluster database

Choose Create a Database and click on Next

database configuration assistant - create a database

Select the Template that you imported from non-RAC database server. In our case, it is my_rac_migration. Click Next

database configuration assistant - select template files

Select Admin-Managed, give Global Database Name, click on Select All and then click on Next

database configuration assistant - configuration type admin-managed

Disable Configure Enterprise manage then select Automatic Maintenance Tasks

database configuration assistant - disable configure enterprise manager

You can keep the maintenance tasks enabled and just click on Next

dbca select automatic maintenance tasks

Give password for SYS and SYSTEM account and click Next

database configuration assistant - sys and system user password

Click on Yes

database configuration assistant - sys password warning

Make sure the storage type is ASM, Database Areas is set to +DATA and then click on Next

database configuration assistant - automatic storage management asm

Leave default and click on next

database configuration assistant - specify flash recovery area

Click next

database configuration assistant - custom scripts

Click Next

database configuration assistant - use automatic memory management

Click Next

database configuration assistant - database summary

Make sure Create Database is selected and click on Finish

database configuration assistant - create database

Review the database summary and click on OK

database configuration assistant - create database summary

Now your cluster database creation will start

database configuration assistant - create database in progress

Once done, click on Exit

database configuration assistant - database creation complete


Verify RAC Database


Now that the DB migration is done, we are ready to verify how our RAC database is running

On RACN1
========

SQL> select instance_name, instance_number from v$instance;

INSTANCE_NAME         INSTANCE_NUMBER
--------------------- ---------------
racdb1                              1

SQL> select database_name, open_mode from v$database;

DATABASE_NAME    OPEN_MODE
---------------- ----------
RACDB            READ WRITE

SQL> show parameter cluster_database;

NAME              TYPE      VALUE
----------------- --------- -----------
cluster_database  boolean   TRUE

Run same commands from RAC node 2

On RACN2
========

SQL> select instance_name, instance_number from v$instance;

INSTANCE_NAME         INSTANCE_NUMBER
--------------------- ---------------
racdb2                              2

SQL> select database_name, open_mode from v$database;

DATABASE_NAME    OPEN_MODE
---------------- ----------
RACDB            READ WRITE

SQL> show parameter cluster_database;

NAME              TYPE      VALUE
----------------- --------- -----------
cluster_database  boolean   TRUE

This is how you convert the Non- RAC to RAC database using DBCA. But I would recommend this method only when your database size small like around below 100 GB. Because above 100 GB will take lot of time to convert.


If your database Sizes above 100 GB, I would suggest to go with RMAN, Export / Import, Restore and Recover method from cold backup or hot backup. These are the other methods which also convert the Non- RAC to RAC database.


Become a top notch dba with DBA Genesis
Start your DBA career today
bottom of page