Common Oracle ASM commands
In the Oracle RAC environment, run asmcmd with the grid account to enter the asm command mode, for example:
[Grid @ oradb-node1 ~] $ Asmcmd
ASMCMD>
ASMCMD> du // display all disk space occupied by the ASM file in the specified ASM directory
ASMCMD> ls-ls // list the content, attributes, and disk space in the ASM directory.
ASMCMD> pwd // view the current path
ASMCMD> cd ../DATA // switch directory
ASMCMD> lsct // list information of the current ASM Client
ASMCMD> lsdg // list all disk groups and their attributes
ASMCMD> lsof // List Data File Information
ASMCMD> lsdsk // list disk Information
ASMCMD> rm-f *. dbf // delete all files with the. dbf extension.
ASMCMD> rm-fr orcldemo // Delete the current orcldemo directory
The root path of the ASM disk is "+" instead of "/". The following is a demonstration operation:
ASMCMD> cd datadg/demo
ASMCMD> pwd
+ Datadg/demo // The current path is + datadg/gd
ASMCMD> cd + // switch to the root path of the ASM Disk
ASMCMD> pwd
+ // The current path is the root path +
You can also choose not to enter the ASM command mode, such:
[Grid @ oradb-node1 ~] $ Asmcmd ls-ls // you can run the following command to view the usage of the ASM Disk: