Database Reference
In-Depth Information
ASMCMD Utility
To use the ASMCMD utility, you need to log in as an OS user such as a grid user in SYSDBA group and set the
ORACLE_SID and ORACLE_HOME environment variables:
$ env | grep ORA
ORACLE_SID=+ASM1
ORACLE_HOME=/u01/app/12.1.0/grid
Get into the ASMCMD utility by running the OS command 'asmcmd' to connect to the ASM instance.
[grid@k2r720n1 ~]$ asmcmd
ASMCMD>
Then you can run the ASMCMD commands in the interactive mode from the ASMCMD> prompt.
ASMCMD> du
Used_MB Mirror_used_MB
1036439 1036439
Most ASMCMD commands are similar to Linux file system commands, such as ls, cd, mkdir, pwd, rm, etc. You
can type “help” to get a list of ASMCMD commands. The ASMCMD utility can also be used in non-interactive mode.
In non-interactive mode, you can run a single asmcmd command with the ASMCMD utility.
[grid@k2r720n1 ~]$ asmcmd ls
Or put a series of ASMCMD commands in a command file like this test.cmd file:
[grid@k2r720n1 ~]$ cat test.cmd
ls
pwd
du
And execute this command file using the ASMCMD utility
[grid@k2r720n1 ~]$ asmcmd <test.cmd
ASMCMD> DATA/
VOCR/
ASMCMD> +
ASMCMD> Used_MB Mirror_used_MB
1036439 1036439
ASM File System
We can use the ASMCMD utility to examine the ASM file system structure. When you enter the ASMCMD utility, you
are at the very top of the ASM file system marked as “+,” which is similar to “/” on the Linux file system. From the top,
you can see all the diskgroups in ASM which are subdirectories under “+” and navigate the file system directory down
using the cd command:
[grid@k2r720n1 ~]$ asmcmd
ASMCMD> pwd
+
 
Search WWH ::




Custom Search