ASMCMD is a comman-line utility that helps us to view,manage,manipulate,perform search,display space utilization of files and directories within ASM disk groups.
Can ASMCMD be used to manipulate the disks in a disk group?
No. We can’t use ASMCMD to manipulate disks in a disk group. Manipulation includes operations such as addition and deletion of disks in a disk group/creating and dropping of disk groups. We can use SQL commands for that purpose.
What is a system-generated filename?
A system-generated file name is also called as fully qualified filename.
Every file created in ASM gets this system-generated name.
This is same as the complete path name in normal file system.(say $ORACLE_HOME=/u01/app/product/oracle/…)
Does fully qualified filename/system generated filename follow any standard?
Yes.Fully qualified filename follows the following standard:
In this example,
dgroup6 – diskgroup
sample – database
CONTROLFILE – type of file
current – file type tag
256 – file number
541952343 – incarnation
ASMCMD supports only forward slash().
Filenames are not case sensitive.
What is an ASM directory?
An ASM directory is a container of files.It is same as directories in file system.An ASM directory is autogenerated.A plus sign(+) represents a root directory.A fully qualifiedname or a system-generated name represents a hierarchy of directories.
An ASM automatically generates directories for files in fully qualified name and these directories are called as system-generated directories.
Following ASM commands can be used to manage these directories:
cd – move up and down between these directories
pwd – prints the name of the current directory
ls – lists the contents of the current directory
mkdir – We can create our own directories as sub-directories of system-generated directories(Note:ALTER DISKGROUP command can be used for the same purpose)
mkalias – create file alias
An ASM directory can be a part of the tree structure of other directories.
What is the use of -p option of ASMCMD?
We can start ASMCMD with -p option(ASMCMD -p) to include current directory as a part of ASMCMD prompt.
What is an alias?
Aliases are filenames that are pointers or references to system-generated filenames.They are user-friendly and are same as symbolic names in UNIX/Linux.They are used to simplify filename administration.Following commands can be used to create aliases:
mkalias,ALTER DISKGROUP with ADD ALIAS clause :
ALTER DISKGROUP dgroup1 ADD ALIAS ‘(aliasname)’
FOR ‘(system-generated filename of file)’;
We can create alias:
1) At system-generated subdirectory
2) At user-generated subdirectory
3) At disk group level
An alias name has at minimum diskgroup as a part of its filename.
To get the system-generated file name and its alias use the following ASMCMD command:
What is the difference between absolute path and relative path?
An absolute path is the system-generated filename that starts from the name of a diskgroup(+).A relative pathname specifies path relative to present working directory.Say a user is in diskgroup(+dgroup1),the relative path can be sample/CTLFILE/CURRENT.123.2345678.
What is a pseudo-directory?
A pseudo-directory is a name that can be specified along with the cd command. They are:
. – current working directory (single-dot)
.. – parent directory of the current directory(two dots without space)
What is a wildcard character?
The characters ‘*’ and ‘%’ are referred to as wildcard characters that match zero or more characters within an absolute or relative path ,which saves typing of full directory or filename.Both these characters behave identically.ASMCMD commands that accept wildcard characters are cd, du, find, ls, lsdsk, and rm.