Guenadi N Jilevski's Oracle BLOG

Oracle RAC, DG, EBS, DR and HA DBA BLOG

RAC enabling single instance database using RCONFIG with Oracle 11gR2

RAC enabling single instance database using RCONFIG with Oracle 11gR2

Conversion from a single instance database to RAC database can be done with the following tools.

  • DBCA – for more info click here.
  • Enterprise Manager – for more info click here.
  • Rconfig – scope of the present paper.

The paper will look at the steps to convert a single instance database to RAC database on ASM using rconfig utility from Oracle 11gR2 (11.2.0.2). In $ORACLE_HOME/assistants/rconfig/sampleXMLs directory there are two templates ConvertToRAC_AdminManaged.xml and ConvertToRAC_PolicyManaged.xml that are used to convert a single instance database to RAC admin or policy managed database respectively. In the paper a conversion to an admin managed RAC database will be covered although the same approach is applicable to a policy managed database. Rconfig utility takes as an input a customized template and produces a RAC enable database upon successful completion. Base templates provided in $ORACLE_HOME/assistants/rconfig/sampleXMLs are customized by providing the information in the list below.

  • Source $OH – OracleHome of non-rac database for SourceDBHome
  • Destination $OH – racleHome where the rac database should be configured.
  • SourceDBInfo SID
  • list of nodes that should have rac instances running for the Admin Managed Cluster Database. LocalNode should be the first node
  • Instance Prefix tag is optional starting with 11.2.
  • Specify the type of storage to be used by RAC database. ASM or Cluster File system
  • Specify Database Area Location to be configured for rac database.
  • Specify Fast Recovery Area to be configured for rac database.

The content of the In $ORACLE_HOME/assistants/rconfig/sampleXMLs templates are shown in the appendix. I created two customized templates /tmp/conv_ver.xml and /tmp/conv_imp.xml reflecting my set up. The important field in the template is . Allowable values are: YES|NO|ONLY. If ONLY is specified rconfig only checks that the prerequisites are met and do not perform the conversion. This is good to test. If YES is specified the prerequisites are checked and if they met rconfig performs the actual conversion. Both /tmp/conv_ver.xml and /tmp/conv_imp.xml are customized to reflect the environment and differ only in the value of ‘Convert Verify’. Look for the customized content of /tmp/conv_ver.xml and /tmp/conv_imp.xml in the appendix. Rconfig utility performs the conversion for us using RMAN behind the stage. The logs are in $ORACLE_BASE/cfgtoollogs/rconfig directory.

After the template /tmp/conv_ver.xml for verification is created run rconfig as oracle user as shown below.

[oracle@raclinux1 bin]$ vi /tmp/conv_ver.xml

[oracle@raclinux1 bin]$ ./rconfig /tmp/conv_ver.xml

<?xml version=”1.0″ ?>

<RConfig version=”1.1″ >

<ConvertToRAC>

<Convert>

<Response>

<Result code=”0″ >

Operation Succeeded

</Result>

</Response>

<ReturnValue type=”object”>

There is no return value for this step ReturnValue>

</Convert>

RConfig>

[oracle@raclinux1 bin]$

Fix any encountered errors and adjust the actual template /tmp/conv_imp.xml accordingly. Run again rconfig utility to perform the real conversion.

[oracle@raclinux1 bin]$ ./rconfig /tmp/conv_imp.xml

Converting Database “tst” to Cluster Database. Target Oracle Home: /u01/app/oracle/product/11.2.0/db_10. 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/db_10

</Oracle_Home>

<Database type=”ADMIN_MANAGED” >

<InstanceList>

tst1″ Node=”raclinux1″ >

</Instance>

tst2″ Node=”raclinux2″ >

</Instance>

</InstanceList>

</Database> </ReturnValue>

</Convert>

RConfig>

[oracle@raclinux1 bin]$

Rconfig performs the conversion and the verification is as show below using srvctl and sqlplus.

