Convert a Single-Instance ASM to Cluster ASM for Oracle Database 11.2

Oracle Database 11.2
Oracle Grid Infrastructure 11g - 11.2.0.4.0

Deconfiguring GI Software

~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE oracle11gasm01
ora.LISTENER.lsnr
ONLINE ONLINE oracle11gasm01
ora.OCR.dg
ONLINE ONLINE oracle11gasm01
ora.asm
ONLINE ONLINE oracle11gasm01 Started
ora.ons
OFFLINE OFFLINE oracle11gasm01
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1 ONLINE ONLINE oracle11gasm01
ora.diskmon
1 OFFLINE OFFLINE
ora.evmd
1 ONLINE ONLINE oracle11gasm01
ora.orcl.db
1 ONLINE ONLINE oracle11gasm01 Open

~]$ srvctl stop database -d orcl

~]$ crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'oracle11gasm01'
CRS-2673: Attempting to stop 'ora.OCR.dg' on 'oracle11gasm01'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'oracle11gasm01'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'oracle11gasm01'
CRS-2677: Stop of 'ora.DATA.dg' on 'oracle11gasm01' succeeded
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'oracle11gasm01' succeeded
CRS-2677: Stop of 'ora.OCR.dg' on 'oracle11gasm01' succeeded
CRS-2679: Attempting to clean 'ora.OCR.dg' on 'oracle11gasm01'
CRS-2681: Clean of 'ora.OCR.dg' on 'oracle11gasm01' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'oracle11gasm01'
CRS-2677: Stop of 'ora.asm' on 'oracle11gasm01' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'oracle11gasm01'
CRS-2677: Stop of 'ora.cssd' on 'oracle11gasm01' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'oracle11gasm01'
CRS-2677: Stop of 'ora.evmd' on 'oracle11gasm01' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'oracle11gasm01' has completed
CRS-4133: Oracle High Availability Services has been stopped.

~]# /u01/app/11.2.0/grid/crs/install/roothas.pl -deconfig -force -verbose
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Stop failed, or completed with errors.
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Delete failed, or completed with errors.
CRS-4544: Unable to connect to OHAS
CRS-4000: Command Stop failed, or completed with errors.
Successfully deconfigured Oracle Restart stack

~]$ $GRID_HOME/oui/bin/runInstaller -silent -detachHome ORACLE_HOME=$GRID_HOME
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB. Actual 3929 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'DetachHome' was successful.

~]$ cat /u01/app/oraInventory/ContentsXML/inventory.xml

~]# oracleasm listdisks
DATA01
DATA02
OCR01
OCR02
OCR03

~]# oracleasm deletedisk ocr01
Clearing disk header: done
Dropping disk: done

~]# oracleasm deletedisk ocr02
Clearing disk header: done
Dropping disk: done

~]# oracleasm deletedisk ocr03
Clearing disk header: done
Dropping disk: done

~]# rm -rf /u01/app/grid/*
~]# rm -rf /u01/app/11.2.0/grid/*

Configuring SSH User Equivalency

~]# cat >> /etc/hosts << EOF
192.168.3.151 oracle11gasm01
192.168.3.152 oracle11gasm02
100.100.100.151 asm01-priv
100.100.100.152 asm02-priv
192.168.3.154 asm01-vip
192.168.3.155 asm02-vip
192.168.3.156 asm-scan
EOF

~]# grep -Ev '^#|^$|127.0.0.1|vip|scan|priv|:' /etc/hosts | awk '{print "ssh " $2 " date;"}' > /tmp/sshTest.sh

~]$ /soft/grid/sshsetup/sshUserSetup.sh -hosts oracle11gasm01 oracle11gasm02 -user grid -advanced -noPromptPassphrase
~]$ bash /tmp/sshTest.sh

~]$ /soft/grid/sshsetup/sshUserSetup.sh -hosts oracle11gasm01 oracle11gasm02 -user oracle -advanced -noPromptPassphrase
~]$ bash /tmp/sshTest.sh

Configuring GI Software

Login as grid.

~]# oracleasm createdisk OCR01 /dev/sdb1
Writing disk header: done
Instantiating disk: done

~]# oracleasm createdisk OCR02 /dev/sde1
Writing disk header: done
Instantiating disk: done

~]# oracleasm createdisk OCR03 /dev/sdf1
Writing disk header: done
Instantiating disk: done

~]# oracleasm listdisks
DATA01
DATA02
OCR01
OCR02
OCR03

~]# chown -R grid:oinstall /u01/app/grid
~]# chown -R grid:oinstall /u01/app/11.2.0/grid

