LATEST TOPICS

Steps to migrate to Oracle ASM Filter Driver From ASMLIB (GI Standalone Setup)

In Today’s article, I would be demonstrating the steps involved in migrating the ASM disks from Oracle ASM Library Driver (ASMLIB) to the new Oracle GI 12c feature ASM Filter Driver (ASMFD) for Oracle Clusterware Standalone Environment.

Demonstration:

Lets make a note of the current ASM configuration.
As Oracle GI owner run the following commands

### List the diskgroups from current ASM configuration
###
[oracle@labserver dbs]$ $ORACLE_HOME/bin/asmcmd lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  NORMAL  N         512   4096  1048576     30716    26296                0           13148              0             N  DATA/
MOUNTED  NORMAL  N         512   4096  1048576     20472    20364                0           10182              0             N  FRA/


### Make a note of the disk discovery path for the current diskgroups
###
[oracle@labserver dbs]$ $ORACLE_HOME/bin/asmcmd lsdsk -G DATA
Path
/dev/oracleasm/disks/DATA01
/dev/oracleasm/disks/DATA02

[oracle@labserver dbs]$ $ORACLE_HOME/bin/asmcmd lsdsk -G FRA
Path
/dev/oracleasm/disks/FLASH01
/dev/oracleasm/disks/FLASH02


### Check the configuration of ASM 
### Make sure ASM is using SPFILE
###
[oracle@labserver dbs]$ $ORACLE_HOME/bin/srvctl config asm
[oracle@labserver dbs]$ $ORACLE_HOME/bin/srvctl config asm
ASM home: <CRS home>
Password file:
ASM listener:
Spfile: +DATA/ASM/ASMPARAMETERFILE/registry.253.860835769
ASM diskgroup discovery string: /dev/oracleasm/disks


### Make a note of current disk discovery path
###
[oracle@labserver dbs]$ $ORACLE_HOME/bin/asmcmd dsget
parameter:/dev/oracleasm/disks
profile:/dev/oracleasm/disks

We have gathered all the details required to start with the ASM Disk migration and to use ASM Filter Driver (ASMFD).
Now, lets start with the migration.

Update the ASM Disk discovery path to enable ASMFD lookup. AS GI owner run the following command.

### $ORACLE_HOME/bin/asmcmd dsset old_diskstring, 'AFD:*'
### Replace old_diskstring with value with current disk string 
###
[oracle@labserver ~]$ $ORACLE_HOME/bin/asmcmd dsset ''/dev/oracleasm/disks','AFD:*''

Validate if the disk discovery string is updated.

[oracle@labserver dbs]$ $ORACLE_HOME/bin/asmcmd dsget
parameter:/dev/oracleasm/disks, AFD:*
profile:/dev/oracleasm/disks,AFD:*

We have updated ASM disk discovery string. Now, when we configure ASMFD it would be able to discover and migrate the existing disks.
Lets start with the configuration.
We need to bring down the Clusterware stack. As root user run the following command.

[root@labserver ~]$ $ORACLE_HOME/bin/crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'labserver'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'labserver'
CRS-2673: Attempting to stop 'ora.labdb.db' on 'labserver'
CRS-2677: Stop of 'ora.FRA.dg' on 'labserver' succeeded
CRS-2677: Stop of 'ora.labdb.db' on 'labserver' succeeded
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'labserver'
CRS-2677: Stop of 'ora.DATA.dg' on 'labserver' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'labserver'
CRS-2677: Stop of 'ora.asm' on 'labserver' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'labserver'
CRS-2677: Stop of 'ora.evmd' on 'labserver' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'labserver'
CRS-2677: Stop of 'ora.cssd' on 'labserver' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'labserver' has completed
CRS-4133: Oracle High Availability Services has been stopped.

Now, we are ready for the migration process. As root user execute the following command.
This step will configure ASMFD along with migrating the disks from ASMLIB to ASMFD as well as deconfigure ASMLIB.

[root@labserver ~]$ $ORACLE_HOME/bin/asmcmd afd_configure
Connected to an idle instance.
AFD-627: AFD distribution files found.
AFD-636: Installing requested AFD software.
AFD-637: Loading installed AFD drivers.
AFD-9321: Creating udev for AFD.
AFD-9323: Creating module dependencies - this may take some time.
AFD-9154: Loading 'oracleafd.ko' driver.
AFD-649: Verifying AFD devices.
AFD-9156: Detecting control device '/dev/oracleafd/admin'.
AFD-638: AFD installation correctness verified.
Modifying resource dependencies - this may take some time.
ASMCMD-9524: AFD configuration failed 'ERROR: OHASD start failed'

The error ASMCMD-9524: AFD configuration failed ‘ERROR: OHASD start failed’ can be ignored as it is just stating that the configuration process was not able to start OHASD demon. However, all the remaining configuration were completed successfully.

Validate if ASM Filter Driver is configured and the existing disks are mapped with ASMFD.

