Skip to main content

This HowTo demonstrates migrating a RAC cluster to Flex ASM from 'traditional' ASM.

Flex ASM is, to a certain extent, to Database 12c what SCAN is to Database 11gR2.  However, Flex ASM is more revolutionary than SCAN, which itself is more evolutionary.  Even with non-clustered database installations you were always able to run more than one listener and use an address list to provide access while at least one listener was running.  SCAN just allowed you to minimise the amount of listeners required on a large RAC cluster.  Flex ASM, however, provides us with something that was previously unattainable: the ability to run multiple, independent in cardinality, ASM instances.  This is just one of many different documented configurations.

The prerequisites are that the OCR files, ASM parameter file and ASM password file are stored in an ASM disk group with asm.compatible set to at least 12.1.  We will confirm the ASM cluster mode before we begin and after we have finished.

[oracle@h1-o12-cl1 ~]$ . oraenv
ORACLE_SID = [oracle] ? +ASM1
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@h1-o12-cl1 ~]$ asmcmd showclustermode
ASM cluster : Flex mode disabled

Now run The ASM Configuration Assistant, asmca, and select the ASM Instances tab.  You will be presented with the following table and a button to 'Convert to Oracle Flex ASM'.

Node Instance Name Status ADVM Driver Status
h1-o12-cl1 +ASM1 Up Loaded
h2-o12-cl1 +ASM2 Up Loaded

Click the button and you will be presented with a table showing the network interfaces and their IPv4 addresses (IPv6 addresses are not shown).

Check Interface Name Subnet Interface In Use
No eth0 10.1.2.0 No-public
No eth1 192.168.0.0 Yes-cluster_interconnect

Note that Flex ASM is limited to using an IPv4 network, so either create a new IPv4 network or check the 'eth1' network interface and click 'OK'.  When ready, choose 'Yes' when informed that GI will be restarted one node at a time.  You will then be given the name of a script to run on the local node, i.e. /u01/app/oracle/cfgtoollogs/asmca/scripts/converttoFlexASM.sh, containing the following commands.

#!/bin/sh

su oracle -c "/u01/app/12.1.0/grid/bin/srvctl add asm -proxy"
/u01/app/12.1.0/grid/srvm/admin/srvmhelper -updateDepASM
for node in h1-o12-cl1 h2-o12-cl1
do
        /u01/app/12.1.0/grid/bin/crsctl stop cluster -n $node
        /u01/app/12.1.0/grid/bin/crsctl start cluster -n $node

        stat=1
        cmd="/u01/app/12.1.0/grid/bin/crsctl status server $node"
        while [ $stat = 1 ]
        do
                sleep 5
                op=`$cmd`
                op=`echo $op | /bin/cut -d' ' -f2  | /bin/cut -d'=' -f2`
                if [ "$op" = "ONLINE" ]
                then
                        stat=0
                        echo "Cluster bounced in node $node"
                fi
        done
done

Run this script as root.

[root@h1-o12-cl1 ~]# time /u01/app/oracle/cfgtoollogs/asmca/scripts/converttoFlexASM.sh
CRS-2673: Attempting to stop 'ora.crsd' on 'h1-o12-cl1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'h1-o12-cl1'
[...]
CRS-2672: Attempting to start 'ora.crsd' on 'h1-o12-cl1'
CRS-2676: Start of 'ora.crsd' on 'h1-o12-cl1' succeeded
Cluster bounced in node h1-o12-cl1
CRS-2673: Attempting to stop 'ora.crsd' on 'h2-o12-cl1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'h2-o12-cl1'
[...]
CRS-2672: Attempting to start 'ora.crsd' on 'h2-o12-cl1'
CRS-2676: Start of 'ora.crsd' on 'h2-o12-cl1' succeeded
Cluster bounced in node h2-o12-cl1

real	4m42.838s
user	0m1.658s
sys	0m1.518s

Now recheck the cluster mode of ASM.

[oracle@h1-o12-cl1 ~]$ . oraenv
ORACLE_SID = [oracle] ? +ASM1
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@h1-o12-cl1 ~]$ asmcmd showclustermode
ASM cluster : Flex mode enabled

Note the new +APX proxy instance running now and the new listener endpoint on the private interconnect's IPv4 address.