~]$ cp /soft/grid/response/grid_install.rsp .
~]$ cat > grid_install.rsp << 'EOF'
oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v11_2_0
ORACLE_HOSTNAME=oracle11gasm01
INVENTORY_LOCATION=/u01/app/grid/oraInventory
SELECTED_LANGUAGES=en
oracle.install.option=CRS_CONFIG
ORACLE_BASE=/u01/app/grid
ORACLE_HOME=/u01/app/11.2.0/grid
oracle.install.asm.OSDBA=asmdba
oracle.install.asm.OSOPER=asmoper
oracle.install.asm.OSASM=asmadmin
oracle.install.crs.config.gpnp.scanName=asm-scan
oracle.install.crs.config.gpnp.scanPort=1521
oracle.install.crs.config.clusterName=asm-cluster
oracle.install.crs.config.gpnp.configureGNS=false
oracle.install.crs.config.gpnp.gnsSubDomain=
oracle.install.crs.config.gpnp.gnsVIPAddress=
oracle.install.crs.config.autoConfigureClusterNodeVIP=
oracle.install.crs.config.clusterNodes=oracle11gasm01:asm01-vip,oracle11gasm02:asm02-vip
oracle.install.crs.config.networkInterfaceList=ens192:192.168.3.0:1,ens224:100.100.100.0:2
oracle.install.crs.config.storageOption=ASM_STORAGE
oracle.install.crs.config.sharedFileSystemStorage.diskDriveMapping=
oracle.install.crs.config.sharedFileSystemStorage.votingDiskLocations=
oracle.install.crs.config.sharedFileSystemStorage.votingDiskRedundancy=NORMAL
oracle.install.crs.config.sharedFileSystemStorage.ocrLocations=
oracle.install.crs.config.sharedFileSystemStorage.ocrRedundancy=NORMAL
oracle.install.crs.config.useIPMI=false
oracle.install.crs.config.ipmi.bmcUsername=
oracle.install.crs.config.ipmi.bmcPassword=
oracle.install.asm.SYSASMPassword=Asm_1234
oracle.install.asm.diskGroup.name=OCR
oracle.install.asm.diskGroup.redundancy=NORMAL
oracle.install.asm.diskGroup.AUSize=1
oracle.install.asm.diskGroup.disks=/dev/oracleasm/disks/OCR01,/dev/oracleasm/disks/OCR02,/dev/oracleasm/disks/OCR03
oracle.install.asm.diskGroup.diskDiscoveryString=/dev/oracleasm/disks/*
oracle.install.asm.monitorPassword=Asm_1234
oracle.install.crs.upgrade.clusterNodes=
oracle.install.asm.upgradeASM=false
oracle.installer.autoupdates.option=
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
EOF

~]$ /soft/grid/runcluvfy.sh stage -pre crsinst -n oracle11gasm01,oracle11gasm02 -verbose
~]$ /soft/grid/runInstaller -responseFile /home/grid/grid_install.rsp -silent -ignorePrereq -ignoreSysPrereqs -showProgress

~]# /u01/app/11.2.0/grid/root.sh # on all nodes

Configuring DB Software

Login as oracle.

~]$ mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1

~]$ cp /soft/database/response/db_install.rsp .
~]$ cat > db_install.rsp << 'EOF'
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=oracle11gasm01
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1/
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.EEOptionsSelection=false
oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.4.0,oracle.oraolap:11.2.0.4.0,oracle.rdbms.dm:11.2.0.4.0,oracle.rdbms.dv:11.2.0.4.0,oracle.rdbms.lbac:11.2.0.4.0,oracle.rdbms.rat:11.2.0.4.0
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oper
oracle.install.db.CLUSTER_NODES=oracle11gasm01,oracle11gasm02
oracle.install.db.isRACOneInstall=
oracle.install.db.racOneServiceName=
oracle.install.db.config.starterdb.type=
oracle.install.db.config.starterdb.globalDBName=
oracle.install.db.config.starterdb.SID=
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.SYSMAN=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.automatedBackup.osuid=
oracle.install.db.config.starterdb.automatedBackup.ospwd=
oracle.install.db.config.starterdb.storageType=
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=
DECLINE_SECURITY_UPDATES=true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
COLLECTOR_SUPPORTHUB_URL=
oracle.installer.autoupdates.option=
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=
EOF

~]$ /soft/database/runInstaller -responseFile /home/oracle/db_install.rsp -silent -ignorePrereq -ignoreSysPrereqs -showProgress -waitforcompletion

~]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh # on all nodes

Register Listner,ASM,DB Resources

Network Management on Oracle Database 11.2 RAC
Register the ASM or Database resource to CRS

Convert Single Instance Database to RAC Database using RCONFIG

Login as oracle.

~]$ cp $ORACLE_HOME/assistants/rconfig/sampleXMLs/ConvertToRAC_AdminManaged.xml .

~]$ cat > ConvertToRAC_AdminManaged.xml << 'EOF'
<?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>/u01/app/oracle/product/11.2.0/db_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="orcl">
<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="oracle11gasm01"/>
<n:Node name="oracle11gasm02"/>
</n:NodeList>
<!--Specify RacOneNode along with servicename to convert database to RACOne Node -->
<!--n:RacOneNode servicename="orcl"/-->
<!--Instance Prefix tag is optional starting with 11.2. If left empty, it is derived from db_unique_name.-->
<n:InstancePrefix>orcl</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>
EOF

~]$ $ORACLE_HOME/bin/rconfig ConvertToRAC_AdminManaged.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>

~]$ sed -i 's/"ONLY"/"YES"/' ConvertToRAC_AdminManaged.xml

~]$ $ORACLE_HOME/bin/rconfig ConvertToRAC_AdminManaged.xml
Converting Database "orcl" 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="orcl1" Node="oracle11gasm01" >
</Instance>
<Instance SID="orcl2" Node="oracle11gasm02" >
</Instance>
</InstanceList>
</Database> </ReturnValue>
</Convert>
</ConvertToRAC></RConfig>

~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE oracle11gasm01
ONLINE ONLINE oracle11gasm02
ora.LISTENER.lsnr
ONLINE ONLINE oracle11gasm01
ONLINE ONLINE oracle11gasm02
ora.OCR.dg
ONLINE ONLINE oracle11gasm01
ONLINE ONLINE oracle11gasm02
ora.asm
ONLINE ONLINE oracle11gasm01 Started
ONLINE ONLINE oracle11gasm02 Started
ora.gsd
OFFLINE OFFLINE oracle11gasm01
OFFLINE OFFLINE oracle11gasm02
ora.net1.network
ONLINE ONLINE oracle11gasm01
ONLINE ONLINE oracle11gasm02
ora.ons
ONLINE ONLINE oracle11gasm01
ONLINE ONLINE oracle11gasm02
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE oracle11gasm01
ora.cvu
1 ONLINE ONLINE oracle11gasm01
ora.oc4j
1 ONLINE ONLINE oracle11gasm01
ora.oracle11gasm01.vip
1 ONLINE ONLINE oracle11gasm01
ora.oracle11gasm02.vip
1 ONLINE ONLINE oracle11gasm02
ora.orcl.db
1 ONLINE ONLINE oracle11gasm01 Open
2 ONLINE ONLINE oracle11gasm02 Open
ora.scan1.vip
1 ONLINE ONLINE oracle11gasm01

Remove Old Oracle Home

~]$ /u01/app/oracle/product/11.2.0/db_1/oui/bin/runInstaller -silent -detachHome ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
~]$ cat /u01/app/oraInventory/ContentsXML/inventory.xml

~]$ rm -rf /u01/app/oracle/product/11.2.0/db_1

Troubleshooting

[FATAL] [INS-35354] The system on which you are attempting to install Oracle RAC is not part of a valid cluster.

CAUSE: Before you can install Oracle RAC, you must install Oracle Grid Infrastructure on all servers (Oracle Clusterware and Oracle ASM) to create a cluster.

ACTION: Oracle Grid Infrastructure is not installed. Install it either from the separate installation media included in your media pack, or install it by downloading it from Electronic Product Delivery (EPD) or the Oracle Technology Network (OTN). Oracle Grid Infrastructure normally is installed by a different operating system user than the one used for Oracle Database. It may need to be installed by your system administrator. See the installation guide for more details.

CAUSE:

From the inventory.xml, we see that the HOME NAME line is missing the CRS="true" flag.

~]$ cat /u01/app/oraInventory/ContentsXML/inventory.xml
<INVENTORY>
<VERSION_INFO>
<SAVED_WITH>11.2.0.4.0</SAVED_WITH>
<MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="OraHome1" LOC="/ggs" TYPE="O" IDX="3"/>
<HOME NAME="Ora11g_gridinfrahome1" LOC="/u01/app/11.2.0/grid" TYPE="O" IDX="1">
<NODE_LIST>
<NODE NAME="oracle11gasm01"/>
<NODE NAME="oracle11gasm02"/>
</NODE_LIST>
</HOME>
<HOME NAME="OraDb11g_home1" LOC="/u01/app/oracle/product/11.2.0/db_1" TYPE="O" IDX="2" REMOVED="T"/>
</HOME_LIST>
<COMPOSITEHOME_LIST>
</COMPOSITEHOME_LIST>
</INVENTORY>

SOLUTION:

~]$ /u01/app/11.2.0/grid/oui/bin/runInstaller -updateNodeList "CLUSTER_NODES={oracle11gasm01,oracle11gasm02}" ORACLE_HOME="/u01/app/11.2.0/grid" ORACLE_HOME_NAME="Ora11g_gridinfrahome1" LOCAL_NODE="oracle11gasm01"