In the ASM instance, all files stored in the ASM Disk group are inaccessible to the operating system commands and therefore cannot be manipulated using regular commands to manipulate the files on the ASM disk. Fortunately, we have asmcmd tools to do this work in lieu of operating system commands. The Asmcmd tool provides common commands similar to the operating system, such as LS, Du, FIND,CD, RM, mkdir, and so on. These tools make it easier to complete the management of ASM instances.
1.ASMCMD the location of the file
[Root@oradb ~]# Su-oracle
[Oracle@oradb ~]$ which asmcmd
/u01/oracle/10g/bin/asmcmd
2. Start Asmcmd
[oracle@oradb ~]$ Export Oracle_sid=+asm--set ORACLE_SID environment variables before startup
[Oracle@oradb ~]$ Asmcmd
Asmcmd> Help
Asmcmd [-p] [command]-this way you can complete the function directly without having to go to the Asmcmd prompt
The environment variables Oracle_home and ORACLE_SID determine the instance to which the program connects, and Asmcmd esta Blishes a bequeath connection to it, in the same manner as a sqlplus/as SYSDBA. The user must is a member of the SYSDBA group. Specifying THE-P option allows the current directory to is displayed in the command prompt, like so:
Asmcmd [+datafile/orcl/controlfile] >
[command] Specifies one of the following commands, along with its parameters.
Type ' help [command] ' to ' get help on a specific asmcmd command.
--At the asmcmd command prompt, enter help [command] to display the command assistance information
Commands
--------
Cd
Du
Find
Help
Ls
Lsct
Lsdg
Mkalias
Mkdir
Pwd
Rm
Rmalias
3. Specific usage
[Oracle@oradb ~]$ asmcmd-p ls-l--no need to go to the Asmcmd command prompt to complete the appropriate functions
State Type Rebal Unbal Name
Mounted NORMAL n N dg1/
Mounted NORMAL n N dg2/
Mounted EXTERN n N rev/
Asmcmd> ls-l--View basic information about a disk group
State Type Rebal Unbal Name
Mounted NORMAL n N dg1/
Mounted NORMAL n N dg2/
Mounted EXTERN n N rev/
Asmcmd> ls-s--View disk group details such as disk size, free space, sector size, etc.
Sector block AU total_mb free_mb req_mir_free_mb usable_file_mb offline_disks Name
4096 1048576 3058 1498 0 749 0 dg1/
4096 1048576 0 0 dg2/
4096 1048576 3074 2949 0 2949 0 rev/
Asmcmd> du-View the capacity used by the current directory disk
USED_MB MIRROR_USED_MB
804 1541