[root@h2-o12-cl1 ~]# oifcfg getif
eth0  10.1.2.0  global  public
eth1  192.168.0.0  global  cluster_interconnect,asm
eth0  2001:123:4:5::  global  public
[oracle@h1-o12-cl1 ~]$ ps -ef|grep pmon_+
oracle    9098     1  0 17:50 ?        00:00:00 asm_pmon_+ASM1
oracle   10122     1  0 17:51 ?        00:00:00 apx_pmon_+APX1
[oracle@h2-o12-cl1 ~]$ ps -ef|grep tns
root        10     2  0 17:09 ?        00:00:00 [netns]
oracle   11821     1  0 17:53 ?        00:00:00 /u01/app/12.1.0/grid/bin/tnslsnr ASMNET1LSNR_ASM -no_crs_notify -inherit
oracle   12029     1  0 17:53 ?        00:00:00 /u01/app/12.1.0/grid/bin/tnslsnr LISTENER -no_crs_notify -inherit
oracle   12032     1  0 17:53 ?        00:00:00 /u01/app/12.1.0/grid/bin/tnslsnr LISTENER_SCAN1 -no_crs_notify -inherit
[oracle@h2-o12-cl1 ~]$ netstat -ntl|grep 1521
tcp        0      0 10.1.2.95:1521            0.0.0.0:*                   LISTEN
tcp        0      0 10.1.2.93:1521            0.0.0.0:*                   LISTEN
tcp        0      0 10.1.2.90:1521            0.0.0.0:*                   LISTEN
tcp        0      0 192.168.0.90:1521           0.0.0.0:*                   LISTEN
tcp        0      0 2001:123:4:5::3:60:1521   :::*                        LISTEN
tcp        0      0 2001:123:4:5::3:5d:1521   :::*                        LISTEN
tcp        0      0 2001:123:4:5:216:3ef:1521 :::*                        LISTEN
[oracle@h1-o12-cl1 ~]$ srvctl status asm -detail
ASM is running on h1-o12-cl1,h2-o12-cl1
ASM is enabled.
[oracle@h1-o12-cl1 ~]$ srvctl config asm
ASM home: /u01/app/12.1.0/grid
Password file: +CL1OCR/orapwASM
ASM listener: LISTENER
ASM instance count: ALL
Cluster ASM listener: ASMNET1LSNR_ASM
[oracle@h1-o12-cl1 ~]$ crsctl status resource -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr
               ONLINE  ONLINE       h1-o12-cl1             STABLE
               ONLINE  ONLINE       h2-o12-cl1             STABLE
ora.proxy_advm
               ONLINE  ONLINE       h1-o12-cl1             STABLE
               ONLINE  ONLINE       h2-o12-cl1             STABLE
ora.asm
      1        ONLINE  ONLINE       h1-o12-cl1             STABLE
      2        ONLINE  ONLINE       h2-o12-cl1             STABLE

Let's now kill ASM on cluster node 1 and see what happens to the RAC database instance on node 1.

[oracle@h1-o12-cl1 ~]$ ps -ef|grep pmon
oracle    9098     1  0 17:50 ?        00:00:00 asm_pmon_+ASM1
oracle    9423     1  0 17:50 ?        00:00:00 ora_pmon_cl1cdb1_1
oracle   10122     1  0 17:51 ?        00:00:00 apx_pmon_+APX1
oracle   16897 15751  0 18:42 ttyS0    00:00:00 grep pmon
[oracle@h1-o12-cl1 ~]$ kill -9 9098 10122
[oracle@h1-o12-cl1 ~]$ crsctl stat res ora.asm -v
NAME=ora.asm
TYPE=ora.asm.type
LAST_SERVER=h1-o12-cl1
STATE=OFFLINE
TARGET=ONLINE
CARDINALITY_ID=1
CREATION_SEED=92
RESTART_COUNT=1
FAILURE_COUNT=0
FAILURE_HISTORY=
ID=ora.asm 1 1
INCARNATION=1
LAST_RESTART=NEVER
LAST_STATE_CHANGE=08/26/2013 18:42:56
STATE_DETAILS=
INTERNAL_STATE=CLEANING
INSTANCE_COUNT=2

LAST_SERVER=h2-o12-cl1
STATE=ONLINE on h2-o12-cl1
TARGET=ONLINE
CARDINALITY_ID=2
CREATION_SEED=92
RESTART_COUNT=0
FAILURE_COUNT=0
FAILURE_HISTORY=
ID=ora.asm 2 1
INCARNATION=0
LAST_RESTART=NEVER
LAST_STATE_CHANGE=NEVER
STATE_DETAILS=
INTERNAL_STATE=STABLE
INSTANCE_COUNT=2

ASM has restarted and the database instance's PMON has remained stable.

[oracle@h1-o12-cl1 ~]$ ps -ef|grep pmon
oracle    9423     1  0 17:50 ?        00:00:00 ora_pmon_cl1cdb1_1
oracle   16956     1  0 18:43 ?        00:00:00 asm_pmon_+ASM1
oracle   17130     1  0 18:43 ?        00:00:00 apx_pmon_+APX1

The alert log for this instance shows what transpired during this reconnection process.

Mon Aug 26 18:43:13 2013
NOTE: ASMB registering with ASM instance as client 0x10000 (reg:95210492)
NOTE: ASMB connected to ASM instance +ASM2 (Flex mode; client id 0x10000)
NOTE: ASMB rebuilding ASM server state
NOTE: ASMB rebuilt 2 (of 2) groups
NOTE: ASMB rebuilt 19 (of 19) allocated files
NOTE: fetching new locked extents from server
NOTE: 0 locks established; 0 pending writes sent to server
SUCCESS: ASMB reconnected & completed ASM server state
Mon Aug 26 18:44:25 2013
ALTER SYSTEM SET local_listener=' (ADDRESS=(PROTOCOL=TCP)(HOST=2001:123:4:5::33:5c)(PORT=1521))','(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.2.92) (PORT=1521))' SCOPE=MEMORY SID='cl1cdb1_1';

But a short while later, CRS performs a normal shutdown of this database instance...

Classifications