In Previous article we learned about overview of RCONFIG . In this Article we will see Conversion of Single Instance DB to RAC DB with RCONFIG
Prerequisites :
Single Instance DB Name | RAC DB name | RAC Instance Node | RAC Instance Name | RAC Node Name |
test | TEST | Node 1 | db1 | RAC1 |
Node 2 | db2 | RAC2 |
Step 1 : Check details of Single Instance DB :
[oracle@rac1 ~]$ export ORACLE_SID=test [oracle@rac1 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Tue Mar 13 15:58:35 2018 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options SQL> select name,open_mode from v$database; NAME OPEN_MODE --------- -------------------- TEST READ WRITE SQL> select instance_name,host_name from v$instance; INSTANCE_NAME ---------------- HOST_NAME ---------------------------------------------------------------- test rac1.localdomain SQL> set lines 1000 SQL> select instance_name,host_name from v$instance; INSTANCE_NAME HOST_NAME ---------------- ---------------------------------------------------------------- test rac1.localdomain SQL> SQL> select file_name from dba_data_files; FILE_NAME --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- /u01/app/oracle/oradata/test/users01.dbf /u01/app/oracle/oradata/test/undotbs01.dbf /u01/app/oracle/oradata/test/sysaux01.dbf /u01/app/oracle/oradata/test/system01.dbf SQL>
Here we can see that Single Instance DB name is “TEST” , located on RAC1 node and storage is non-ASM.
Step 2 : Go to $ORACLE_HOME/assistants/rconfig/sampleXMLs
[oracle@rac1 ~]$ cd $ORACLE_HOME/assistants/rconfig/sampleXMLs [oracle@rac1 sampleXMLs]$ ll total 12 -rw-r--r-- 1 oracle oinstall 2770 Mar 13 16:17 ConvertToRAC_AdminManaged.xml -rw-r--r-- 1 oracle oinstall 2804 Mar 22 2010 ConvertToRAC_PolicyManaged.xml [oracle@rac1 sampleXMLs]$
Step 3 : Make necessary changes to ConvertToRAC_AdminManaged.xml file as follows :
[oracle@rac1 sampleXMLs]$ cat ConvertToRAC_AdminManaged.xml <?xml version="1.0" encoding="UTF-8"?> <n:RConfig xmlns:n="http://www.oracle.com/rconfig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.oracle.com/rconfig rconfig.xsd"> <n:ConvertToRAC> <!-- Verify does a precheck to ensure all pre-requisites are met, before the conversion is attempted. Allowable values are: YES|NO|ONLY --> <n:Convert verify="YES"> <!--Specify current OracleHome of non-rac database for SourceDBHome --> <n:SourceDBHome>/u01/app/oracle/product/11.2.0/dbhome_1</n:SourceDBHome> <!--Specify OracleHome where the rac database should be configured. It can be same as SourceDBHome --> <n:TargetDBHome>/u01/app/oracle/product/11.2.0/dbhome_1</n:TargetDBHome> <!--Specify SID of non-rac database and credential. User with sysdba role is required to perform conversion --> <n:SourceDBInfo SID="test"> <n:Credentials> <n:User>sys</n:User> <n:Password>oracle</n:Password> <n:Role>sysdba</n:Role> </n:Credentials> </n:SourceDBInfo> <!--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. --> <n:NodeList> <n:Node name="rac1"/> <n:Node name="rac2"/> </n:NodeList> <!--Specify RacOneNode along with servicename to convert database to RACOne Node --> <!--n:RacOneNode servicename="salesrac1service"/--> <!--Instance Prefix tag is optional starting with 11.2. If left empty, it is derived from db_unique_name.--> <n:InstancePrefix>db</n:InstancePrefix> <!-- Listener details are no longer needed starting 11.2. Database is registered with default listener and SCAN listener running from Oracle Grid Infrastructure home. --> <!--Specify the type of storage to be used by rac database. Allowable values are CFS|ASM. The non-rac database should have same storage type. ASM credentials are no needed for conversion. --> <n:SharedStorage type="ASM"> <!--Specify Database Area Location to be configured for rac database.If this field is left empty, current storage will be used for rac database. For CFS, this field will have directory path. --> <n:TargetDatabaseArea>+DATA</n:TargetDatabaseArea> <!--Specify Fast Recovery Area to be configured for rac database. If this field is left empty, current recovery area of non-rac database will be configured for rac database. If current database is not using recovery Area, the resulting rac database will not have a recovery area. --> <n:TargetFlashRecoveryArea>+DATA</n:TargetFlashRecoveryArea> </n:SharedStorage> </n:Convert> </n:ConvertToRAC> </n:RConfig> [oracle@rac1 sampleXMLs]$
Here I have passed source DB home , target DB home , source database SID , password for sys user and node details.
Step 4 : Run rconfig command from $ORACLE_HOME/bin/rconfig for actual conversion.
[oracle@rac1 sampleXMLs]$ /u01/app/oracle/product/11.2.0/dbhome_1/bin/rconfig ConvertToRAC_AdminManaged.xml Converting Database "test" to Cluster Database. Target Oracle Home: /u01/app/oracle/product/11.2.0/dbhome_1. Database Role: PRIMARY. Setting Data Files and Control Files Adding Database Instances Adding Redo Logs Enabling threads for all Database Instances Setting TEMP tablespace Adding UNDO tablespaces Adding Trace files Setting Fast Recovery Area Updating Oratab Creating Password file(s) Configuring Listeners Configuring related CRS resources Starting Cluster Database <?xml version="1.0" ?> <RConfig version="1.1" > <ConvertToRAC> <Convert> <Response> <Result code="0" > Operation Succeeded </Result> </Response> <ReturnValue type="object"> <Oracle_Home> /u01/app/oracle/product/11.2.0/dbhome_1 </Oracle_Home> <Database type="ADMIN_MANAGED" > <InstanceList> <Instance SID="db1" Node="rac1" > </Instance> <Instance SID="db2" Node="rac2" > </Instance> </InstanceList> </Database> </ReturnValue> </Convert> </ConvertToRAC></RConfig> [oracle@rac1 sampleXMLs]$
You can see here step by step conversion of database. While processing RCONFIG, it restarts database serveral times. You can see progress on console and you can check details in Source Instance alert.log and Destination Instance alert log of both RAC nodes.
Now , lets check our converted RAC database on RAC1 node.
SQL> select name,open_mode,instance_name from v$database,v$instance; NAME OPEN_MODE INSTANCE_NAME --------- -------------------- ---------------- TEST READ WRITE db1 SQL> SQL> select * from v$active_instances; INST_NUMBER INST_NAME ----------- ------------------------------------------------------------ 1 rac1.localdomain:db1 2 rac2.localdomain:db2 SQL>
Check details on RAC2 node :
SQL> select name,open_mode,instance_name from v$database,v$instance; NAME OPEN_MODE INSTANCE_NAME --------- -------------------- ---------------- TEST READ WRITE db2 SQL>
Stay tuned for More articles on Oracle RAC
Thank you for giving your valuable time to read the above information.
If you want to be updated with all our articles send us the Invitation or Follow us:
Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/
Joel Perez’s LinkedIn: Joel Perez’s Profile
Anuradha’s LinkedIn: Anuradha’s Profile
LinkedIn Group: Oracle Cloud DBAAS
Facebook Page: OracleHelp