Directory

As in other file systems, an Oracle ASM directory is a container for files, and an Oracle ASM directory can be part of a tree structure of other directories. The fully qualified file name represents a hierarchy of directories in which the plus sign (+) represents the root directory. In each disk group, Oracle ASM automatically creates a directory hierarchy that corresponds to the structure of the fully qualified file names in the disk group. The directories in this hierarchy are known as system-generated directories.

ASMCMD enables you to move up and down in this directory hierarchy with the cd (change directory) command. The ASMCMD ls (list directory) command lists the contents of the current directory, while the pwd command prints the name of the current directory.

When you start ASMCMD, the current directory is set to root (+). For an Oracle ASM instance with two disk groups, for example, data and fra, entering an ls command with the root directory as the current directory produces the following output:

ASMCMD> ls
data/
fra/

The following example demonstrates navigating the Oracle ASM directory tree (refer to the fully qualified file name shown previously):

ASMCMD> cd +data/orcl/CONTROLFILE
ASMCMD> ls
Current.256.541956473
Current.257.541956475

You can create your own directories as subdirectories of the system-generated directories using the ASMCMD mkdir command. The directories that you create can have subdirectories, and you can navigate the hierarchy of both system-generated directories and user-created directories with the cd command.

The following example creates the directory mydir under orcl in the disk group data:

ASMCMD> mkdir +data/orcl/mydir

Note:

The directory orcl is a system-generated directory. The contents of data represent the contents of disk group data.

If you start ASMCMD with the -p flag, then ASMCMD shows the current directory as part of its prompt. See "Including the Current Directory in the ASMCMD Prompt".

ASMCMD [+] > cd data/orcl
ASMCMD [+data/orcl] >

ASMCMD retains the case of the directory that you entered.