Friday, March 7, 2014

ASM Directories

ASM disk groups contain a system-generated hierarchical directory structure for storing ASM files. The system-generated file name that ASM assigns to each file represents a path in this directory hierarchy. The following is an example of a system-generated file name:

+DATA/racdb/DATAFILE/SYSTEM.262.676172197

The plus sign represents the root of the ASM file system. The DATA directory is the parent directory for all files in the DATA disk group. The racdb directory is the parent directory for all files in the racdb database, and the DATAFILE directory contains all data files for the racdb database.

You can create your own directories within this hierarchy to store aliases that you create. Thus, in addition to having user-friendly alias names for ASM files, you can have user-friendly paths to those names. For example, the following user-defined directory might be used to store a collection of alias file names:

+DATA/racdb/my_directory

User-defined directories may be created at any level below the disk group directories. That is, you cannot create a user-defined directory at the root (+) level.

Managing ASM Directories

SQL> ALTER DISKGROUP DATA ADD DIRECTORY '+DATA/mydir';

SQL> ALTER DISKGROUP DATA
2 RENAME DIRECTORY '+DATA/mydir' TO '+DATA/myotherdir';


The ASMCMD commands:

  • mkdir: Makes directory
  • mv: Renames a file or directory
  • rm: Removes a file or directory and its aliases
  • rmalias: Removes the alias only

You can also perform all these operations from Enterprise Manager.

Managing Alias File Names

SQL> ALTER DISKGROUP DATA ADD ALIAS '+DATA/mydir/system.dbf'
2 FOR '+DATA/sample/datafile/system.262.676172197';

SQL> ALTER DISKGROUP DATA RENAME ALIAS '+DATA/mydir/datafile.dbf'
2 TO '+DATA/payroll/compensation.dbf';

No comments:

Post a Comment