Migrating to Oracle ASMLIB from AFD
Why if you do not like to use AFD? You could follow instructions below to come back to our old love, ASMLIB. Although it is possible to migrate to Oracle ASMLIB from AFD, as I mentioned in the Introducing Oracle AFD, Oracle AFD is the superset of the ASMLIB, and it is better to use Oracle AFD. Configuring Oracle AFD after Installation could reverse this migration.
Let me show you how to migrate Oracle ASMLIB from AFD within a scenario:
Existing setup:
Before starting migrating to Oracle ASMLIB from AFD we check existing setup:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | [grid@mydb2 ~]$ asmcmd afd_state ASMCMD-9526: The AFD state is 'LOADED' and filtering is 'ENABLED' on host 'mydb2' [grid@mydb2 ~]$ asmcmd afd_lsdsk -------------------------------------------------------------------------------- Label Filtering Path ================================================================================ AFDDISK01 ENABLED /dev/sdb1 AFDDISK02 ENABLED /dev/sdc1 [grid@mydb2 ~]$ crsctl stat res ora.driver.afd NAME=ora.driver.afd TYPE=ora.driver.afd.type TARGET=ONLINE STATE=ONLINE on mydb2 [grid@mydb2 ~]$ srvctl config asm ASM home: <CRS home> Password file: +DATA/orapwasm Backup of Password file: ASM listener: LISTENER Spfile: +DATA/ASM/ASMPARAMETERFILE/registry.253.969188027 ASM diskgroup discovery string: AFD:* [grid@mydb2 ~]$ crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATA.dg ONLINE ONLINE mydb2 STABLE ora.LISTENER.lsnr ONLINE ONLINE mydb2 STABLE ora.asm ONLINE ONLINE mydb2 Started,STABLE ora.ons OFFLINE OFFLINE mydb2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.cssd 1 ONLINE ONLINE mydb2 STABLE ora.diskmon 1 OFFLINE OFFLINE STABLE ora.driver.afd 1 ONLINE ONLINE mydb2 STABLE ora.evmd 1 ONLINE ONLINE mydb2 STABLE -------------------------------------------------------------------------------- |
In the above review, we saw Oracle AFD has been started and ASM Disk string refers to Oracle AFD disk string path. The first step in practice is to set ASM Disk string so that it also refers to ASMLIB path.
1 2 3 4 5 6 7 8 9 | [grid@mydb2 ~]$ asmcmd dsget parameter:AFD:* profile:AFD:* [grid@mydb2 ~]$ asmcmd dsset 'AFD:*','/dev/oracleasm/disks/*' [grid@mydb2 ~]$ asmcmd dsget parameter:AFD:*, /dev/oracleasm/disks/* profile:AFD:*,/dev/oracleasm/disks/* |
In the following steps, we are going to remove Oracle AFD Configuration and start ASMLIB. As I mentioned in the Introducing Oracle AFD one of the limitations is that AFD and ASMLIB are mutually exclusive. The root user must do this configuration and this setting requires the Oracle Clusterware stack to be down on the local node.
You could find more information about Oracle AFD in MOS.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | [grid@mydb2 ~]$ su - Password: [root@mydb2 ~]# /u01/app/grid/product/12.2/gi_1/bin/crsctl stop has CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'mydb2' CRS-2673: Attempting to stop 'ora.DATA.dg' on 'mydb2' CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'mydb2' CRS-2677: Stop of 'ora.DATA.dg' on 'mydb2' succeeded CRS-2673: Attempting to stop 'ora.asm' on 'mydb2' CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'mydb2' succeeded CRS-2677: Stop of 'ora.asm' on 'mydb2' succeeded CRS-2673: Attempting to stop 'ora.evmd' on 'mydb2' CRS-2677: Stop of 'ora.evmd' on 'mydb2' succeeded CRS-2673: Attempting to stop 'ora.cssd' on 'mydb2' CRS-2677: Stop of 'ora.cssd' on 'mydb2' succeeded CRS-2673: Attempting to stop 'ora.driver.afd' on 'mydb2' CRS-2677: Stop of 'ora.driver.afd' on 'mydb2' succeeded CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'mydb2' has completed CRS-4133: Oracle High Availability Services has been stopped. [root@mydb2 ~]# /u01/app/grid/product/12.2/gi_1/bin/acfsload stop [root@mydb2 ~]# /u01/app/grid/product/12.2/gi_1/bin/asmcmd afd_deconfigure AFD-632: Existing AFD installation detected. AFD-634: Removing previous AFD installation. AFD-635: Previous AFD components successfully removed. Modifying resource dependencies - this may take some time. |
Unlike Oracle AFD, whose installation exists in the Grid Home, the ASMLIB has to be installed by OS tools like yum.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | [root@mydb2 ~]# yum list oracleasm-support Loaded plugins: ulninfo Available Packages oracleasm-support.x86_64 2.1.11-1.el7 ol7_latest [root@mydb2 ~]# yum install oracleasm-support -y Resolving Dependencies --> Running transaction check ---> Package oracleasm-support.x86_64 0:2.1.11-1.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ===================================================================================================================================================================================================== Package Arch Version Repository Size ===================================================================================================================================================================================================== Installing: oracleasm-support x86_64 2.1.11-1.el7 ol7_latest 84 k Transaction Summary ===================================================================================================================================================================================================== Install 1 Package Total download size: 84 k Installed size: 265 k Downloading packages: oracleasm-support-2.1.11-1.el7.x86_64.rpm | 84 kB 00:00:02 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : oracleasm-support-2.1.11-1.el7.x86_64 1/1 Note: Forwarding request to 'systemctl enable oracleasm.service'. Created symlink from /etc/systemd/system/multi-user.target.wants/oracleasm.service to /usr/lib/systemd/system/oracleasm.service. Verifying : oracleasm-support-2.1.11-1.el7.x86_64 1/1 Installed: oracleasm-support.x86_64 0:2.1.11-1.el7 Complete! [root@mydb2 ~]# oracleasm configure -i Configuring the Oracle ASM library driver. This will configure the on-boot properties of the Oracle ASM library driver. The following questions will determine whether the driver is loaded on boot and what permissions it will have. The current values will be shown in brackets ('[]'). Hitting <ENTER> without typing an answer will keep that current value. Ctrl-C will abort. Default user to own the driver interface []: grid Default group to own the driver interface []: asmadmin Start Oracle ASM library driver on boot (y/n) [n]: y Scan for Oracle ASM disks on boot (y/n) [y]: y Writing Oracle ASM library driver configuration: done [root@mydb2 ~]# oracleasm init Creating /dev/oracleasm mount point: /dev/oracleasm Loading module "oracleasm": oracleasm Configuring "oracleasm" to use device physical block size Mounting ASMlib driver filesystem: /dev/oracleasm [root@mydb2 ~]# oracleasm status Checking if ASM is loaded: yes Checking if /dev/oracleasm is mounted: yes [root@mydb2 ~]# oracleasm scandisks Reloading disk partitions: done Cleaning any stale ASM disks... Scanning system for ASM disks... Instantiating disk "AFDDISK01" Instantiating disk "AFDDISK02" [root@mydb2 ~]# oracleasm listdisks AFDDISK01 AFDDISK02 [root@mydb2 ~]# ll /dev/oracleasm/disks/* brw-rw----. 1 grid asmadmin 8, 17 Mar 3 17:40 /dev/oracleasm/disks/AFDDISK01 brw-rw----. 1 grid asmadmin 8, 33 Mar 3 17:40 /dev/oracleasm/disks/AFDDISK02 |
It is time to start Clusterware stack on the local node.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | [root@mydb2 ~]# /u01/app/grid/product/12.2/gi_1/bin/acfsload start ACFS-9391: Checking for existing ADVM/ACFS installation. ACFS-9392: Validating ADVM/ACFS installation files for operating system. ACFS-9393: Verifying ASM Administrator setup. ACFS-9308: Loading installed ADVM/ACFS drivers. ACFS-9154: Loading 'oracleoks.ko' driver. ACFS-9154: Loading 'oracleadvm.ko' driver. ACFS-9154: Loading 'oracleacfs.ko' driver. ACFS-9327: Verifying ADVM/ACFS devices. ACFS-9156: Detecting control device '/dev/asm/.asm_ctl_spec'. ACFS-9156: Detecting control device '/dev/ofsctl'. ACFS-9322: completed [root@mydb2 ~]# /u01/app/grid/product/12.2/gi_1/bin/crsctl start has CRS-4123: Oracle High Availability Services has been started. |
Let me do some verification:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | [grid@mydb2 ~]$ systemctl status oracleasm ● oracleasm.service - Load oracleasm Modules Loaded: loaded (/usr/lib/systemd/system/oracleasm.service; enabled; vendor preset: disabled) Active: inactive (dead) [grid@mydb2 ~]$ crsctl check has CRS-4638: Oracle High Availability Services is online [grid@mydb2 ~]$ asmcmd lsdsk -p -G data Group_Num Disk_Num Incarn Mount_Stat Header_Stat Mode_Stat State Path 1 0 4041520447 CACHED MEMBER ONLINE NORMAL /dev/oracleasm/disks/AFDDISK01 1 1 4041520446 CACHED MEMBER ONLINE NORMAL /dev/oracleasm/disks/AFDDISK02 [grid@mydb2 ~]$ asmcmd dsget parameter:AFD:*, /dev/oracleasm/disks/* profile:AFD:*,/dev/oracleasm/disks/* [grid@mydb2 ~]$ crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATA.dg ONLINE ONLINE mydb2 STABLE ora.LISTENER.lsnr ONLINE ONLINE mydb2 STABLE ora.asm ONLINE ONLINE mydb2 Started,STABLE ora.ons OFFLINE OFFLINE mydb2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.cssd 1 ONLINE ONLINE mydb2 STABLE ora.diskmon 1 OFFLINE OFFLINE STABLE ora.evmd 1 ONLINE ONLINE mydb2 STABLE -------------------------------------------------------------------------------- |
There is an optional step for clearing configuration, which is to remove Oracle AFD path
1 2 3 4 5 6 7 8 9 10 11 12 13 | [grid@mydb2 ~]$ asmcmd dsset '/dev/oracleasm/disks/*' [grid@mydb2 ~]$ asmcmd dsget parameter:/dev/oracleasm/disks/* profile:/dev/oracleasm/disks/* [grid@mydb2 ~]$ srvctl config asm ASM home: <CRS home> Password file: +DATA/orapwasm Backup of Password file: ASM listener: LISTENER Spfile: +DATA/ASM/ASMPARAMETERFILE/registry.253.969188027 ASM diskgroup discovery string: /dev/oracleasm/disks/* |
I hope you’ve enjoyed reading this post.