Tuesday, November 6, 2012

Alias Oracle ASM Filename Forms


Alias Oracle ASM Filename Forms
You can use Alias Oracle ASM filenames both for referencing existing Oracle ASM files and for creating new Oracle ASM files. Alias names start with the disk group name preceded by a plus sign, after which you specify a name string. Alias filenames are implemented using a hierarchical directory structure, with the slash (/) or backslash (\) character separating name components. You can create an alias in any Oracle ASM directory generated by Oracle Managed Files (system-generated) or created by a user. An alias must include the disk group name; you cannot create an alias at the root level (+).
When you create an Oracle ASM file with an alias filename, the file is created with a fully qualified name, and the alias filename is additionally created. You can then access the file with either name.
Alias Oracle ASM filenames are distinguished from fully qualified filenames or numeric filenames because they do not end in a dotted pair of numbers. It is an error to attempt to create an alias that ends in a dotted pair of numbers, such as in the format USERS.259.685366091. Examples of Oracle ASM alias filenames are:

+data/orcl/control_file1
+fra/recover/second.dbf
Oracle Database references database files by their alias filenames, but only if you create the database files with aliases. If you create database files without aliases and then add aliases later, the database references the files by their fully qualified filenames. The following are examples of how the database uses alias filenames:
  • Alias filenames appear in V$ views. For example, if you create a tablespace and use an alias filename for the data file, the V$DATAFILE view shows the alias filename.
  • When a control file points to data files and online redo log files, it can use alias filenames.
  • The CONTROL_FILES initialization parameter can use the alias filenames of the control files. Database Configuration Assistant (DBCA) creates control files with alias filenames.

Note:
Files created using an alias filename are not considered Oracle Managed Files and might require manual deletion in the future if they are no longer needed.


Creating a Tablespace in Oracle ASM: Using a Data File with an Alias Name
Example 7-1 creates an undo tablespace with a data file that has an alias name, and with attributes that are set by the user-defined template my_undo_template. This example assumes that a directory has been created in disk group data to contain the alias name and that the user-defined template exists.
Example 7-1 Creating a tablespace using an alias name
CREATE UNDO TABLESPACE myundo
     DATAFILE '+data(my_undo_template)/orcl/my_undo_ts' SIZE 200M;
Because an alias is used to create the data file, the file is not an Oracle Managed Files (OMF) file and the file is not automatically deleted when the tablespace is dropped. To drop the file manually after the tablespace has been dropped, use the following SQL statement:
ALTER DISKGROUP data DROP FILE '+data/orcl/my_undo_ts';
Alias Oracle ASM Filename with Template Form
An alias Oracle ASM filename with template is used only for Oracle ASM file creation operations. It has the following format:
+diskgroup(templatename)/alias
Alias filenames with template behave identically to alias filenames except that a file created with an alias filename with template receives the attributes specified by the named template. The template must belong to the disk group that the file is being created in. See Example 7-1.
The creation and maintenance of Oracle ASM templates is discussed in "Managing Disk Group Templates".
An example of an alias Oracle ASM filename with template is:
+data(mytemplate)/config1
Explicitly specifying a template name, as in the previous example, overrides the system default template for the type of file being created.
Note:
Files created using an alias filename with template are not considered Oracle Managed Files and might require manual deletion in the future if they are no longer needed.

No comments:

Post a Comment