Adding New SAN Disks to ASM for OCR Disk Group

Recently we had to migrate our ASM disks to a new SAN.  In this particular post we’ll take a look at the steps we went through for the diskgroup that is used by our Oracle RAC servers for the Oracle Cluster Registry (OCR) and the voting files.  The environment is Oracle database 11.2.0.3 on Oracle Linux 6.4.  This particular diskgroup (we’ll call it OCR) was originally created with 3 disks with normal redundancy.  We provisioned 3 new LUNS from our new SAN to replace the current OCR disks.

Note: The original disks were named VOL1 – VOL3 while the new ones we’ll provide a name that has a little more meaning, OCR1 – OCR3.

 

1) Let’s take a look at the current OCR disks and voting file location (should be the same).

SQL> select adg.name, ad.disk_number, ad.header_status, ad.mode_status, 
ad.path, ad.voting_file
from v$asm_diskgroup adg, v$asm_disk ad
where ad.voting_file='Y'
and adg.group_number = ad.group_number
order by ad.disk_number;

NAME DISK_NUMBER HEADER_STATU MODE_ST PATH V
-------- ----------- ------------ ------- ---------------------- -
OCR 3 MEMBER ONLINE ORCL:VOL1 Y
OCR 4 MEMBER ONLINE ORCL:VOL2 Y
OCR 5 MEMBER ONLINE ORCL:VOL3 Y

$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 08d94c59f0504f2cbf42e7907fcae289 (ORCL:VOL1) [OCR]
2. ONLINE 3148adb0e08b4faebf2ae639f3d9be44 (ORCL:VOL2) [OCR]
3. ONLINE 98619823fd614fd6bfe1377a64bd05de (ORCL:VOL3) [OCR]
Located 3 voting disk(s).

 

2) Format the new disks for the OCR disk group.


$ sudo oracleasm createdisk OCR1 /dev/mapper/3600a098041766a6a6b5d453733417236p1
Writing disk header: done
Instantiating disk: done

$ sudo oracleasm createdisk OCR2 /dev/mapper/3600a098041766a6a6b5d453733417237p1
Writing disk header: done
Instantiating disk: done

$ sudo oracleasm createdisk OCR3 /dev/mapper/3600a098041766a6a6b5d453733417238p1
Writing disk header: done
Instantiating disk: done

$ ls -lhtr /dev/oracleasm/disks/OCR*
brw-rw---- 1 grid asmdba 252, 54 Jan 28 11:02 /dev/oracleasm/disks/OCR1
brw-rw---- 1 grid asmdba 252, 57 Jan 28 11:05 /dev/oracleasm/disks/OCR2
brw-rw---- 1 grid asmdba 252, 59 Jan 28 11:05 /dev/oracleasm/disks/OCR3

 

3) On the secondary server execute the scan disk command to find the new disks.


$ sudo oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "OCR1"
Instantiating disk "OCR2"
Instantiating disk "OCR3"

$ ls -lhtr /dev/oracleasm/disks/OCR*
brw-rw---- 1 grid asmdba 67, 433 Jan 28 11:07 /dev/oracleasm/disks/OCR1
brw-rw---- 1 grid asmdba 67, 449 Jan 28 11:07 /dev/oracleasm/disks/OCR2
brw-rw---- 1 grid asmdba 67, 465 Jan 28 11:07 /dev/oracleasm/disks/OCR3

After these steps the disks should be in a provisioned status.


SQL> select disk_number, header_status, mode_status, path from v$asm_disk
where header_status = 'PROVISIONED'
order by disk_number;

DISK_NUMBER HEADER_STATU MODE_ST PATH
----------- ------------ ------- -----------------
0 PROVISIONED ONLINE ORCL:OCR3
1 PROVISIONED ONLINE ORCL:OCR2
2 PROVISIONED ONLINE ORCL:OCR1

 

4) Add the disks to the OCR diskgroup.


SQL> alter diskgroup OCR add disk
'ORCL:OCR1',
'ORCL:OCR2',
'ORCL:OCR3'
REBALANCE POWER 5;

 

5) Once the rebalance operation of adding the disks is complete we can drop the original disks (check select * from v$asm_operation).


SQL> alter diskgroup OCR drop disk
OCR_0000,
OCR_0001,
OCR_0002
REBALANCE POWER 5;

Diskgroup altered.

Once the drop is complete we can see that the status of the old disks are marked as FORMER.


SQL> select disk_number, header_status, mode_status, path, voting_file 
from v$asm_disk
where header_status = 'FORMER'
order by disk_number;

DISK_NUMBER HEADER_STATU MODE_ST PATH
----------- ------------ ------- ----------------------
18 FORMER ONLINE ORCL:VOL2
34 FORMER ONLINE ORCL:VOL3
38 FORMER ONLINE ORCL:VOL1

Now we can see that the new OCR disks have been marked as voting files and when we query css we can see the new location.


SQL> select adg.name, ad.disk_number, ad.header_status, ad.mode_status, 
ad.path, ad.voting_file
from v$asm_diskgroup adg, v$asm_disk ad
where ad.voting_file='Y'
and adg.group_number = ad.group_number
order by ad.disk_number;

NAME DISK_NUMBER HEADER_STATU MODE_ST PATH V
-------- ----------- ------------ ------- ---------------------- -
OCR 3 MEMBER ONLINE ORCL:OCR1 Y
OCR 4 MEMBER ONLINE ORCL:OCR2 Y
OCR 5 MEMBER ONLINE ORCL:OCR3 Y


$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 3a874d1862cc4fdebf15989351c16ed8 (ORCL:OCR1) [OCR]
2. ONLINE 06067e76c53a4f3dbf9447116b5ca066 (ORCL:OCR2) [OCR]
3. ONLINE 70be6f5bfe5d4fc1bf7fd55e09e2c69a (ORCL:OCR3) [OCR]

 

As has been demonstrated, with ASM we can easily migrate our OCR disks to a new set of disks on a new SAN.

 

Leave a Comment

Your email address will not be published. Required fields are marked *