What is ASMCMD Utility?
ASMCMD is a command-line utility that you can use to easily view and manipulate files and directories within Automatic Storage Management (ASM) disk groups. It can list the contents of disk groups, perform searches, create and remove directories and aliases, display space utilization, and more.
ASMCMD is a command line utility for managing files and directories in ASM (Automatic Storage Management ) disk-groups. 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:
Note:
You cannot use ASMCMD to create or drop disk groups or to add or drop disks in a disk group. For these operations, you must use SQL commands.
Summary of ASM Commands
Command | Description | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cd | Changes the current directory to the specified directory. | ||||||||||||||||||||||||||||||||||||||||||
du | Displays the total disk space occupied by ASM files in the specified ASM directory and all its subdirectories, recursively. | ||||||||||||||||||||||||||||||||||||||||||
exit | Exits ASMCMD. | ||||||||||||||||||||||||||||||||||||||||||
find | Lists the paths of all occurrences of the specified name (with wildcards) under the specified directory. | ||||||||||||||||||||||||||||||||||||||||||
help | Displays the syntax and description of ASMCMD commands. | ||||||||||||||||||||||||||||||||||||||||||
ls | Lists the contents of an ASM directory, the attributes of the specified file, or the names and attributes of all disk groups. | ||||||||||||||||||||||||||||||||||||||||||
lsct | Lists information about current ASM clients. | ||||||||||||||||||||||||||||||||||||||||||
lsdg | Lists all disk groups and their attributes. | ||||||||||||||||||||||||||||||||||||||||||
mkalias | Creates an alias for a system-generated filename. | ||||||||||||||||||||||||||||||||||||||||||
mkdir | Creates ASM directories. | ||||||||||||||||||||||||||||||||||||||||||
pwd | Displays the path of the current ASM directory. | ||||||||||||||||||||||||||||||||||||||||||
rm | Deletes the specified ASM files or directories. | ||||||||||||||||||||||||||||||||||||||||||
rmalias | Deletes the specified alias, retaining the file that the alias points to. Summary of ASMCMD Disk group management commands
|
Preparing to Run ASMCMD
Before running ASMCMD, check the following:
To use most of the ASMCMD commands, ensure that the ASM instance is started and the ASM disk groups are mounted.
If the ASM instance is not running or if the ORACLE_SID is set incorrectly, ASMCMD will still run,
but only those commands that do not require an ASM instance will run. The commands are lsdsk, help, and exit.
If you attempt to run other ASMCMD commands, an error message displays.
Running ASMCMD in Interactive Mode
The interactive mode of the ASMCMD utility provides a shell-like environment where you are prompted to enter ASMCMD commands.
To run ASMCMD in interactive mode:
[grid@ora-prod]$ asmcmd
ASMCMD> ls -l
State Type Rebal Name
MOUNTED EXTERN N DATA/
MOUNTED EXTERN N RECO/
ASMCMD>
ASMCMD> pwd
+DATA/ora_data/19744798347947/DATAFILE
ASMCMD> ls -l
DATAFILE UNPROT COARSE OCT 26 21:00:00 Y SYSTEM.348.1009978273
DATAFILE UNPROT COARSE OCT 26 21:00:00 Y SYSTEM.354.1013346191
DATAFILE UNPROT COARSE OCT 26 21:00:00 Y SYSTEM.363.1022606279
DATAFILE UNPROT COARSE OCT 26 21:00:00 Y SYSTEM.366.1017318075
DATAFILE UNPROT COARSE OCT 26 21:00:00 Y SYSTEM.370.1019732645
DATAFILE UNPROT COARSE OCT 26 21:00:00 Y SYSTEM.374.1024834305
No comments:
Post a Comment