Tuesday 25 July 2017

ODA (Oracle Database Appliance) Convert Single Instance Database to RAC

This doc describe step by step procedure to Convert Single Instance Database to RAC on ODA (Oracle Database Appliance) HA using Rconfig utility.


1.Verify the current configuration of the database to be going to covert to RAC.

[oracle@abc0 ~]$ srvctl config database -d boston
Database unique name: boston
Database name: boston
Oracle home: /u01/app/oracle/product/12.1.0.2/dbhome_5
Oracle user: oracle
Spfile: /u02/app/oracle/oradata/datastore/.ACFS/snaps/boston/boston/spfileboston.ora
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups:
Mount point paths: /u01/app/oracle/oradata/datastore,/u02/app/oracle/oradata/datastore,/u01/app/oracle/fast_recovery_area/datastore
Services:
Type: SINGLE
OSDBA group: dba
OSOPER group: racoper
Database instance: boston
Configured nodes: abc0
Database is administrator managed
[oracle@abc0 ~]$ srvctl status database -d boston
Instance boston is running on node abc0


2. List the current database and check type of database.

[root@abc0 oak]# oakcli show databases -detail
Name     Type       Storage   HomeName             HomeLocation                                       Version                             HostName                    
-----    ------     --------  --------------       -----------------                                  -----------                         --------------              

boston   SINGLE     ACFS      OraDb12102_home5     /u01/app/oracle/product/12.1.0.2/dbhome_5          12.1.0.2.170418(25171037,25942196)  abc0                        


[root@abc0 oak]# ps -ef | grep pmon
grid      9928     1  0 10:07 ?        00:00:00 apx_pmon_+APX1
grid      9930     1  0 10:07 ?        00:00:00 asm_pmon_+ASM1
oracle   14671     1  0 10:08 ?        00:00:00 ora_pmon_boston
root     27400 16049  0 10:23 pts/0    00:00:00 grep pmon


3. Edit the ConvertToRAC_AdminManaged.xml file

a. Specify the database current and expected home.
b. Specify the Database SID and credentials.
c. Specify the Node list, where RAC instances going to run.
d. Specify Instance prefix(Optional)
e. Specify sotrage type, ASM is default.
f. Leave the locations empty for Database files and Fast Recovery Area.


[oracle@abc0 ~]$ 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="NO">
<!--Specify current OracleHome of non-rac database for SourceDBHome -->
              <n:SourceDBHome>/u01/app/oracle/product/12.1.0.2/dbhome_5</n:SourceDBHome>
<!--Specify OracleHome where the rac database should be configured. It can be same as SourceDBHome -->
              <n:TargetDBHome>/u01/app/oracle/product/12.1.0.2/dbhome_5</n:TargetDBHome>
<!--Specify SID of non-rac database and credential. User with sysdba role is required to perform conversion -->
              <n:SourceDBInfo SID="boston">
                <n:Credentials>
                  <n:User>sys</n:User>
                  <n:Password>oracle</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="abc0"/>
                <n:Node name="abc1"/>
              </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>boston</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> </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> </n:TargetFlashRecoveryArea>
              </n:SharedStorage>
        </n:Convert>
    </n:ConvertToRAC>
</n:RConfig>


4. Once XML file is ready, Set the environment variable for the Database to be going to convert.
then goto Database home, then bin directory.

[oracle@abc0 ~]$ . oraenv
ORACLE_SID = [oracle] ? boston
The Oracle base has been set to /u01/app/oracle
[oracle@abc0 ~]$ cd $ORACLE_HOME/bin


5. From Database home, bin directory, Execute the rconfig utility and specify the location of the XML file.


[oracle@abc0 bin]$ ./rconfig /home/oracle/ConvertToRAC_AdminManaged.xml
Converting Database "boston" to Cluster Database. Target Oracle Home: /u01/app/oracle/product/12.1.0.2/dbhome_5. Database Role: PRIMARY.
Setting Data Files and Control Files
Adding Trace files
Adding Database Instances
Adding Redo Logs
Enabling threads for all Database Instances
Setting TEMP tablespace
Adding UNDO tablespaces
Setting Fast Recovery Area
Updating Oratab
Creating Password file(s)
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/12.1.0.2/dbhome_5
       </Oracle_Home>
       <Database type="ADMIN_MANAGED"  >
         <InstanceList>
           <Instance SID="boston1" Node="abc0"  >
           </Instance>
           <Instance SID="boston2" Node="abc1"  >
           </Instance>
         </InstanceList>
       </Database>     </ReturnValue>
    </Convert>
  </ConvertToRAC></RConfig>



6. Once conversion completed successfully, List the databases to check if database converted to RAC.

[root@abc0 oak]# oakcli show databases -detail
Name     Type       Storage   HomeName             HomeLocation                                       Version                             HostName                    
-----    ------     --------  --------------       -----------------                                  -----------                         --------------              
boston   RAC        ACFS      OraDb12102_home5     /u01/app/oracle/product/12.1.0.2/dbhome_5          12.1.0.2.170418(25171037,25942196)  abc0,abc1                    


7. Verify the configuration of the database.

[oracle@abc0 ~]$ srvctl config  database -d boston
Database unique name: boston
Database name: boston
Oracle home: /u01/app/oracle/product/12.1.0.2/dbhome_5
Oracle user: oracle
Spfile: /u02/app/oracle/oradata/datastore/.ACFS/snaps/boston/boston/spfileboston.ora
Password file: /u02/app/oracle/oradata/datastore/.ACFS/snaps/boston/orapwboston
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups:
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: racoper
Database instances: boston1,boston2
Configured nodes: abc0,abc1
Database is administrator managed


8. Check the RAC processes.

ora.boston.db
      1        ONLINE  ONLINE       abc0                     Open,STABLE
      2        ONLINE  ONLINE       abc1                     Open,STABLE

[oracle@abc0 ~]$ ps -ef | grep pmon
grid      9928     1  0 10:07 ?        00:00:00 apx_pmon_+APX1
grid      9930     1  0 10:07 ?        00:00:00 asm_pmon_+ASM1
oracle   33427     1  0 10:34 ?        00:00:00 ora_pmon_boston1
oracle   39661 27639  0 10:52 pts/0    00:00:00 grep pmon

9. Check if instances are running on all nodes.

[oracle@abc0 ~]$ srvctl status database -d boston
Instance boston1 is running on node abc0
Instance boston2 is running on node abc1


Database is successfully converted to RAC.

No comments:

Post a Comment