[oracle@raclinux1 bin]$ srvctl config database -d tst
Database unique name: tst
Database name: tst
Oracle home: /u01/app/oracle/product/11.2.0/db_10
Oracle user: oracle
Spfile: +DGDUP/spfiletst.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: tst
Database instances: tst1,tst2
Disk Groups: DGDUP
Mount point paths:
Services:
Type: RAC
Database is administrator managed
[oracle@raclinux1 bin]$ srvctl status database -d tst
Instance tst1 is running on node raclinux1
Instance tst2 is running on node raclinux2
[oracle@raclinux1 bin]$

[oracle@raclinux1 bin]$ sqlplus <a href="mailto:system/sys1@tst">system/sys1@tst</a>

SQL*Plus: Release 11.2.0.2.0 Production on Mon Dec 20 08:39:53 2010

Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> select * from gv$instance;

INST_ID INSTANCE_NUMBER INSTANCE_NAME
---------- --------------- ----------------
HOST_NAME
----------------------------------------------------------------
VERSION           STARTUP_T STATUS       PAR    THREAD# ARCHIVE LOG_SWITCH_WAIT
----------------- --------- ------------ --- ---------- ------- ---------------
LOGINS     SHU DATABASE_STATUS   INSTANCE_ROLE      ACTIVE_ST BLO
---------- --- ----------------- ------------------ --------- ---
1               1 tst1
raclinux1.gj.com
11.2.0.2.0        20-DEC-10 OPEN         YES          1 STARTED
ALLOWED    NO  ACTIVE            PRIMARY_INSTANCE   NORMAL    NO
INST_ID INSTANCE_NUMBER INSTANCE_NAME
---------- --------------- ----------------
HOST_NAME
----------------------------------------------------------------
VERSION           STARTUP_T STATUS       PAR    THREAD# ARCHIVE LOG_SWITCH_WAIT
----------------- --------- ------------ --- ---------- ------- ---------------
LOGINS     SHU DATABASE_STATUS   INSTANCE_ROLE      ACTIVE_ST BLO
---------- --- ----------------- ------------------ --------- ---
2               2 tst2
raclinux2.gj.com
11.2.0.2.0        20-DEC-10 OPEN         YES          2 STARTED
ALLOWED    NO  ACTIVE            PRIMARY_INSTANCE   NORMAL    NO
SQL>

Appendix:


$ORACLE_HOME/assistants/rconfig/sampleXMLs

[oracle@raclinux1 bin]$ cat /tmp/conv_ver.xml

<?xml version="1.0" encoding="UTF-8"?>

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 <span class="hiddenSpellError" pre="a ">precheck</span> to <span class="hiddenSuggestion" pre="to ">ensure</span> all pre-requisites are met, before the conversion is attempted. Allowable values are: YES|NO|ONLY -->

<n:Convert verify="ONLY">

<!--Specify current <span class="hiddenSpellError" pre="current ">OracleHome</span> of <span class="hiddenSpellError" pre="of ">non-rac</span> database for SourceDBHome -->

/u01/app/oracle/product/11.2.0/db_10

<!--Specify <span class="hiddenSpellError" pre="Specify ">OracleHome</span> where the <span class="hiddenSpellError" pre="the ">rac</span> database should be configured. It can be same as SourceDBHome -->

/u01/app/oracle/product/11.2.0/db_10

<!--Specify SID of <span class="hiddenSpellError" pre="of ">non-rac</span> database and credential. User with <span class="hiddenSpellError" pre="with ">sysdba</span> role is required to perform conversion -->

SourceDBInfo SID="tst">

<n:Credentials>

<n:User>sys</n:User>

<n:Password>sys1</n:Password>

<n:Role>sysdba</n:Role>

</n:Credentials>

SourceDBInfo>

<!--Specify the list of nodes that should have <span class="hiddenSpellError" pre="have ">rac</span> instances running for the Admin Managed Cluster Database. <span class="hiddenSpellError" pre="">LocalNode</span> should be the first node in this nodelist. -->

