Visit Counter

Monday, December 26, 2016

Convert non-RAC database to RAC database using rconfig



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 managed or policy managed database respectively.
In this article we will convert the single instance database to an admin managed RAC database.

Source Server:

$ORACLE_HOME/assistants/rconfig/sampleXMLs


Change the following parameters according to your environment


Convert verify="ONLY">
<SourceDBHome>/ora/oracle/oracle12/product/12.1.0/dbhome_12</n:SourceDBHome>
<TargetDBHome>/ora/oracle/product/12.1.0/dbhome_1</n:TargetDBHome>
 <SourceDBInfo SID="oratech">
 <Password>afi123</n:Password>
 <Node name="rac01"/>
 <Node name="rac02"/>
 <InstancePrefix>oratech</n:InstancePrefix>
  <SharedStorage type="ASM">
  <TargetFlashRecoveryArea>+DATA</n:TargetFlashRecoveryArea>


[oracle@rac01 bin]$ cat contorac.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="ONLY">
<!--Specify current OracleHome of non-rac database for SourceDBHome -->
              <n:SourceDBHome>/ora/oracle/oracle12/product/12.1.0/dbhome_12</n:SourceDBHome>
<!--Specify OracleHome where the rac database should be configured. It can be same as SourceDBHome -->
              <n:TargetDBHome>/ora/oracle/product/12.1.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="oratech">
                <n:Credentials>
                  <n:User>sys</n:User>
                  <n:Password>xyz</n:Password>
                  <n:Role>sysdba</n:Role>
                </n:Credentials>
<!--Specify Windows Secure Oracle Home Credentials if the Oracle Home was installed with Secure User option  -->
<!--
                <n:Credentials>
                  <n:User>UserDomain\SecureHomeUserName</n:User>
                  <n:Password>oracle</n:Password>
                  <n:Role>windows_svc</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="rac01"/>
                <n:Node name="rac02"/>
              </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>oratech</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@rac01 bin]$




[oracle@rac01 bin]$ ps -eaf|grep smon

oracle    3858  2537  0 13:47 pts/13   00:00:00 grep smon
oracle    4695     1  0 Dec21 ?        00:00:38 ora_smon_orasoft1
oracle   16287     1  0 Dec21 ?        00:00:14 asm_smon_+ASM1
oracle   17562     1  0 Dec22 ?        00:00:16 ora_smon_test

[oracle@rac01 bin]$ pwd




[oracle@rac01 bin]$ ./rconfig /ora/oracle/oracle12/product/12.1.0/dbhome_12/assistants/contorac.xml
<?xml version="1.0" ?>
<RConfig>
      <Response>
        <Result code="1" >
          Got Exception
        </Result>
       <ErrorDetails>
Error oracle.sysman.assistants.rconfig.parser.ParserException:File Not Found
       </ErrorDetails>
      </Response>
</RConfig>


I got above error while run the contorac.xml file then I copy the controrac.xml under bin directory and then run the rconfig contorac.xml

$ cd /ora/oracle/oracle12/product/12.1.0/dbhome_12/assistants/rconfig/sampleXMLs

$ cp contrac.xml /ora/oracle/oracle12/product/12.1.0/dbhome_12/bin



[oracle@rac01 bin]$ ./rconfig contorac.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>
  </ConvertToRAC></RConfig>

[oracle@rac01 bin]$

















• Logs to monitor
– Single instance database alert log file.
– RAC database alert log file.
– /u01/app/oracle/cfgtoollogs/rconfig [records entire operation step-by-step]
– For RMAN log and SQL log, check the respective directories under /u01/app/oracle/cfgtoollogs/rconfig/db





No comments:

Post a Comment