Oracle supports the following methods to convert a single-instance database to an RAC database as long as the RAC and the standalone environments are running on the same operating system and using the same oracle release:
• Oracle Enterprise Manager (grid control)
• Manual method
In this post, I will focus on and demonstrate this using the rconfig command-line tool.
During the conversion, rconfig performs the following steps automatically:
• Migrating the database to ASM, if specified
• Creating RAC database instances on all specified nodes in the cluster
• Configuring the Listener and NetService entries
• Registering services with CRS
• Starting up the instances and listener on all nodes
In Oracle 11g R2., a single-instance database can either be converted to an administrator-managed cluster database or a policy-managed cluster database.
When you navigate through the $ORACLE_HOME/assistants/rconfig/sampleXMLS, you will find two sample XML input files.
While converting a single-instance database, with filesystem storage, to an RAC database with Automatic Storage Management (ASM), rconfig invokes RMAN internally to back up the database to proceed with converting non-ASM to ASM. Therefore, configuring parallel options to use multiple RMAN channels in the
RMAN on the local node may make backup run faster, which eventually reduces the conversion duration. For example, you may configure the following in the RMAN settings of orcl database on the local node.
RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 6;
- 3 node RAC setup
- Names of nodes : Host01, Host02, Host03
- Name of single instance database with filesystem storage : orcl
- Source Oracle home : /u01/app/oracle/product/11.2.0/dbhome_1
- Target Oracle home : /u01/app/oracle/product/11.2.0/dbhome_1
- convert orcl to a Admin managed RAC database running on two nodes host01 and host02.
- change storage to ASM with
. Datafiles on +DATA diskgroup
. Flash recovery area on +FRA diskgroup
– copy ConvertToRAC_AdminManaged.xml to another file my.xml
host01$cp ConvertToRAC_AdminManaged.xml my.xml
– Edit my.xml and make following changes :
. Specify current OracleHome of non-rac database for SourceDBHome
. Specify OracleHome where the rac database should be configured. It can be same as SourceDBHome
. Specify SID of non-rac database and credential. User with sysdba role is required to perform conversion
. Specify the list of nodes that should have rac instances running for the Admin Managed Cluster Database. LocalNode should be the first node in this nodelist.
. Instance Prefix tag is optional starting with 11.2. If left empty, it is derived from db_unique_name
. Specify the type of storage to be used by rac database. Allowable values are CFS|ASM
. Specify Database Area Location to be configured for rac database.
. Specify Flash Recovery Area to be configured for rac database.
– Run rconfig to convert orcl from single instance database to 2 instance RAC database
– Check the log file for rconfig while conversion is going on
oracle@host01$ls -lrt $ORACLE_BASE/cfgtoollogs/rconfig/*.log
– check that the database has been converted successfully
host01$srvctl status database -d orcl
Instance orcl1 is running on node host01
Instance orcl2 is running on node host02
– Note that rconfig adds password file to all the nodes but entry to tnsnames.ora needs to be modified (to reflect scan name instead of host-ip) on the local node and added to rest of the nodes.
– For all other nodes, copy the entry for the database (orcl) from tnsnames.ora on local node to tnsnames.ora on remote node(s).
– Following is the entry I modified on the local node and copied to rest of the nodes :
(ADDRESS = (PROTOCOL = TCP)(HOST = cluster01-scan.cluster01.example.com)(PORT = 1521))
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
– check that database can be connected remotely from remote node.
– check that datafiles have converted to ASM
SQL>select name from v$datafile;