Tuesday, November 3, 2009

ASM Files

ASM Files are named using OFA standard and employs OMF for managing files for example when you drop a tablespace ASM will automatically deletes the files associated with the tablespace. Also I need not specify a file name while creating a data file, ASM will automatically assign a unique name.

A typical ASM file looks like this
+ASMDB/gcprod/datafile/users.259.661355087

The ASM file has 5 components, they are

ASM Disk Group : +ASMDB
Database name : gcprod
File type : datafile
Tag : Specific information about the file. In this case it is the tablespace name, users
file.incarnation : A number pair that insure uniqueness

ASM File Alias

Alias are used to represent the files using user friendly names.

To create an alias

SQL> Alter Diskgroup ASMDB add alias '+ASMDB/gcprod/datafile/users1.dbf' for '+ASMDB/gcprod/datafile/users.259.661355087' ;

Instead of using full name you can also use only the disk group name and the numeric identifier as shown below,

SQL> Alter Diskgroup ASMDB add alias '+ASMDB/gcprod/datafile/users1.dbf' for '+ASMDB.259.661355087';

To rename an alias

SQL> Alter Diskgroup ASMDB rename alias '+ASMDB/gcprod/datafile/users1.dbf' to '+ASMDB/gcprod/datafile/users2.dbf';

To delete an alias

SQL> Alter Diskgroup ASMDB delete alias '+ASMDB/gcprod/datafile/users1.dbf';

Note: Once you create an alias the files will not become OMF. Hence the files will not be deleted automatically when the tablespace is dropped. You have to delete the files manually as shown below,

Drop file using alias

SQL> Alter Diskgroup ASMDB drop file '+ASMDB/gcprod/datafile/users1.dbf';

Drop file using numeric name

SQL> Alter Diskgroup ASMDB drop file '+ASMDB.259.661355087';

Drop file using fully qualified name

SQL> Alter Diskgroup ASMDB drop file '+ASMDB/gcprod/datafile/users.259.661355087';

Thanks

Top Blogs

No comments:

Followers

Powered By Blogger
 

Oracle Database Administration. Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com