Volume Management with asmcmd

Creating Volumes with the volcreate command

 
ASMCMD> volcreate -G lobdata -s 4g vol_lob2

Note:
You can not create a mirror or high redundancy volume on an external redundant disk group.

 
ASMCMD> volcreate -G lobdata -s 4g --redundancy mirror vol_lob2
ORA-15032: not all alterations performed
ORA-15471: volume redundancy incompatible with diskgroup redundancy (DBD ERROR: OCIStmtExecute)

Displaying volume information with the volinfo command

With the -a option (and do not specify a diskgroup and volume), you will get a detailed information about every volume for every diskgroup

 
ASMCMD> volinfo -a
Diskgroup Name: DATA

         Volume Name: VOL_LOGFILE
         Volume Device: /dev/asm/vol_logfile-340
         State: ENABLED
         Size (MB): 3072
         Resize Unit (MB): 256
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /apps/oracle/acfsmounts/data_vol_logfile 

         Volume Name: VOL_RPTS
         Volume Device: /dev/asm/vol_rpts-340
         State: ENABLED
         Size (MB): 5120
         Resize Unit (MB): 256
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /apps/oracle/acfsmounts/data_vol_rpts 

Diskgroup Name: LOBDATA

         Volume Name: VOL_LOB
         Volume Device: /dev/asm/vol_lob-484
         State: ENABLED
         Size (MB): 4096
         Resize Unit (MB): 256
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /apps/oracle/acfsmounts/lobdata 

         Volume Name: VOL_LOB2
         Volume Device: /dev/asm/vol_lob2-484
         State: ENABLED
         Size (MB): 4096
         Resize Unit (MB): 256
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: 
         Mountpath: 

To display volume information for a specific diskgroup, use the -G option:

 
ASMCMD> volinfo -G lobdata -a
Diskgroup Name: LOBDATA

         Volume Name: VOL_LOB
         Volume Device: /dev/asm/vol_lob-484
         State: ENABLED
         Size (MB): 4096
         Resize Unit (MB): 256
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /apps/oracle/acfsmounts/lobdata 

         Volume Name: VOL_LOB2
         Volume Device: /dev/asm/vol_lob2-484
         State: ENABLED
         Size (MB): 4096
         Resize Unit (MB): 256
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: 
         Mountpath: 

To display volume information for a specific volume, use the -G option followed by the volume name of interest:

 
ASMCMD> volinfo -G DATA VOL_RPTS
Diskgroup Name: DATA

         Volume Name: VOL_RPTS
         Volume Device: /dev/asm/vol_rpts-340
         State: ENABLED
         Size (MB): 5120
         Resize Unit (MB): 256
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /apps/oracle/acfsmounts/data_vol_rpts 

You can reverse query based on a volume device and lookup the volume information:

ASMCMD> volinfo --show_volume /dev/asm/vol_lob2-484
vol_lob2

Likewise, you can reverse lookup the disk group information based on the volume device:

ASMCMD> volinfo --show_diskgroup /dev/asm/vol_lob2-484
lobdata

Report volume I/O statistics

ASMCMD> volstat -G data

DISKGROUP NUMBER / NAME:  1 / DATA
---------------------------------------
  VOLUME_NAME
     READS           BYTES_READ      READ_TIME       READ_ERRS       
     WRITES          BYTES_WRITTEN   WRITE_TIME      WRITE_ERRS      
  -------------------------------------------------------------
  VOL_LOGFILE
     49862           3219816448      37565           0               
     3349            167577600       80043           0               
  VOL_RPTS
     125             71168           306             0               
     10              12288           90              0   

If the –show_volume is not specified, I/O statistics for all volumes of the disk group are displayed. To display a specific volume, use the show_volume parameter as shown below:

ASMCMD>  volstat -G data --show_volume vol_logfile

DISKGROUP NUMBER / NAME:  1 / DATA
---------------------------------------
  VOLUME_NAME
     READS           BYTES_READ      READ_TIME       READ_ERRS       
     WRITES          BYTES_WRITTEN   WRITE_TIME      WRITE_ERRS      
  -------------------------------------------------------------
  VOL_LOGFILE
     49862           3219816448      37565           0               
     3349            167577600       80043           0  

Enable/Disable a volume

ASMCMD> voldisable -G lobdata vol_lob2 
ASMCMD>          
ASMCMD> volenable -G lobdata vol_lob2

ASMCMD> voldisable -G lobdata vol_lob2

Use the -a option to enable all the volumes for the disk gruop

ASMCMD> volenable -G lobdata -a

Note:
You cannot disable a volume that is currently being accessed:

ASMCMD> voldisable -G lobdata vol_lob
ORA-15032: not all alterations performed
ORA-15468: volume 'VOL_LOB' in diskgroup 'LOBDATA' is currently being accessed (DBD ERROR: OCIStmtExecute)

Resizing an existing volume
[code language='sql'] 
ASMCMD> volresize -G LOBDATA -s 5G VOL_LOB2
ASMCMD> volresize -G LOBDATA -s 2G VOL_LOB2
The volume is not ACFS and the requested size is smaller than the current size.
Data corruption may occur.
Are you sure? [y/n]: y

Note:
You cannot volresize a volume that is being accessed. I wish the error message was more accurate.

 
ASMCMD> volresize -G LOBDATA -s 5G VOL_LOB
ORA-15032: not all alterations performed
ORA-15476: resize of ACFS volume must use ACFS resize command (DBD ERROR: OCIStmtExecute)

Deleting an existing volume from a disk group

You can use the voldelete command followed by the -G option for the diskgroup followed by the volume name to drop a volume from the diskgroup

 
ASMCMD> voldelete -G lobdata VOL_LOB2

You can set attributes for volumes. The attributes that are available are:
1. --usagestring
2. --mountpath
These attributes are information only and used for informational purposes only by ASM and not used by ASM. Here's couple of examples with volset

 
[oracle@jin1 ~]$ asmcmd volset -G data --usagestring 'To Store temporary reports' VOL_RPTS
[oracle@jin1 ~]$ asmcmd volset -G data --mountpath 'We should mount this volume as /data/reports' VOL_RPTS

[oracle@jin1 ~]$ asmcmd volinfo -G data VOL_RPTS 
Diskgroup Name: DATA

         Volume Name: VOL_RPTS
         Volume Device: /dev/asm/vol_rpts-340
         State: ENABLED
         Size (MB): 5120
         Resize Unit (MB): 256
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: To Store temporary reports
         Mountpath: We should mount this volume as /data/reports 

Posted by Charles Kim, Oracle ACE

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>