Datasheet

42
Chapter 1
Using Oracle ASM
GROUP_NUMBER NAME INCARNATION FILE_NUMBER TYPE
------------ ------------------------------ ----------- ----------- -----------
2 COOKED_DGROUP2 613091705 258 ARCHIVELOG
Creating Database Objects Using ASM Filename Aliases
An alias includes the disk group name and then appends a user-defined name to the
lename. This makes it possible to reference an ASM file with a name that makes some
sense. ASM aliases start with the disk group name, followed by a slash and then the alias
name as in this example:
+COOKED_DGROUP1/datafiles/myfile.dbf
Aliases can be created at the time the file is created (such as when you issue the create
tablespace
command), or you can add the alias later. Here is an example of creating
a tablespace with an alias filename:
create tablespace alias_tbs
Datafile’+COOKED_DGROUP1/myalias.dbf’ size 10m;
The resulting ASM file would be as follows:
+COOKED_DGROUP1/11GDB/datafile/alias_tbs.256.613066047
You can see this through the following query executed in the ASM instance:
SQL> select b.name gname, a.name aname, a.system_created, a.alias_directory,
2 c.type file_type
3 from v$asm_alias a, v$ASM_DISKGROUPS b, v$asm_file c
4 where a.group_number = b.group_number
5 and a.group_number = c.group_number(+)
6 and a.file_number = c.file_number(+)
7 and a.file_incarnation = c.incarnation(+)
8 and b.name=’COOKED_DGROUP1’
9 and c.type=’DATAFILE’;
GNAME ANAME S A FILE_TYPE
------------------------------ ------------------------------ - - -----------
COOKED_DGROUP1 ALIAS_TBS.260.613168611 Y N DATAFILE
95134c01.indd 42 1/28/09 9:43:46 AM