<n:NodeList>

<n:Node name="raclinux1"/>

<n:Node name="raclinux2"/>

</n:NodeList>

<!--Specify <span class="hiddenSpellError" pre="Specify ">RacOneNode</span> along with <span class="hiddenSpellError" pre="with ">servicename</span> to convert database to RACOne Node -->

<!--n:<span class="hiddenSpellError" pre="">RacOneNode</span>  servicename="salesrac1service"/-->

<!--Instance Prefix tag is optional starting with 11.2. If left empty, it <span class="hiddenGrammarError" pre="it ">is derived</span> from db_unique_name.-->

InstancePrefix>tst

<!-- Listener details are no longer needed starting 11.2. Database <span class="hiddenGrammarError" pre="Database ">is registered</span> with default listener and SCAN listener running from Oracle Grid Infrastructure home. -->

<!--Specify the type of storage <span class="hiddenGrammarError" pre="storage ">to be</span> used by <span class="hiddenSpellError" pre="by ">rac</span> database. Allowable values are CFS|ASM. The non-rac database should have same storage type. ASM credentials are no needed for conversion. -->

SharedStorage type="ASM">

<!--Specify Database Area Location <span class="hiddenGrammarError" pre="Location ">to be</span> configured for <span class="hiddenSpellError" pre="for ">rac</span> 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>+DGDUP</n:TargetDatabaseArea>

<!--Specify Fast Recovery Area <span class="hiddenGrammarError" pre="Area ">to be</span> configured for <span class="hiddenSpellError" pre="for ">rac</span> 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>+DGDUP</n:TargetFlashRecoveryArea>

SharedStorage>

</n:Convert>

</n:ConvertToRAC>

RConfig>

[oracle@raclinux1 bin]$

[oracle@raclinux1 bin]$ cat /tmp/conv_imp.xml

<?xml version="1.0" encoding="UTF-8"?>

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 <span class="hiddenSpellError" pre="a ">precheck</span> to <span class="hiddenSuggestion" pre="to ">ensure</span> all pre-requisites are met, before the conversion is attempted. Allowable values are: YES|NO|ONLY -->

<n:Convert verify="YES">

<!--Specify current <span class="hiddenSpellError" pre="current ">OracleHome</span> of <span class="hiddenSpellError" pre="of ">non-rac</span> database for SourceDBHome -->

/u01/app/oracle/product/11.2.0/db_10

<!--Specify <span class="hiddenSpellError" pre="Specify ">OracleHome</span> where the <span class="hiddenSpellError" pre="the ">rac</span> database should be configured. It can be same as SourceDBHome -->

/u01/app/oracle/product/11.2.0/db_10

<!--Specify SID of <span class="hiddenSpellError" pre="of ">non-rac</span> database and credential. User with <span class="hiddenSpellError" pre="with ">sysdba</span> role is required to perform conversion -->

SourceDBInfo SID="tst">

<n:Credentials>

<n:User>sys</n:User>

<n:Password>sys1</n:Password>

<n:Role>sysdba</n:Role>

</n:Credentials>

SourceDBInfo>

<!--Specify the list of nodes that should have <span class="hiddenSpellError" pre="have ">rac</span> instances running for the Admin Managed Cluster Database. <span class="hiddenSpellError" pre="">LocalNode</span> should be the first node in this nodelist. -->

<n:NodeList>

<n:Node name="raclinux1"/>

<n:Node name="raclinux2"/>

</n:NodeList>

<!--Specify <span class="hiddenSpellError" pre="Specify ">RacOneNode</span> along with <span class="hiddenSpellError" pre="with ">servicename</span> to convert database to RACOne Node -->

<!--n:<span class="hiddenSpellError" pre="">RacOneNode</span>  servicename="salesrac1service"/-->

<!--Instance Prefix tag is optional starting with 11.2. If left empty, it <span class="hiddenGrammarError" pre="it ">is derived</span> from db_unique_name.-->

<n:InstancePrefix>tst</n:InstancePrefix>

