Friday, March 7, 2014

Accessing ASM Files by Using ASMCMD

ASMCMD is a command-line utility that you can use to view and manipulate files and directories within ASM disk groups. ASMCMD can list the contents of disk groups, perform searches, create and remove directories and aliases, display space utilization, and more.

The ASMCMD commands include many commands that perform the same basic functions as their UNIX/Linux counterparts. These include: cd, cp, du, find, ls, mkdir, pwd, and rm. There are additional commands that perform ASM-specific functions.

[grid@host01 ~]$ asmcmd
ASMCMD> cd +DATA/racdb/DATAFILE
ASMCMD> ls -l SYS*
Type Redund Striped Time Sys Name
DATAFILE MIRROR COARSE AUG 03 16:00:00 Y SYSAUX.257.692926339

DATAFILE MIRROR COARSE AUG 03 16:00:00 Y SYSTEM.256.692926339
ASMCMD> cd ..
ASMCMD> pwd
+DATA/racdb/DATAFILE
ASMCMD> exit

When you invoke the ASMCMD utility from the Grid software $ORACLE_HOME, the utility attempts to connect AS SYSASM. The ASMCMD utility attempts to connect AS SYSASM, so the user that invokes ASMCMD must be a member of the OSASM group. When connecting from a $ORACLE_HOME database, ASMCMD attempts to connect AS SYSDBA.


OS user must be a member of the OSDBA group for ASM. Set the ORACLE_SID environment variable to the local name of the database instance. Any OS user who is a member of the appropriate OS group may connect with ASMCMD to a local instance, and specify the connect role with the -a option.

No comments:

Post a Comment