Oracle ASM Day-to-Day Operations – ASMCMD, Oracle ASMLib and SQL*Plus
Oracle ASM administration involves several tools depending on the task being performed. For day-to-day DBA activities, I commonly use ASMCMD, Oracle ASMLib (oracleasm), and SQL*Plus connected as SYSASM.
I put together a collection of frequently used ASM commands that can serve as a quick reference when managing ASM environments.
The complete command reference is available on GitHub:
GitHub: Oracle ASM Day-to-Day Operations
What Does This Reference Cover?
The commands are organized into three main sections.
1. ASMCMD – Everyday ASM Administration
asmcmd provides a command-line interface for working with ASM disk groups and files.
The reference includes commonly used commands for:
- Checking the ASM version
- Listing disk groups, disks, and ASM files
- Navigating ASM directories
- Checking space usage
- Searching for files
- Creating and removing directories
- Monitoring ASM disk I/O
- Mounting and unmounting disk groups
It also includes examples of using ASMCMD in both interactive and non-interactive modes, which can be useful when incorporating ASM commands into shell scripts.
2. Oracle ASMLib – ASM Disk Management
The oracleasm utility is useful when managing ASM disks at the operating-system level.
The reference includes commands for:
- Configuring Oracle ASMLib
- Starting and stopping the Oracle ASMLib service
- Checking ASMLib status
- Listing ASM disks
- Creating and deleting ASM disks
- Querying disk labels
- Renaming ASM disks
- Scanning for newly created or removed disks
For RAC environments, it also notes the common practice of creating the ASM disk on one node and running oracleasm scandisks on the remaining nodes so they can discover it.
3. SQL*Plus as SYSASM – Disk Group Administration
For ASM configuration and disk group operations, SQL*Plus connected with the SYSASM privilege provides the greatest level of control.
The reference includes examples for:
- Checking ASM instance status
- Reviewing disk group capacity
- Creating disk groups with External, Normal, and High redundancy
- Adding disks to existing disk groups
- Dropping disks
- Controlling ASM rebalance power
- Monitoring rebalance operations
- Dropping disk groups
For example, the reference includes commands to monitor active ASM rebalance operations through V$ASM_OPERATION.
ASM Environment Setup
One practice I follow is maintaining separate Oracle environment files for ASM and database administration.
For example:
vi asm.env
export ORACLE_SID=+ASM1
export ORACLE_HOME=/u01/app/oracle/19.3.0/grid/bin
The ASM environment can then be loaded before running ASM administration commands:
. asm.env
Keeping separate ASM and database environment files helps avoid accidentally running commands against the wrong Oracle home or instance.
GitHub Command Reference
Rather than duplicating all the commands in this article, I have kept the complete command collection on GitHub.
You can find the full examples here:
View Oracle ASM Day-to-Day Operations on GitHub
The repository includes practical examples covering ASMCMD, Oracle ASMLib, disk group administration, disk operations, and ASM rebalance monitoring.
Conclusion
Oracle ASM administration usually requires switching between different tools depending on the task.
For most day-to-day activities:
ASMCMD is convenient for navigating and inspecting ASM storage, Oracle ASMLib helps manage ASM disks at the operating-system level, and SQL*Plus as SYSASM provides full control over ASM disk groups and rebalance operations.
This command collection is intended to serve as a simple reference that I can return to whenever performing common ASM administration activities.
GitHub: Oracle ASM Day-to-Day Operations
Nice Article