### Check the status of ASMFD configuration
###
[root@labserver ~]$ $ORACLE_HOME/bin/asmcmd afd_state
Connected to an idle instance.
ASMCMD-9526: The AFD state is 'LOADED' and filtering is 'DEFAULT' on host 'labserver.home.com'

### Check if the disks can be viewed from ASM Filter Driver Module
###
[root@labserver ~]$ $ORACLE_HOME/bin/asmcmd afd_lsdsk
Connected to an idle instance.
--------------------------------------------------------------------------------
Label                     Filtering   Path
================================================================================
DATA01                      ENABLED   /dev/sdd1
DATA02                      ENABLED   /dev/sde1
FLASH01                     ENABLED   /dev/sdf1
FLASH02                     ENABLED   /dev/sdg1


### Check if the configuration process has stopped the ASMLIB kernel module
###
[root@labserver ~]$ service oracleasm status
Checking if ASM is loaded: no
Checking if /dev/oracleasm is mounted: no

We are almost done with the migration as ASMFD is loaded and the existing disks are already mapped. Once we start the Clusterware stack, we will update few configuration settings to make ASMFD persistent.

Lets start the Clusterware stack as we are done with the ASMFD configuration.
As root run the following command

[root@labserver ~]$ $ORACLE_HOME/bin/crsctl start has
CRS-4123: Oracle High Availability Services has been started.

Now, Since Disks are migrated to ASMFD, remove ASMLIB disk path from disk discovery string.
AS GI owner run the following command

[oracle@labserver dbs]$ $ORACLE_HOME/bin/asmcmd dsset 'AFD:*'
[oracle@labserver dbs]$ $ORACLE_HOME/bin/asmcmd dsget
parameter:AFD:*
profile:AFD:*

We also have to set the disk discovery path for the new ASMFD module to discover any new disks.
AS GI owner run the following command

[oracle@labserver dbs]$ $ORACLE_HOME/bin/asmcmd afd_dsset 'AFD:*'

Validate if the Disk Discovery path is set to use ASMFD

[oracle@labserver dbs]$ $ORACLE_HOME/bin/asmcmd afd_dsget
AFD discovery string: 'AFD:*'

[oracle@labserver dbs]$ $ORACLE_HOME/bin/srvctl config asm
ASM home: <CRS home>
Password file:
ASM listener:
Spfile: +DATA/ASM/ASMPARAMETERFILE/registry.253.860835769
ASM diskgroup discovery string: AFD:*

Validate if ASM Diskgroups are running fine.

[oracle@labserver dbs]$ $ORACLE_HOME/bin/srvctl status diskgroup -diskgroup DATA
Disk Group DATA is running on labserver

[oracle@labserver dbs]$ $ORACLE_HOME/bin/srvctl status diskgroup -diskgroup FRA
Disk Group FRA is running on labserver

Validate if the diskgroups are migrated and using ASMFD

[oracle@labserver dbs]$  $ORACLE_HOME/bin/asmcmd lsdsk -G DATA
Path
AFD:DATA01
AFD:DATA02

[oracle@labserver dbs]$ $ORACLE_HOME/bin/asmcmd lsdsk -G FRA
Path
AFD:FLASH01
AFD:FLASH02

To further ensure everything works fine, lets restart the Clusterware stack for the last time.

[root@labserver ~]$ $ORACLE_HOME/bin/crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'labserver'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'labserver'
CRS-2673: Attempting to stop 'ora.labdb.db' on 'labserver'
CRS-2677: Stop of 'ora.FRA.dg' on 'labserver' succeeded
CRS-2677: Stop of 'ora.labdb.db' on 'labserver' succeeded
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'labserver'
CRS-2677: Stop of 'ora.DATA.dg' on 'labserver' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'labserver'
CRS-2677: Stop of 'ora.asm' on 'labserver' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'labserver'
CRS-2677: Stop of 'ora.evmd' on 'labserver' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'labserver'
CRS-2677: Stop of 'ora.cssd' on 'labserver' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'labserver' has completed
CRS-4133: Oracle High Availability Services has been stopped.

[root@labserver ~]$ $ORACLE_HOME/bin/crsctl start has
CRS-4123: Oracle High Availability Services has been started.

Lets Validate all the components came up and are running as expected.

[root@labserver ~]$ $ORACLE_HOME/bin/crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       labserver                STABLE
ora.FRA.dg
               ONLINE  ONLINE       labserver                STABLE
ora.asm
               ONLINE  ONLINE       labserver                Started,STABLE
ora.ons
               OFFLINE OFFLINE      labserver                STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       labserver                STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       labserver                STABLE
ora.labdb.db
      1        ONLINE  ONLINE       labserver                Open,STABLE
--------------------------------------------------------------------------------

We have now successfully migrated the ASM Disks to use ASM Filter Driver (ASMFD).

%d bloggers like this:
Visit Us On LinkedinVisit Us On TwitterVisit Us On Google PlusCheck Our Feed