9.5. Using ASM Filenames

All ASM files are OMF, so the details of the actual filename within the disk group are not needed for most administrative functions. When an object in an ASM disk group is dropped, the file is automatically deleted. Certain commands will expose the actual filenames, such as ALTER DATABASE BACKUP CONTROLFILE TO TRACE, as well as some data dictionary views. For example, the data dictionary view VSDATAFILE shows the actual filenames within each disk group:

SQL> select file#, name, blocks from v$datafile;
------- -------------------------------------- ---------
   FILE# NAME                                 BLOCKS
       1 +DATAl/racO/datafile/system.256.1     57600
       2 +DATAl/racO/datafile/undotbsl.258.1    3840
       3 +DATAl/racO/datafile/sysaux.257.1     44800
       4 +DATAl/racO/datafile/users.259.1        640
       5 +DATAl/racO/datafile/example.269.1    19200
       6 +DATA2/rac0/datafile/users3.256.1     12800

6 rows selected.

ASM filenames can be one of six different formats. In the sections that follow, we'll give an overview of the different formats and the context where they can be used:

  • As a reference to an existing file

  • During a single-file creation operation

  • During a multiple-file creation operation

9.5.1. Fully Qualified Names

Fully qualified ASM filenames are used only when referencing an existing file. A fully qualified ASM filename has the format

+group/dbname/file type/tag.file.incarnation

where

  • group is the disk group name.

  • dbname is the database to which the file belongs.

  • file type is the Oracle file type.

  • tag is the type-specific information about the specific file type.

  • The file. incarnation pair ensures uniqueness.

An example of an ASM file for the USERS3 tablespace is as follows:

+DATA2/rac0/datafile/users3.256.1

The disk group name is +DATA2, the database name is rac0, it's a datafile for the USERS3 tablespace, and the file number/incarnation pair 256.1 ensures uniqueness if you decide to create another ASM datafile for the USERS3 tablespace.

9.5.2. Numeric Names

Numeric names are used only when referencing an existing ASM file. It allows you to refer to an existing ASM file by only the disk group name and the file number/incarnation pair. The numeric name for the ASM file in the previous section is as follows:

+DATA2.256.1

9.5.3. Alias Names

You can use an alias either when referencing an existing object or when creating a single ASM file. Using the ALTER DISKGROUP ADD ALIAS command, you can create a more user-friendly name for an existing or a new ASM file; they are distinguishable from regular ASM filenames because they do not end in a dotted pair of numbers (the file number/incarnation pair). In the following example, you create a directory object to the data2 disk group, and then you use the ALTER DISKGROUP ADD ALIAS command to create a user-friendly alias in the newly created directory object to point to a fully qualified datafile name. The following example creates a directory called +data2/redempt for the ASM disk group called data2:

SQL> alter diskgroup data2
  2    add directory '+data2/redempt';

Diskgroup altered.

Using the directory created previously, this next example gives the datafile called users3.256.1 the user-friendly filename users.dbf:

SQL> alter diskgroup data2
  2    add alias '+data2/redempt/users.dbf'
  3    for '+data2/rac0/datafile/users3.256.1';

Diskgroup altered.

9.5.4. Alias with Template Names

You can use an alias with a template only when creating a new ASM file. Templates provide a shorthand way of specifying a file type and a tag when creating a new ASM file.

NOTE

The "Understanding ASM File Types and Templates" section later in this chapter covers default ASM templates.

An example of an alias using a template for a new tablespace in the +DATA2 disk group is as follows:

SQL> create tablespace users4 datafile
  2    '+data2/uspare(datafile)';
Tablespace created.

9.5.5. Incomplete Names

You can use an incomplete filename format either for single-file or for multiple-file creation operations. You specify only the disk group name, and you use a default template depending on the type of file, as shown here:

SQL> create tablespace users5 datafile '+datal';
Tablespace created.

9.5.6. Incomplete Names with Template

As with incomplete ASM filenames, you can use an incomplete filename with a template for single-file or multiple-file creation operations. Regardless of the actual file type, the template name determines the characteristics of the file.

Even though you are creating a tablespace, the characteristics of a tempfi1e are used instead as the attributes for the datafile, as shown here:

SQL> create tablespace users6 datafile '+datal(tempfile)';
Tablespace created.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset