When you run an ASMCMD command that accepts a file name or directory name as an argument, you can use the name as either an absolute path or a relative path.
An absolute path refers to the full path of a file or directory. An absolute path begins with a plus sign (+) followed by a disk group name, followed by subsequent directories in the directory tree. The absolute path includes directories until the file or directory of interest is reached. A complete system-generated file name, otherwise known as the fully qualified file name, is an example of an absolute path to a file.
Using an absolute path enables the command to access the file or directory regardless of where the current directory is set. The following rm
command uses an absolute path for the file name:
ASMCMD [+] > rm
+data/orcl/datafile/users.259.555341963
The following cd
command uses an absolute path to the directory.
ASMCMD [+data/mydir] > cd +data/orcl/CONTROLFILE
A relative path includes only the part of the file name or directory name that is not part of the current directory. That is, the path to the file or directory is relative to the current directory.
In the following example, the rm
command operates on the file undotbs1.272.557429239
, which in this case is a relative path. ASMCMD appends the current directory to the command argument to obtain the absolute path to the file. In this example this is +data/orcl/DATAFILE/undotbs1.272.557429239
.
ASMCMD [+] > cd +data ASMCMD [+data] > cd orcl/DATAFILE ASMCMD [+data/orcl/DATAFILE] > ls EXAMPLE.269.555342243 SYSAUX.257.555341961 SYSTEM.256.555341961 UNDOTBS1.258.555341963 UNDOTBS1.272.557429239 USERS.259.555341963 ASMCMD [+data/orcl/DATAFILE] > rm undotbs1.272.557429239
Paths to directories can also be relative. You can go up or down the hierarchy of the current directory tree branch by providing a directory argument to the cd
command whose path is relative to the current directory.
In addition, you can use the pseudo-directories ".
" and "..
" rather than a directory name. The ".
" pseudo-directory is the current directory. The "..
" pseudo-directory is the parent directory of the current directory.
The following example demonstrates how to use relative directory paths and pseudo-directories:
ASMCMD [+data/orcl] > cd DATAFILE ASMCMD [+data/orcl/DATAFILE] >cd .. ASMCMD [+data/orcl] >