Datasheet
26
Chapter 1
Using Oracle ASM
Creating ASM Disk Group Directories
When you create an ASM disk group, it includes a system-generated directory structure for
the ASM files that will be stored in that disk group. The system-generated directory struc-
ture takes on the following format, where
disk_group is the root of the directory hierarchy:
+disk_group/database_name/object_type/ASM_file_name
The database name will be the name of the database that the data is associated with. The
object_type is the type of object being stored (for example, datafile) and the ASM_file_
name
is the system-generated filename assigned to that ASM file.
ASM allows you to create your own directories within these predefined structures. This
allows you to give alias names to the ASM files that you will create. This can make working
with ASM files easier.
To create a directory structure, you use the
alter diskgroup command with the add
directory
parameter, as shown in this example:
ALTER DISKGROUP cooked_dgroup1
ADD DIRECTORY ‘+cooked_dgroup1/stuff’;
Managing ASM Disk Group Directories
The alter diskgroup command is also used to manage ASM disk group directories. If you
want to drop an ASM disk group directory, simply use the
drop directory clause of the
alter diskgroup command, as shown in this example:
alter diskgroup cooked_dgroup1
drop directory ‘+cooked_dgroup1/stuff’;
You can also rename directories with the alter diskgroup command using the rename
directory
clause, as shown in this example:
alter diskgroup cooked_dgroup1
rename directory ‘+cooked_dgroup1/stuff’ to ‘+cooked_dgroup1/badstuff’;
You can see the ASM disk group directories in the V$ASM_ALIAS view, as shown in this
example:
select a.name “Alias Name”, b.name “Disk group”
from v$asm_alias a, v$ASM_DISKGROUPS b
where a.group_number=b.group_number;
Alias Name Disk group
------------------------------------------------ ---------------
badstuff COOKED_DGROUP1
95134c01.indd 26 1/28/09 9:43:44 AM