Create disk partitions and disk lables for ASM instance

Creating ASM disks and adding to existing diskgroups

As a root user, check for available disks :

fdisk -l
Disk /dev/vdb: 107.4 GB, 107374182400 bytes
16 heads, 63 sectors/track, 208050 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Create new partitions

fdisk /dev/vdb
Command (m for help): p
Command (m for help): n
Command action
 e extended
 p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-208050, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-208050, default 208050): +30G
Command (m for help): p
Command (m for help): n
Command action
 e extended
 p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (31-208050, default 31):
Using default value 31
Last cylinder, +cylinders or +size{K,M,G} (31-208050, default 208050): +30G
Command (m for help): w
The partition table has been altered!

Install following rpms :

kmod-oracleasm
oracleasmlib
oracleasm-support

Verify Partitions

[[email protected] product]# cat /proc/partitions
major minor #blocks name

252 0 52428800 vda
 252 1 512000 vda1
 252 2 51915776 vda2
 252 16 104857600 vdb
 252 17 15088 vdb1
 252 18 31457664 vdb2
 253 0 49848320 dm-0
 253 1 2064384 dm-1

Configure and initialize oracleasm

[[email protected] product]# 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 []: oracle
Default group to own the driver interface []: dba
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

[[email protected] product]# 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

Create ASM disks using DATA1, DATA2 labels

[[email protected] disks]# oracleasm createdisk DATA1 /dev/vdb2
Writing disk header: done
Instantiating disk: done

[[email protected] ContentsXML]# oracleasm createdisk DATA2 /dev/vdb1
Writing disk header: done
Instantiating disk: done

[[email protected] ContentsXML]# oracleasm listdisks
DATA1
DATA2

[[email protected] ContentsXML]# cd /dev/oracleasm/disks/
[[email protected] disks]# ls
DATA1 DATA2

Login to ASM instance, assign the disks to existing diskgroups

sqlplus / as sysasm

SQL> ALTER DISKGROUP DATA ADD DISK 'ORCL:DATA2';
Diskgroup altered.

SQL> col PATH for a40
SQL> select GROUP_NUMBER,DISK_NUMBER,REDUNDANCY,TOTAL_MB,FREE_MB,NAME,LABEL,MOUNT_DATE,PATH from v$asm_disk;
GROUP_NUMBER DISK_NUMBER REDUNDA TOTAL_MB FREE_MB NAME LABEL MOUNT_DAT PATH
------------ ----------- ------- ---------- ---------- ------------------------------ ------------------------------- --------- ----------------------------------------
 1 0 UNKNOWN 30720 29526 DATA1 DATA1 12-APR-17 ORCL:DATA1
 1 1 UNKNOWN 14 10 DATA2 DATA2 14-APR-17 ORCL:DATA2

SQL> select GROUP_NUMBER,NAME,BLOCK_SIZE,STATE,TOTAL_MB,FREE_MB from v$asm_diskgroup;
GROUP_NUMBER NAME BLOCK_SIZE STATE TOTAL_MB FREE_MB
------------ ------------------------------ ---------- ----------- ---------- ----------
 1 DATA 4096 MOUNTED 30734 29536

 

One thought to “Create disk partitions and disk lables for ASM instance”

  1. If some one needs to be updated with newest technologies then he must be visit this website and be up to date all the time.

Leave a Reply

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