<!-- Listener details are no longer needed starting 11.2. Database <span class="hiddenGrammarError" pre="Database ">is registered</span> with default listener and SCAN listener running from Oracle Grid Infrastructure home. -->

<!--Specify the type of storage <span class="hiddenGrammarError" pre="storage ">to be</span> used by <span class="hiddenSpellError" pre="by ">rac</span> database. Allowable values are CFS|ASM. The non-rac database should have same storage type. ASM credentials are no needed for conversion. -->

SharedStorage type="ASM">

<!--Specify Database Area Location <span class="hiddenGrammarError" pre="Location ">to be</span> configured for <span class="hiddenSpellError" pre="for ">rac</span> 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>+DGDUP</n:TargetDatabaseArea>

<!--Specify Fast Recovery Area <span class="hiddenGrammarError" pre="Area ">to be</span> configured for <span class="hiddenSpellError" pre="for ">rac</span> 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>+DGDUP</n:TargetFlashRecoveryArea>

SharedStorage>

</n:Convert>

</n:ConvertToRAC>

</n:RConfig>

[oracle@raclinux1 bin]$

[oracle@raclinux1 sampleXMLs]$ cat ConvertToRAC_AdminManaged.xml

<?xml version="1.0" encoding="UTF-8"?>

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 <span class="hiddenSpellError" pre="a ">precheck</span> to <span class="hiddenSuggestion" pre="to ">ensure</span> all pre-requisites are met, before the conversion is attempted. Allowable values are: YES|NO|ONLY -->

<n:Convert verify="YES">

<!--Specify current <span class="hiddenSpellError" pre="current ">OracleHome</span> of <span class="hiddenSpellError" pre="of ">non-rac</span> database for SourceDBHome -->

<n:SourceDBHome>/oracle/product/11.2.0/db_1</n:SourceDBHome>

<!--Specify <span class="hiddenSpellError" pre="Specify ">OracleHome</span> where the <span class="hiddenSpellError" pre="the ">rac</span> database should be configured. It can be same as SourceDBHome -->

<n:TargetDBHome>/oracle/product/11.2.0/db_1</n:TargetDBHome>

<!--Specify SID of <span class="hiddenSpellError" pre="of ">non-rac</span> database and credential. User with <span class="hiddenSpellError" pre="with ">sysdba</span> role is required to perform conversion -->

<n:SourceDBInfo SID="sales">

<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 <span class="hiddenSpellError" pre="have ">rac</span> instances running for the Admin Managed Cluster Database. <span class="hiddenSpellError" pre="">LocalNode</span> should be the first node in this nodelist. -->

<n:NodeList>

<n:Node name="node1"/>

<n:Node name="node2"/>

</n:NodeList>

<!--Specify <span class="hiddenSpellError" pre="Specify ">RacOneNode</span> along with <span class="hiddenSpellError" pre="with ">servicename</span> to convert database to RACOne Node -->

<!--n:<span class="hiddenSpellError" pre="">RacOneNode</span>  servicename="salesrac1service"/-->

<!--Instance Prefix tag is optional starting with 11.2. If left empty, it <span class="hiddenGrammarError" pre="it ">is derived</span> from db_unique_name.-->

<n:InstancePrefix>sales</n:InstancePrefix>

<!-- Listener details are no longer needed starting 11.2. Database <span class="hiddenGrammarError" pre="Database ">is registered</span> with default listener and SCAN listener running from Oracle Grid Infrastructure home. -->

<!--Specify the type of storage <span class="hiddenGrammarError" pre="storage ">to be</span> used by <span class="hiddenSpellError" pre="by ">rac</span> 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 <span class="hiddenGrammarError" pre="Location ">to be</span> configured for <span class="hiddenSpellError" pre="for ">rac</span> 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>+ASMDG</n:TargetDatabaseArea>

<!--Specify Fast Recovery Area <span class="hiddenGrammarError" pre="Area ">to be</span> configured for <span class="hiddenSpellError" pre="for ">rac</span> 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>+ASMDG</n:TargetFlashRecoveryArea>

