ASMCMD Command Guide

ADVERTISEMENT

ASMCMD (Automatic Storage Management Command-Line Interface) is used to manage ASM resources like disk groups, disks, and instances. Below are essential ASMCMD commands for your reference.

General Operations

TaskCommand(s)Example
List all disk groupsASMCMD> lsdgExample: ASMCMD> lsdg
Include dismounted disk groupsASMCMD> lsdg --discoveryLists both mounted and dismounted disk groups.
List disk groups across nodesASMCMD> lsdg -g --discoveryLists disk groups from all nodes in a cluster.
List ASM disksASMCMD> lsdsk -kExample: ASMCMD> lsdsk -k lists all ASM disks with their total and free space.

Disk and Disk Group Operations

TaskCommand(s)Example
List disks of a specific disk groupASMCMD> lsdsk -k -G <group_name>Example: ASMCMD> lsdsk -k -G DATA_W3BUDDY (disks in the DATA_W3BUDDY group).
List disk creation datesASMCMD> lsdsk -t -G <group_name>Example: ASMCMD> lsdsk -t -G DATA_W3BUDDY.
List only candidate disksASMCMD> lsdsk --candidate -kDisplays unassigned disks eligible for ASM.
Unmount all disk groupsASMCMD> umount -aExample: ASMCMD> umount -a.
Unmount a specific disk groupASMCMD> umount <group_name>Example: ASMCMD> umount DATA_W3BUDDY.
Mount all disk groupsASMCMD> mount -aExample: ASMCMD> mount -a.
Mount a specific disk groupASMCMD> mount <group_name>Example: ASMCMD> mount DATA_W3BUDDY.

ASM Disk Group Attributes

TaskCommand(s)Example
List all attributes of disk groupsASMCMD> lsattr -lmExample: ASMCMD> lsattr -lm.
List attributes for a specific groupASMCMD> lsattr -lm -G <group_name>Example: ASMCMD> lsattr -lm -G DATA_W3BUDDY.
List attributes matching a patternASMCMD> lsattr -lm %<pattern>%Example: ASMCMD> lsattr -lm %au_size% (filters attributes related to allocation unit sizes).

ASM Disk Group Rebalancing

TaskCommand(s)Example
Rebalance a disk groupASMCMD> rebal --power <limit> <group_name>Example: ASMCMD> rebal --power 8 DATA_W3BUDDY.
Monitor rebalance progressASMCMD> lsopExample: ASMCMD> lsop.

Password File and Template Information

TaskCommand(s)Example
Get password file of a databaseASMCMD> pwget --dbuniquename <db_name>Example: ASMCMD> pwget --dbuniquename W3BUDDYDB.
Get password file of ASMASMCMD> pwget --asmExample: ASMCMD> pwget --asm.
Get ASM template info of a disk groupASMCMD> lstmpl -l -G <group_name>Example: ASMCMD> lstmpl -l -G DATA_W3BUDDY.

ASM Cluster and Configuration

TaskCommand(s)Example
Check if Flex ASM is enabledASMCMD> showclustermodeExample: ASMCMD> showclustermode.
Check cluster stateASMCMD> showclusterstateExample: ASMCMD> showclusterstate.
View ASM versionASMCMD> showversionExample: ASMCMD> showversion.
Get ASM SPFILE locationASMCMD> spgetExample: ASMCMD> spget.
Backup ASM SPFILEASMCMD> spbackup <source_spfile> <destination_path>Example: ASMCMD> spbackup +MGMT/W3BUDDY-CLUSTER/ASMPARAMETERFILE /home/oracle/asmspfile_w3buddy.ora.

Advanced Operations

TaskCommand(s)Example
List open files of a disk groupASMCMD> lsof -G <group_name>Example: ASMCMD> lsof -G DATA_W3BUDDY.
List open files of a databaseASMCMD> lsof --dbname <db_name>Example: ASMCMD> lsof --dbname W3BUDDYDB.
Check filter driver stateASMCMD> afd_stateExample: ASMCMD> afd_state.
List filter driver disks (if enabled)ASMCMD> afd_lsdskExample: ASMCMD> afd_lsdsk.

ADVERTISEMENT

You might like

Leave a Reply

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