Real-time scenarios in production Oracle Servers:

There will be an incident or there will be a request from the DBA team to add more space to the existing ASM disks group. Now once request came to Unix team we required increasing the space in ASM disk group, so it’s time to request with the storage team to add more disk to those DB servers.

If it’s an individual DB server we can request the storage team to assign the required LUN in that single server. In case we have two or more DB servers in HA mode we need to request the same LUN’s across all the servers.

Find more ASM related articles as follows:

Check the running kernel:

First check for which kernel currently under use. If it’s UEK kernel we need to check for the oracleasm package.

If Oracle ASM installed below steps can be carried out.

# uname -r

Scanning for attached SAN LUN’s:

Once we getting LUN from Storage team we have to scan for the LUN’s manually using below re-scan command.

# rescan-scsi-bus.sh

Once done with scanning we will get the timestamp for newly added disks under below location.

# cd /dev/disk/by-id/
# ls -lthr

Sample:

lrwxrwxrwx 1 root root 10 Nov 25 20:55 wwn-0x6ac61751004ce7d050207ee300000129 -> ../../sdcs
lrwxrwxrwx 1 root root 10 Nov 25 20:55 scsi-36ac61751004ce7d050207f4c0000012a -> ../../sdct
lrwxrwxrwx 1 root root 10 Nov 25 20:55 wwn-0x6ac61751004ce7d050207f4c0000012a -> ../../sdct
lrwxrwxrwx 1 root root 10 Nov 25 20:55 scsi-36ac61751004ce7d050207fa10000012b -> ../../sdcu

The Same time we can observe the new disks from dmesg output.

# dmesg

Sample output of dmesg:

scsi 1:0:1:137: Direct-Access HUAWEI XSG1 4303 PQ: 0 ANSI: 6
sd 1:0:1:137: Attached scsi generic sg565 type 0
sd 1:0:1:124: [sduc] Attached SCSI disk
sd 1:0:1:134: [sdum] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
sd 1:0:1:135: [sdun] Write Protect is off
sd 1:0:1:135: [sdun] Mode Sense: 97 00 00 08
sd 1:0:1:137: [sdup] 4194304 512-byte logical blocks: (2.14 GB/2.00 GiB)

Conigure Multipath for SAN LUN’s:

Once we confirmed the new disk by matching with scanned output move forward to configure multipath.

# vim /etc/multipath.conf

At the bottom of the file add the above scanned LUN information as follows.

wwwid = LUN ID                  // This need to match scanned one and provided by storage team.
Alias = OCS_DATA_089     // This is just a reference for you, Name requested by DBA team.

 class="">multipath {
                  wwid 36ac61751004ce7d050208e2900000146
                  alias  OCS_DATA_089
          }

multipath {
                  wwid 36ac61751004ce7d050208e7d00000147
                  alias  OCS_ARCHIVE_006
          }

save and quit using wq!

Once done with configuring multipath reload the new configuration changes.

# sudo /etc/init.d/multipathd reload

List the newly labelled Alias name using “multipath -ll” this output will be long. To get the specific Alias output we can do a grep.

Listing the configured Multipath SAN Disk:

# sudo multipath -ll OCS_DATA_089

The output will be similar to below. We need to verify the number of paths, path status (active), Size, Alias name, State (Ready)

 class="">OCS_DATA_089 (36ac61751004ce7d050208e2900000146) dm-137 HUAWEI,XSG1
size=500G features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
 |- 0:0:0:124 sddv 71:208  active ready running
 |- 1:0:0:124 sdor 129:368 active ready running
 |- 0:0:1:124 sdjg 8:416   active ready running
 `- 1:0:1:124 sduc 66:576  active ready running

OCS_ARCHIVE_006 (36ac61751004ce7d05020336c000000e0) dm-24 HUAWEI,XSG1
size=500G features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
 |- 0:0:0:22 sdx  65:112  active ready running
 |- 1:0:0:22 sdkt 67:272  active ready running
 |- 0:0:1:22 sdfi 130:64  active ready running
 `- 1:0:1:22 sdqe 131:480 active ready running

verify device name and Alias under below location. Both the below dm device value and Alias need to match the above “multiapth -ll” output.

# ls -lthr /dev/mapper/OCS_DATA_089 lrwxrwxrwx 1 root root 9 Nov 26 04:27 /dev/mapper/OCS_DATA_089 -> ../dm-137
# ls -lthr /dev/mapper/OCS_ARCHIVE_006 lrwxrwxrwx 1 root root 8 Nov 26 04:27 /dev/mapper/OCS_ARCHIVE_006 -> ../dm-24


Create ASM Disks on Mulitpath Disks:

Once everything verified and looks good. Create the ASM disk using the command.

# /etc/init.d/oracleasm createdisk OCS_DATA_089 /dev/mapper/OCS_DATA_089
  • oracleasm command to mark any disk as ASM disk.
  • createdisk to mark a disk as ASM disk.
  • OCS_DATA_089 is Label of ASM disk.
  • Device which we are about to use for ASM disk.

Once it created we will get the ASM disk under /dev/oracleasm/disks/ with oracle:oinstall ownership.

# ls -lthr /dev/oracleasm/disks/OCS_DATA_089
# ls -lthr /dev/oracleasm/disks/OCS_ARCHIVE_006

brw-rw---- 1 oracle oinstall 252, 137 Nov 30 13:11 /dev/oracleasm/disks/OCS_DATA_089
brw-rw---- 1 oracle oinstall 252, 24 Nov 30 12:42 /dev/oracleasm/disks/OCS_ARCHIVE_006

Same we can list it using command.

# /etc/init.d/oracleasm listdisks

Note: > If the ASM disk wants to be in HA nodes (multiple servers) just we need to do the above step 2 to 5 and run the below scan disks in other nodes.

# /etc/init.d/oracleasm scandisks

That’s it we have done with creating ASM disks under single or multiple servers.

Conclusion:

To marking a SAN disk as ASM we need to get the disk from storage team and align with an alias to identify the disk. By following reload the multi-path service and mark the SAN disk as ASM disks. If you have any query kindly provide your comment in below comment section, we will be back to you with the solution.

Babin Lonston
Overall 14+ Years of experience in IT field, 7+ years of experience in Linux administration with Virtualization & Cloud technologies. Love documentation and being Numismatics for a long time.

Granting Access control List (ACL) for a user on a file in Solaris 11

Previous article

Solution for Perl Module DBD::Oracle installation error

Next article

You may also like

4 Comments

  1. i’d prefer using udev rules or afd because asmlib is – or will be – deprecated.

    1. @Wolfrootel,

      Thanks for the feedback, Kindly find our old post related to UDEV.

  2. i’d prefer using udev rules or afd because asmlib is – or will be – deprecated.

    1. @Wolfrootel,

      Thanks for the feedback, Kindly find our old post related to UDEV.

Leave a reply

Your email address will not be published.