</n:SharedStorage>

</n:Convert>

</n:ConvertToRAC>

</n:RConfig>

[oracle@raclinux1 sampleXMLs]$

[oracle@raclinux1 sampleXMLs]$ cat ConvertToRAC_PolicyManaged.xml

<?xml version="1.0" encoding="UTF-8"?>

xmlns:n="http://www.oracle.com/rconfig"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://www.oracle.com/rconfig">

<n:ConvertToRAC>

<!-- Verify does a <span class="hiddenSpellError" pre="a ">precheck</span> to <span class="hiddenSuggestion" pre="to ">ensure</span> all pre-requisites are met, before the conversion is attempted. Allowable values are: YES|NO|ONLY -->

<n:Convert verify="YES">

<!--Specify current <span class="hiddenSpellError" pre="current ">OracleHome</span> of <span class="hiddenSpellError" pre="of ">non-rac</span> database for SourceDBHome -->

<n:SourceDBHome>/oracle/product/11.2.0/db_1</n:SourceDBHome>

<!--Specify <span class="hiddenSpellError" pre="Specify ">OracleHome</span> where the <span class="hiddenSpellError" pre="the ">rac</span> database should be configured. It can be same as SourceDBHome -->

<n:TargetDBHome>/oracle/product/11.2.0/db_1</n:TargetDBHome>

<!--Specify SID of <span class="hiddenSpellError" pre="of ">non-rac</span> database and credential. User with <span class="hiddenSpellError" pre="with ">sysdba</span> role is required to perform conversion -->

<n:SourceDBInfo SID="sales">

<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 existing or new server pools which <span class="hiddenGrammarError" pre="which ">will be used</span> by the Policy Managed Cluster Database. -->

<n:ServerPoolList>

ExistingServerPool name="custom"/>

NewServerPool name="newpool" cardinality="2"/>

</n:ServerPoolList>

<!--Specify <span class="hiddenSpellError" pre="Specify ">RacOneNode</span> along with <span class="hiddenSpellError" pre="with ">servicename</span> to convert database to RACOne Node -->

<!--n:<span class="hiddenSpellError" pre="">RacOneNode</span>  servicename="salesrac1service"/-->

<!--InstancePrefix is not required for Policy Managed database. If specified, it <span class="hiddenGrammarError" pre="it ">will be ignored</span>. Instance names <span class="hiddenGrammarError" pre="names ">are generated</span> automatically based on db_unique_name for Policy Managed dababase.-->

<!-- Listener details are no longer needed starting 11.2. Database <span class="hiddenGrammarError" pre="Database ">is registered</span> with default listener and SCAN listener running from Oracle Grid Infrastructure home. -->

<!--Specify the type of storage <span class="hiddenGrammarError" pre="storage ">to be</span> used by <span class="hiddenSpellError" pre="by ">rac</span> 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 <span class="hiddenGrammarError" pre="Location ">to be</span> configured for <span class="hiddenSpellError" pre="for ">rac</span> 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>+ASMDG</n:TargetDatabaseArea>

<!--Specify Fast Recovery Area <span class="hiddenGrammarError" pre="Area ">to be</span> configured for <span class="hiddenSpellError" pre="for ">rac</span> 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>+ASMDG</n:TargetFlashRecoveryArea>

</n:SharedStorage>

</n:Convert>

</n:ConvertToRAC>

</n:RConfig>

[oracle@raclinux1 sampleXMLs]$

 

December 21, 2010 - Posted by | oracle

1 Comment »

  1. […] DR primary and standby sites using RAC. The primary database is a RAC database created as described here.. The article will emphasize on creating and managing standby RAC database using sqlplus, RMAN and […]

    Pingback by RAC Data Guard setup and management with Oracle 11gR2 (11.2.0.2) « Guenadi N Jilevski's Oracle BLOG | December 24, 2010 | Reply


Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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: