Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 E-mail Us
 Oracle Articles
New Oracle Articles

 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog

 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Oracle Support

 SQL Tuning

 Oracle UNIX
 Oracle Linux
 Remote s
 Remote plans
 Application Server

 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S


 Consulting Staff
 Consulting Prices
 Help Wanted!


 Oracle Posters
 Oracle Books

 Oracle Scripts

Don Burleson Blog 








asmcmd tips

Oracle Database Tips by Donald Burleson

ASMCMD  is a command line utility for managing files and directories in ASM (Automatic Storage Management ) diskgroups. It offers Unix-style filesystem commands for managing ASM directories and files. Prior to Oracle 10gR2, ASM had to be administered via OEM or SQL statements while connected to a special ASM instance.
Note that ASMCMD cannot be used to create or drop diskgroups, or to add or drop disks in a disk group. These ASM administrative tasks must be accomplished via SQL commands.
ASMCMD offers two modes of operation: interactive and non-interactive. Interactive mode provides a shell-like environment for executing ASMCMD commands. It resembles how SQL*Plus interactive mode works and looks like this:

Whereas non-interactive mode works much like the srvctl  and lsnsctl XE "lsnsctl"  commands, that is that one provides the base ASMCMD  command, its command and any command parameters and all on the operating system command line, like this:
C:\Temp>asmcmd ls -1
The ASMCMD  commands and their parameters are very Unix-like in nature, so they will look quite familiar to those on UNIX.





Change directory


Copy file


Disk space used by a directory and its subdirectories


Exit the utility


Locate the path for all occurrences of the specified filename


Displays command assistance


List the contents of a directory


List info about ASM clients


List all disk groups and their attributes


List all physical disks visible to ASM


Create a backup of the mounted diskgroups


Restore the diskgroups from a backup


Create an alias for a system generated filename


Create directory


Print working directory (i.e. list current directory location)


Repair a range of blocks on a disk


Remove (i.e. delete) the specified files or directories


Remove (i.e. delete) the specified alias

Table 6.173:  ASMCMD Key Commands


When making the decision to bypass the JFS buffers with raw devices, the problem has always been the management of the "raw" disk files, which are read directly by Oracle, into Oracle data buffers, bypassing the OS overhead.  For details on using ASM, I recommend the book "Oracle RAC and Grid" by Madhu Tumma and Mile Ault.

Oracle introduced Automatic Storage Management (ASM) to simplify Oracle data management, enforce the SAME (Stripe And Mirror Everywhere, RAID10), and provide a platform for file sharing in RAC and Grid computing.

Managing raw datafiles with asmcmd

The 10g release 2 has introduced an ASM command line utility dibbed "asmcmd" to act as a DMCL (device media control language), to manage the interface between the ASM logical data view and the physical disk files.

The asmcmd interface is launched by first setting the environment for +ASM, then calling it with the asmcmd command. The idea of this tool is to make administering the ASM files similar to administering standard operating system files.

Invoking asmcmd

The asmcmd utility is located in $ORACLE_HOME/bin/asmcmd and it should already be pathed into your UNIX/Linux environment.  We start asmcmd by setting $ORACLE_SID to the ASM instance with +ASM, and we can them execute asmcmd.  You can use the "?" or "help" command to display all asmcmd commands:

root> export ORACLE_SID=+ASM
root> asmcmd
ASMCMD> help

You can run the list data groups (lsdg) ASM command from a bash shell script to quickly see the disk space usage:

. /home/oracle/set_oraenv
echo "Check Space on "$sid
export ORACLE_SID=$sid
asmcmd << EOF

This is an example of an asmcmd session:

Trying out the asmcmd utility.

asmcmd command examples

The asmcmd command line interface is very similar to standard UNIX/Linux commands, but it only manages files at the OS level. 

The asmcmd utility supports all common Linux commands:

ASMCMD> ls -alt -- list directory contents

ASMCMD> cd -- change directory

ASMCMD> mkdir -- create (make)directory

ASMCMD> du -- display directory space

ASMCMD> find -- standard UNIX find command

ASMCMD> rm -- remove file/directory

ASMCMD> lsdg -- list diskgroups

ASMCMD> pwd -- display current directory

Plus, we see some Oracle-only asmcmd commands:

ASMCMD> lsct -- list all connected Oracle instances

For a list of common Linux commands for Oracle, see the Oracle Linux command poster or Jon Emmon's book "Oracle Shell Scripting".

Using asmcmd with ASM commands

For internal operations against the ASM database you need other commands such as "alter diskgroup".

Deleting an orphaned file from the ASM instance.

You can also use asmcmd to delete files using the standard rm command:

Deleting an orphaned file using asmcmd.


Set asmcmd prompt display

You can invoke asmcmd with the -p option to display the current path, very similar to the UNIX/Linux.

export PS1


asmcmd command line history

The asmcmd utility does not provide a command history with the up-arrow key. With rlwrapinstalled, this can be fixed by adding the following entry to the ~oracle/.bashrc file:

    alias asmcmd='rlwrap asmcmd'




Oracle Training at Sea
oracle dba poster

Follow us on Twitter 
Oracle performance tuning software 
Oracle Linux poster


Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.