In Linux is quite easy to mark disks for ASM use, because of asmlib library asmlib that helps to label the disk for asm candidate recognision. But this library isn't available in Solaris platforms, and so there aren't any libraries similar to that. Unfortunately, the disk preparation has to be done manually.
This is how it's done with a Linux OS RHEL using asmlib.
[root@host Server]# /etc/init.d/oracleasm createdisk ASMDISK1_DATA /dev/mapper/racdb_asm1
Marking disk "ASMDISK1_DATA" as an ASM disk: [ OK ]
[root@host Server]# /etc/init.d/oracleasm createdisk ASMDISK1_FRA /dev/mapper/racdb_asm2
Marking disk "ASMDISK1_FRA" as an ASM disk: [ OK ]
[root@cun0401 Server]# /etc/init.d/oracleasm listdisks
ASMDISK1_DATA
ASMDISK1_FRA
1:
2:
3:
4:
5:
6:
7:
8:
9:
Select allOpen in new window
Easy, right?
This is how it has to be done in Solaris.
In a first step, the disks have to be available and visible, and the owner has to be oracle:oinstall. For Oracle11g Grid Infrastructure (ASM plus RAC) it's recommended the owner to be grid:oinstall, but, anyway, please ensure the devices owner isn't root (or other).
STEP 1
As root user, execute the format command in the os prompt.
root@host:~$ format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t0d0
/pci@0,600000/pci@0/pci@8/pci@0/scsi@1/sd@0,0
1. c0t1d0 Solaris
/pci@0,600000/pci@0/pci@8/pci@0/scsi@1/sd@1,0
2. c2t600A0B800029B03400001B474BE28D9Bd0
/scsi_vhci/ssd@g600a0b800029b03400001b474be28d9b
3. c2t600A0B800029B034000022A64DB65A53d0
/scsi_vhci/ssd@g600a0b800029b034000022a64db65a53
4. c2t600A0B800029B034000020104C43B3C1d0
/scsi_vhci/ssd@g600a0b800029b034000020104c43b3c1
5. c2t600A0B800029B034000021104C612E6Dd0
/scsi_vhci/ssd@g600a0b800029b034000021104c612e6d
6. c2t600A0B8000269A3200007F3F4BE25284d0
/scsi_vhci/ssd@g600a0b8000269a3200007f3f4be25284
7. c2t600A0B8000269A32000084B24CC8D1D5d0
/scsi_vhci/ssd@g600a0b8000269a32000084b24cc8d1d5
8. c2t600A0B8000269A32000084C74CD0F3D2d0
/scsi_vhci/ssd@g600a0b8000269a32000084c74cd0f3d2
9. c2t600A0B8000269A320000802A4BF3820Ad0
/scsi_vhci/ssd@g600a0b8000269a320000802a4bf3820a
10. c2t600A0B8000269A320000834C4C439596d0
/scsi_vhci/ssd@g600a0b8000269a320000834c4c439596
11. c2t600A0B8000269A320000834F4C43960Fd0
/scsi_vhci/ssd@g600a0b8000269a320000834f4c43960f
Specify disk (enter its number): 3
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:
Select allOpen in new window
Assuming the 3th disk is the new disk going to be added to ASM.
STEP 2
After that, format will ask about the partition base going to be updated. We will choose 1 to partition all free hog.
Select partitioning base:
0. Current partition table (original)
1. All Free Hog
Choose base (enter number) [0]? 1
Part Tag Flag Cylinders Size Blocks
0 root wm 0 0 (0/0/0) 0
1 swap wu 0 0 (0/0/0) 0
2 backup wu 0 - 51197 100.00GB (51198/0/0) 209707008
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
Do you wish to continue creating a new partition table based on above table[yes]? Yes
Free Hog partition[6]? 7
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
Select allOpen in new window
The new partition will be created as the above example, and the free space will be asigned to the last partition unasigned in the table.
STEP 3
After that, the system will ask us about the size for each partition and we will set up 500Mb for the main partition 0 to allow ASM to write the labeling, and the rest of the free space for the last partition usable (the 6th one in this example).
Enter size of partition '0' [0b, 0c, 0.00mb, 0.00gb]: 500mb
Enter size of partition '1' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '3' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '4' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '5' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '6' [0b, 0c, 0.00mb, 0.00gb]: 99.50gb
1:
2:
3:
4:
5:
6:
Select allOpen in new window
The system will ask us for confirmation in the defined labeling, and save the partition table. We may use the name 'ASM' for a future use.
Once labeled the disk, the option 'q' will exit from the partition menu and bring us back to format menu.
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 249 500.00MB (250/0/0) 1024000
1 swap wu 0 0 (0/0/0) 0
2 backup wu 0 - 51197 100.00GB (51198/0/0) 209707008
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 250 - 51193 99.50GB (50944/0/0) 208666624
7 unassigned wm 51194 - 51197 8.00MB (4/0/0) 16384
Okay to make this the current partition table[yes]? Yes
Enter table name (remember quotes): "asm"
Ready to label disk, continue? yes
partition> q
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
Select allOpen in new window
STEP 4
We may also verify it to ensure everything's in the right place.
STEP 5
After verifying the disk labeling, we may quit from the format comand pressing 'q' and the disks will be ready to be visible as candidate disks in the asm console.
-bash-3.00$ sqlplus / as sysasm
SQL> select path, name from v$asm_disk;
PATH NAME
-------------------------------------------------- ------------------------------
/dev/did/rdsk/d9s6
/dev/did/rdsk/d9s7
/dev/did/rdsk/d9
/dev/did/rdsk/d4s6 RECOVERY_0000
/dev/did/rdsk/d22s6 DATOS_0001
/dev/did/rdsk/d18s6 OCRVOTING_0000
/dev/did/rdsk/d19s6 OCRVOTING_0001
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
Select allOpen in new window
Where /dev/did/rdsk/d9s6 /dev/did/rdsk/d9s7 and /dev/did/rdsk/d9 are the new disks, ready for the diskgroup creation.
SQL> alter diskgroup DATOS add disk ‘/dev/did/rdsk/d9s6’;
SQL> select path, name from v$asm_disk;
PATH NAME
-------------------------------------------------- ------------------------------
/dev/did/rdsk/d9s7
/dev/did/rdsk/d9
/dev/did/rdsk/d4s6 RECOVERY_0000
/dev/did/rdsk/d9s6 DATOS_0000
/dev/did/rdsk/d22s6 DATOS_0001
/dev/did/rdsk/d18s6 OCRVOTING_0000
/dev/did/rdsk/d19s6 OCRVOTING_0001
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
Select allOpen in new window
The new disk d9s6 has been added successfully to asm diskgroup "datos" as 'DATOS_0001' asm disk.