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

No comments:
Post a Comment