Skip Headers
Oracle® Automatic Storage Management Administrator's Guide
11g Release 2 (11.2)

Part Number E18951-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

7 Administering Oracle ASM Files, Directories, and Templates

This chapter describes how to administer files when you use the Oracle Automatic Storage Management (Oracle ASM) storage option.

This chapter contains the following topics:

What Types of Files Does Oracle ASM Support?

Oracle ASM supports most file types required by the database. Table 7-1 lists file types that are supported directly by Oracle ASM and lists the system default template that provides the attributes for file creation. Some file types shown in the table are related to specific products or features, and are not discussed in this book.

Table 7-1 File types supported by Oracle ASM

File Type Default Templates

Control files

CONTROLFILE

Data files

DATAFILE

Redo log files

ONLINELOG

Archive log files

ARCHIVELOG

Temporary files

TEMPFILE

Data file backup pieces

BACKUPSET

Data file incremental backup pieces

BACKUPSET

Archive log backup piece

BACKUPSET

Data file copy

DATAFILE

Persistent initialization parameter file (SPFILE)

PARAMETERFILE

Flashback logs

FLASHBACK

Change tracking file

CHANGETRACKING

Data Pump dumpset

DUMPSET

Automatically generated control file backup

AUTOBACKUP

Cross-platform transportable data files

XTRANSPORT

Flash file

FLASHFILE

Oracle ASM Persistent initialization parameter file (SPFILE)

ASMPARAMETERFILE

Oracle ASM Persistent initialization parameter file (SPFILE) backup

ASMPARAMETERFILEBACKUP

Oracle Cluster Registry file

OCRFILE

Oracle ASM Dynamic Volume Manager volumes

n/a


Oracle ASM cannot directly support some administrative file types on disk groups. These include trace files, audit files, alert logs, export files, tar files, and core files.

Note:

Oracle Automatic Storage Management Cluster File System (Oracle ACFS) and Oracle ASM Dynamic Volume Manager (Oracle ADVM) extend Oracle ASM support to include database and application executables, database trace files, database alert logs, application reports, BFILEs, and configuration files. Other supported files are video, audio, text, images, engineering drawings, and other general-purpose application file data. See Chapter 5, "Introduction to Oracle ACFS".

See Also:

"Managing Disk Group Templates" for a description of the system default templates

About Oracle ASM Filenames

Every file created in Oracle ASM is provided a filename generated by Oracle Managed Files, known as a fully qualified filename (or system-generated filename). The fully qualified filename represents a complete path name in the Oracle ASM file system. An example of a fully qualified filename is:

+data/orcl/controlfile/Current.256.541956473

You can use the fully qualified filename to reference (read or retrieve) an Oracle ASM file. You can also use other abbreviated filename formats, such as an alias Oracle ASM filename described in "Alias Oracle ASM Filename Forms", to reference an Oracle ASM file.

Oracle ASM generates a fully qualified filename upon any request to create a file. A creation request does not or cannot specify a fully qualified filename. Instead, it uses a simpler syntax to specify a file, such as an alias or just a disk group name. Oracle ASM then creates the file, placing it in the correct Oracle ASM path according to file type, and then assigns an appropriate fully qualified filename. If you specify an alias in the creation request, Oracle ASM also creates the alias so that it references the fully qualified filename.

Oracle ASM file creation requests are either single file creation requests or multiple file creation request.

Notes:

  • You can find the generated name in database views displaying Oracle file names, such as V$DATAFILE and V$LOGFILE. You can use this name, or an abbreviated form of it, if you later must reference an Oracle ASM file in a SQL statement. As with other Oracle Database filenames, Oracle ASM filenames are kept in the control file and the RMAN catalog.

  • You can use fully qualified and numeric filenames in single-file creation if you specify the REUSE keyword, as described in "Using Oracle ASM Filenames in SQL Statements".

  • Forward slash (/) and backslash (\) are interchangeable in filenames. Filenames are case insensitive, but case retentive.

This section contains the following topics:

Table 7-2 specifies the valid usage for each filename form. If the form is used for file creation, the table specifies whether the created file is an Oracle Managed Files (OMF).

Table 7-2 Valid usage for Oracle ASM filename forms

Filename Form Reference to File? Single-file Creation? Multiple File Creation? Created as OMF?

Fully qualified file name

Yes

No

No

No

Alias file name

Yes

Yes

No

No

Alias with template file name

No

Yes

No

No

Incomplete file name

No

Yes

Yes

Yes

Incomplete file name with template

No

Yes

Yes

Yes


Single File Creation Form

A single file creation form is used to create a single file, such as a data file or a control file. The form of the Oracle ASM filename in this type is either an alias, such as +data/orcl/ctl.f, or an incomplete file name, such as a disk group name preceded by a plus sign (+data). You use the alias or disk group name where a filename is called for in a SQL statement, such as CREATE TABLESPACE, CREATE CONTROLFILE.

Multiple File Creation Form

A multiple file creation form is used multiple times to create Oracle ASM files, such as when assigning a value to the initialization parameter DB_CREATE_FILE_DEST. You can also run a CREATE TABLESPACE statement (without a filename specification) multiple times. Each time, Oracle ASM creates a different unique data file name.

When using the multiple file creation form, you can use an incomplete filename form, such as a disk group name preceded by a plus sign (+data). In this case, you set DB_CREATE_FILE_DEST to an incomplete filename (for example, +data), and whenever a command is run that must create a database file in DB_CREATE_FILE_DEST, the file is created in the designated disk group and assigned a unique fully qualified name. You can use an incomplete filename in other *_DEST initialization parameters.

Fully Qualified File Name Form

You can use a fully qualified form for referencing existing Oracle ASM files in Oracle ASM operations, except for disk group creation. This form is the Oracle ASM file name that Oracle ASM automatically generates when an Oracle ASM file is created.

A fully qualified file name has the following form:

+diskgroup/dbname/filetype/filetypetag.file.incarnation

Where:

  • +diskgroup is the disk group name preceded by a plus sign.

    You can think of the plus sign (+) as the root directory of the Oracle ASM file system, similar to the slash (/) on UNIX or Linux computers.

  • dbname is the DB_UNIQUE_NAME of the database to which the file belongs.

  • filetype is the Oracle file type and can be one of the file types shown in Table 7-3.

  • filetypetag is type-specific information about the file and can be one of the tags shown in Table 7-3.

  • file.incarnation is the file/incarnation pair, used to ensure uniqueness.

An example of a fully qualified Oracle ASM filename is:

+data/orcl/controlfile/Current.256.541956473

Table 7-3 Oracle file types and Oracle ASM file type tags

Oracle ASM File Type Description Oracle ASM File Type Tag Comments

CONTROLFILE

Control files and backup control files

Current

Backup

Archive

Backup

DATAFILE

Data files and data file copies

tblspname

Name of the tablespace into which the file is added

ONLINELOG

Online logs

group_loggroup#

 

ARCHIVELOG

Archive logs

thread_thread#_seq_sequence#

 

TEMPFILE

Tempfiles

tsname

Name of the tablespace into which the file is added

BACKUPSET

Data file and archive log backup pieces; data file incremental backup pieces

spfile?_timestamp

spfile? can take one of two values: s indicates that the backup set includes the spfile; n indicates that the backup set does not include the spfile.

timestamp is the time that the backup is started.

PARAMETERFILE

Persistent parameter files

spfile

Name of the SPFILE

DATAGUARDCONFIG

Data Guard configuration file

db-unique-name

Data Guard uses the value of the DB_UNIQUE_NAME initialization parameter.

FLASHBACK

Flashback logs

log_flashbacklog#

 

CHANGETRACKING

Block change tracking data

ctf

Used during incremental backups

DUMPSET

Data Pump dumpset

user_obj#_file#

Dump set files encode the user name, the job number that created the dump set, and the file number as part of the tag.

XTRANSPORT

Data file convert

tblspname

Name of the tablespace where the Oracle ASM metadata is added

AUTOBACKUP

Automatic backup files

spfile?_timestamp

spfile? can take one of two values: s indicates that the backup set includes the spfile; n indicates that the backup set does not include the spfile.

timestamp is the time that the backup is started.

ASMPARAMETERFILE

Oracle ASM persistent parameter files

spfile

Name of the Oracle ASM SPFILE

OCRFILE

Oracle Clusterware Registry files

ocrfile

Name of the OCR files


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.

For more information about alias filenames, see "Managing Alias Names for Oracle ASM Filenames".

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.

Incomplete Oracle ASM Filename Form

Incomplete Oracle ASM filenames are used only for file creation operations and are used for both single and multiple file creation. They consist only of the disk group name. Oracle ASM uses a system default template to determine the Oracle ASM file mirroring and striping attributes. The system template that is used is determined by the file type that is being created. For example, if you are creating a data file for a tablespace, then the DATAFILE template is used.

An example of using an incomplete Oracle ASM filename is setting the DB_CREATE_FILE_DEST initialization parameter to:

+data

With this setting, every time you create a tablespace, a data file is created in the disk group data, and each data file is assigned a different fully qualified name. See "Creating Oracle ASM Files Using a Default File Location for Disk Group Specification" for more information.

Incomplete Oracle ASM Filename with Template Form

Incomplete Oracle ASM filenames with templates are used only for file creation operations and are used for both single and multiple file creation. They consist of the disk group name followed by the template name in parentheses. When you explicitly specify a template in a file name, Oracle ASM uses the specified template instead of the default template for that file type to determine attributes for the file.

An example of using an incomplete Oracle ASM filename with template is setting the DB_CREATE_FILE_DEST initialization parameter to:

+data(mytemplate)

Creating and Referencing Oracle ASM Files in the Database

An Oracle ASM file is an Oracle Managed File unless you created the file using an alias. Any Oracle Managed File is automatically deleted when it is no longer needed.

This section contains the following topics:

Creating Oracle ASM Files Using a Default File Location for Disk Group Specification

Using the Oracle Managed Files feature for operating system files, you can specify a directory as the default location for the creation of data files, temporary files, redo log files, and control files. Using the Oracle Managed Files feature for Oracle ASM, you can specify a disk group, in the form of an incomplete Oracle ASM filename, as the default location for creation of these files, and additional types of files, including archived log files. As for operating system files, the name of the default disk group is stored in an initialization parameter and is used whenever a file specification (for example, DATAFILE clause) is not explicitly specified during file creation.

The following initialization parameters accept the multiple file creation context form of Oracle ASM filenames as a destination:

  • DB_CREATE_FILE_DEST

    Specifies the default disk group location in which to create data and temp files.

  • DB_CREATE_ONLINE_LOG_DEST_n

    Specifies the default disk group location in which to create redo log and control files.

  • DB_RECOVERY_FILE_DEST

    Specifies a default disk group for a fast recovery area that contains a copy of the control file and redo log files if this parameter is specified and DB_CREATE_ONLINE_LOG_DEST_n and CONTROL_FILES are not specified.

  • CONTROL_FILES

    Specifies a disk group in which to create control files.

The following initialization parameters accept the multiple file creation context form of the Oracle ASM filenames and Oracle ASM directory names as a destination:

  • LOG_ARCHIVE_DEST_n

    Specifies a default disk group or Oracle ASM directory as destination for archiving redo log files

  • LOG_ARCHIVE_DEST

    Optional parameter to use to specify a default disk group or Oracle ASM directory as destination for archiving redo log files. Use when specifying only one destination.

  • STANDBY_ARCHIVE_DEST

    Relevant only for a standby database. It specifies a default disk group or Oracle ASM directory that is the location of archive logs arriving from a primary database. Not discussed in this book. This parameter has been deprecated. See Oracle Data Guard Concepts and Administration.

The following CREATE TABLESPACE SQL statement illustrates how an Oracle ASM file, in this case a data file, might be created in a default disk group. This example assumes that the DB_CREATE_FILE_DEST initialization parameter has been set to +data.

SQL> CREATE TABLESPACE mytblspace;

Oracle ASM automatically creates and manages the data file for mytblspace on Oracle ASM disks in the disk group data. File extents are stored using the attributes defined by the default template for a data file.

See Also:

Using Oracle ASM Filenames in SQL Statements

You can specify Oracle ASM filenames in the file specification clause of your SQL statements. If you are creating a file for the first time, then use the creation form of an Oracle ASM filename. If the Oracle ASM file exists, then you must use the reference form of the filename, and if you are trying to re-create the file, you must add the REUSE keyword so that the space is reused for the new file. This usage might occur when, for example, trying to re-create a control file, as shown in "Creating Control Files in Oracle ASM".

If a reference form is used with the REUSE keyword and the file does not exist, an error results.

Example 7-2 is an example of specifying an Oracle ASM filename in a SQL statement. In this case, it is used in the file creation form.

Example 7-2 Using an Oracle ASM File name in a SQL statement

CREATE TABLESPACE mytblspace DATAFILE '+data' SIZE 200M AUTOEXTEND ON;

The tablespace mytblspace is created and comprises one data file of size 200 MB contained in the disk group data. The data file is set to auto-extensible with an unlimited maximum size. You can use an AUTOEXTEND clause to override this default.

For more examples of the use of Oracle ASM filename in SQL statements, see Appendix A, "Creating Database Files in Oracle ASM Using SQL*Plus".

Managing Alias Names for Oracle ASM Filenames

Alias names, or aliases, are intended to provide a more user-friendly means of referring to Oracle ASM files, rather than using the system-generated filenames.

You can create an alias for a file when you create it in the database, or you can add an alias to an existing file using the ADD ALIAS clause of the ALTER DISKGROUP statement. You can create an alias in any system-generated or user-created Oracle ASM directory. An alias must include the disk group name; you cannot create an alias at the root level (+).

For more information about creating aliases with ASMCMD, refer to "mkalias".

This section contains the following sections:

Adding an Alias Name for an Oracle ASM Filename

Use the ADD ALIAS clause of the ALTER DISKGROUP statement to create an alias name for an Oracle ASM filename. The alias name must consist of the full directory path and the alias itself.

Example 7-3 adds a new alias name for a system-generated file name.

Example 7-3 Adding an alias name for an Oracle ASM filename

ALTER DISKGROUP data ADD ALIAS '+data/orcl/second.dbf'
     FOR '+data/orcl/datafile/mytable.342.123456789';

Renaming an Alias Name for an Oracle ASM Filename

Use the RENAME ALIAS clause of the ALTER DISKGROUP statement to rename an alias for an Oracle ASM filename. The old and the new alias names must consist of the full directory paths of the alias names.

Example 7-4 renames an alias.

Example 7-4 Renaming an alias name for an Oracle ASM filename

ALTER DISKGROUP data RENAME ALIAS '+data/orcl/datafile.dbf'
     TO '+data/payroll/compensation.dbf';

Renaming an alias does not update the database reference to the alias.

Dropping an Alias Name for an Oracle ASM Filename

Use the DROP ALIAS clause of the ALTER DISKGROUP statement to drop an alias for an Oracle ASM filename. The alias name must consist of the full directory path and the alias itself. The underlying file to which the alias refers is unchanged.

Example 7-5 drops an alias.

Example 7-5 Dropping an alias name for an Oracle ASM filename

ALTER DISKGROUP data DROP ALIAS '+data/payroll/compensation.dbf';

Example 7-6 fails because it attempts to drop a system-generated filename and this syntax is not allowed.

Example 7-6 Dropping an alias name for an Oracle ASM filename

ALTER DISKGROUP data 
     DROP ALIAS '+data/orcl/datafile/mytable.342.123456789';

Dropping Files and Associated Aliases from a Disk Group

You can delete Oracle ASM files and their associated aliases from a disk group using the DROP FILE clause of the ALTER DISKGROUP statement. You must use a fully qualified filename, or an alias name when specifying the file to delete. The underlying file on the file system is not dropped when the alias is dropped.

Some reasons why you may want to delete files include:

  • A file created using aliases is not an Oracle Managed File. Consequently, it is not automatically deleted.

  • A point-in-time-recovery of a database might restore the database to a time before a tablespace was created. The restore does not delete the tablespace, but there is no reference to the tablespace or its data file in the restored database. You could manually delete the data file.

In Example 7-7, the alias name for the file is used to delete both the file and the alias from a disk group.

Example 7-7 Dropping a file and alias from a disk group using the alias name

ALTER DISKGROUP data DROP FILE '+data/payroll/compensation.dbf';

In Example 7-8, the Oracle Managed Files (system-generated) file name is used to drop the file and any associated alias.

Example 7-8 Dropping a file and alias from a disk group using the system-generated name

ALTER DISKGROUP data
     DROP FILE '+data/orcl/datafile/mytable.342.123456789';

Managing Disk Group Directories

Oracle ASM disk groups contain a system-generated hierarchical directory structure for storing Oracle ASM files. The system-generated filename that Oracle ASM assigns to each file represents a path in this directory hierarchy. The following is an example of a system-generated filename:

+data/orcl/CONTROLFILE/Current.256.541956473

The plus sign represents the root of the Oracle ASM file system. The data directory is the parent directory for all files in the data disk group. The orcl directory is the parent directory for all files in the orcl database, and the CONTROLFILE directory contains all control files for the orcl database.

You can create your own directories within this hierarchy to store aliases that you create. Thus, in addition to having user-friendly alias names for Oracle ASM files, you can have user-friendly paths to those names.

This section describes how to use the ALTER DISKGROUP statement to create a directory structure for aliases. It also describes how you can rename a directory or drop a directory. This section contains the following topics:

Creating a Directory

Use the ADD DIRECTORY clause of the ALTER DISKGROUP statement to create a hierarchical directory structure for alias names for Oracle ASM files. Use the slash (/) or backslash (\) character to separate components of the directory path. The directory path must start with the disk group name, preceded by a plus sign (+), followed by any subdirectory names of your choice.

The parent directory must exist before attempting to create a subdirectory or alias in that directory. A directory must be created below the disk group level.

Example 7-9 creates a hierarchical directory for disk group data, which can contain, for example, the alias name +data/orcl/control_file1.

Example 7-9 Creating a new directory

ALTER DISKGROUP data ADD DIRECTORY '+data/orcl';

Assuming no subdirectory exists under the directory +data/orcl, the SQL statement fails in Example 7-10.

Example 7-10 Creating a new subdirectory

ALTER DISKGROUP data
     ADD DIRECTORY '+data/orcl/first_dir/second_dir';

Renaming a Directory

The RENAME DIRECTORY clause of the ALTER DISKGROUP statement enables you to rename a directory. System-created directories (those containing system-generated names) cannot be renamed. The root level (disk group name) cannot be renamed.

Example 7-11 renames a directory.

Example 7-11 Renaming a directory

ALTER DISKGROUP data RENAME DIRECTORY '+data/mydir'
     TO '+data/yourdir';

Dropping a Directory

You can delete a directory using the DROP DIRECTORY clause of the ALTER DISKGROUP statement. You cannot drop a system-created directory. You cannot drop a directory containing alias names unless you also specify the FORCE clause.

Example 7-12 deletes a directory along with its contents.

Example 7-12 Dropping a directory

ALTER DISKGROUP data DROP DIRECTORY '+data/yourdir' FORCE;

Accessing Oracle ASM Files with the XML DB Virtual Folder

Oracle ASM files and directories can be accessed through a virtual folder in the XML DB repository. The repository path to the virtual folder is /sys/asm. The folder is virtual because its contents do not actually reside in the repository; they exist as normal Oracle ASM files and directories. For example, /sys/asm provides a means to access and manipulate the Oracle ASM files and directories with programmatic APIs such as the DBMS_XDB package and with XML DB protocols such as FTP and HTTP/WebDAV. You can also use the ASMCMD cp command to copy files. See "cp".

A typical use for this capability might be to view /sys/asm as a Web Folder in a graphical user interface (with the WebDAV protocol), and then copy a Data Pump dumpset from an Oracle ASM disk group to an operating system file system by dragging and dropping.

You must log in as a user other than SYS and you must have been granted the DBA role to access /sys/asm with XML DB protocols.

Note:

For security reasons, FTP is disabled, by default. This is because the IETF FTP protocol specification requires that passwords be transmitted in clear text. Disabling is done by configuring the FTP server port as zero (0). To enable FTP, set the ftp-port parameter to the FTP port to use, such as 2100.

See Also:

Inside /sys/asm

The Oracle ASM virtual folder is created by default during XML DB installation. If the database is not configured to use Oracle ASM, the folder is empty and no operations are permitted on it.

The Oracle ASM virtual folder contains folders and subfolders that follow the hierarchy defined by the structure of an Oracle ASM fully qualified file name. Figure 7-1 illustrates an example of this hierarchy, which for simplicity, excludes directories created for aliases.

The folder /sys/asm contains one subfolder for every mounted disk group, and each disk group folder contains one subfolder for each database that uses the disk group. In addition, a disk group folder might contain files and folders corresponding to aliases created by the administrator. Continuing the hierarchy, the database folders contain file type folders, which contain the Oracle ASM files.

Figure 7-1 Hierarchical Structure of Oracle ASM Folders in an XML DB Installation

Description of Figure 7-1 follows
Description of "Figure 7-1 Hierarchical Structure of Oracle ASM Folders in an XML DB Installation"

The following are usage restrictions on /sys/asm:

  • You cannot create hard links to existing Oracle ASM files or directories with APIs such as DBMS_XDB.LINK.

  • You cannot rename (move) an Oracle ASM file to another disk group or to a directory outside Oracle ASM.

You can use the directory /sys/asm for storing the names of disk groups. You cannot store other files in this directory. Within the disk group directories under /sys/asm, such as /sys/asm/DATA, you can only store database files in these sub-directories. Oracle ASM rejects attempts to store non-database files in these directories.

Using DBMS_FILE Transfer Utility for Oracle ASM

The DBMS_FILE_TRANSFER package provides procedures to copy Oracle ASM files within a database or to transfer binary files between databases that use Oracle ASM. The DBMS_FILE_TRANSFER package has the following procedures:

See Also:

Oracle Database PL/SQL Packages and Types Reference for more information about the DBMS_FILE_TRANSFER package

Managing Disk Group Templates

This section describes how to manage disk group templates under the following topics:

Templates are used to set attributes of files created in an Oracle ASM disk group. When a file is created, redundancy and striping attributes are set for that file based on an explicitly named template or the system template that is the default template for the file type.

When a disk group is created, Oracle ASM creates a set of default templates for that disk group. The set consists of one template for each file type (data file, control file, redo log file, and so on) that is supported by Oracle ASM. For example, a template named ONLINELOG provides the default file redundancy and striping attributes for all redo log files written to Oracle ASM disks. Default template settings depend on the disk group type. The default template for data files for a normal redundancy disk group sets two-way mirroring, while the corresponding default template in a high redundancy disk group sets three-way mirroring. You can modify these default templates.

For example, default redundancy for the online redo log files (ONLINELOG template) for a normal redundancy disk group is MIRROR. In Example 4-1, this setting means that when one copy of a redo log file extent is written to a disk in failure group controller1, a mirrored copy of the file extent is written to a disk in failure group controller2. To support the default mirroring of a normal redundancy disk group, at least two failure groups must be defined.

Table 7-6 lists the default templates and the attributes that are associated to matching files. As the table shows, the initial redundancy value of each default template depends on the type of disk group that the template belongs to.

Using clauses of the ALTER DISKGROUP statement, you can add new templates to a disk group, modify existing ones, or drop templates. The reason to add templates is to create the right combination of attributes to meet unique requirements. You can then reference a template name when creating a file, thereby assigning desired attributes based on an individual file rather than on the file type.

The V$ASM_TEMPLATE view lists all of the templates known to the Oracle ASM instance. For an example of the information displayed in the V$ASM_TEMPLATE view, see Example 6-10.

Template Attributes

Table 7-4 shows the permitted striping attribute values and allocation unit size chunks. These values correspond to the STRIPE column of V$ASM_TEMPLATE.

Table 7-4 Permitted values for Oracle ASM template striping attribute

Striping Attribute Value Description

FINE

Striping in 128 KB chunks.

COARSE

Striping in 1 MB chunks.


Table 7-5 shows the permitted redundancy values for Oracle ASM templates. These values correspond to the REDUND column of V$ASM_TEMPLATE.

Table 7-5 Permitted values for Oracle ASM template redundancy attribute

Redundancy Attribute Value Resulting Mirroring in Normal Redundancy Disk Group Resulting Mirroring in High Redundancy Disk Group Resulting Mirroring in External Redundancy Disk Group

MIRROR

Two-way mirroring

Three-way mirroring

(Not allowed)

HIGH

Three-way mirroring

Three-way mirroring

(Not allowed)

UNPROTECTED

No mirroring

(Not allowed)

No mirroring


Table 7-6 shows the initial attribute settings for the default templates. The type of mirroring associated with the Mirroring column for normal, high, and external redundancy disk groups is specified in Table 7-5. For example, the Mirror column for high redundancy disk groups displays MIRROR in Table 7-6. In Table 7-5, the MIRROR value for high redundancy disk groups corresponds to Three-way mirroring.

Table 7-6 Oracle ASM system default templates attribute settings

Template Name File Striping Mirroring, Normal Redundancy Disk Group Mirroring, High Redundancy Disk Group Mirroring, External Redundancy Disk Group Primary Region Mirror Region

CONTROLFILE

FINE

HIGH

MIRROR

UNPROTECTED

COLD

MIRRORCOLD

DATAFILE

COARSE

MIRROR

MIRROR

UNPROTECTED

COLD

MIRRORCOLD

ONLINELOG

COARSE

MIRROR

MIRROR

UNPROTECTED

COLD

MIRRORCOLD

ARCHIVELOG

COARSE

MIRROR

MIRROR

UNPROTECTED

COLD

MIRRORCOLD

TEMPFILE

COARSE

MIRROR

MIRROR

UNPROTECTED

COLD

MIRRORCOLD

BACKUPSET

COARSE

MIRROR

MIRROR

UNPROTECTED

COLD

MIRRORCOLD

PARAMETERFILE

COARSE

MIRROR

MIRROR

UNPROTECTED

COLD

MIRRORCOLD

DATAGUARDCONFIG

COARSE

MIRROR

MIRROR

UNPROTECTED

COLD

MIRRORCOLD

FLASHBACK

COARSE

MIRROR

MIRROR

UNPROTECTED

COLD

MIRRORCOLD

CHANGETRACKING

COARSE

MIRROR

MIRROR

UNPROTECTED

COLD

MIRRORCOLD

DUMPSET

COARSE

MIRROR

MIRROR

UNPROTECTED

COLD

MIRRORCOLD

XTRANSPORT

COARSE

MIRROR

MIRROR

UNPROTECTED

COLD

MIRRORCOLD

AUTOBACKUP

COARSE

MIRROR

MIRROR

UNPROTECTED

COLD

MIRRORCOLD

ASMPARAMETERFILE

COARSE

MIRROR

MIRROR

UNPROTECTED

COLD

MIRRORCOLD

OCRFILE

COARSE

MIRROR

MIRROR

UNPROTECTED

COLD

MIRRORCOLD


Table 7-7 shows the permitted primary and mirror region values for Oracle ASM templates. These values correspond to the PRIMARY_REGION and MIRROR_REGION columns of V$ASM_TEMPLATE. For more information about disk regions, see "Intelligent Data Placement".

Table 7-7 Permitted values for Oracle ASM template primary and mirror region attribute

Primary and Mirror Region Attribute Value Description

COLD, MIRRORCOLD

Use the inner most tracks (closest to spindle) on the disk drive.

HOT, MIRRORHOT

Use the outermost tracks which have greater speed and higher bandwidth.


Adding Templates to a Disk Group

To add a template to a disk group, use the ADD TEMPLATE clause of the ALTER DISKGROUP statement.

If the name of your new template is not listed in Table 7-6, then it is not used as a default template for database file types. To use the template, you must reference its name when creating a file.

When adding a template to a disk group, the attributes are optional. If no redundancy attribute is specified, then the value defaults to MIRROR for a normal redundancy disk group, HIGH for a high redundancy disk group, and UNPROTECTED for an external redundancy disk group. If you do not specify a striping attribute, then the value defaults to COARSE. If you do not specify a value for the primary or mirror region attributes, then the value defaults to COLD and MIRRORCOLD respectively.

Example 7-13 creates a new template named reliable for the normal redundancy disk group data.

Example 7-13 Adding a template with high redundancy to a disk group

ALTER DISKGROUP data ADD TEMPLATE reliable ATTRIBUTES (HIGH FINE);

Example 7-14 creates a new template named unreliable that specifies UNPROTECTED (no mirroring) for files.

Example 7-14 Adding a template with external redundancy to a disk group

ALTER DISKGROUP data ADD TEMPLATE unreliable ATTRIBUTES (UNPROTECTED);

Note:

Oracle discourages using unprotected files unless you have implemented hardware mirroring. The previous example is presented only to further illustrate how the attributes for templates are set.

See Also:

Oracle Database SQL Language Reference for more information about the ALTER DISKGROUP...ADD TEMPLATE command

Modifying a Disk Group Template

The MODIFY TEMPLATE clause of the ALTER DISKGROUP statement enables you to modify the attribute specifications of an existing system default or user-defined disk group template. Only specified template attributes are changed. Unspecified properties retain their current value. When you modify an existing template, only new files created by the template reflect the attribute changes. Existing files maintain their attributes.

Example 7-15 changes the striping attribute specification of the reliable template for disk group data.

Example 7-15 Modifying a disk group template

ALTER DISKGROUP data MODIFY TEMPLATE reliable 
     ATTRIBUTES (COARSE);

Dropping Templates from a Disk Group

Use the DROP TEMPLATE clause of the ALTER DISKGROUP statement to drop one or more templates from a disk group. You can only drop templates that are user-defined; you cannot drop system default templates.

Example 7-16 drops the previously created template unreliable from data:

Example 7-16 Dropping a template from a disk group

ALTER DISKGROUP data DROP TEMPLATE unreliable;

Creating Tablespaces in Oracle ASM: Specifying Attributes with Templates

Use the SQL ALTER SYSTEM and CREATE TABLESPACE statements to create a tablespace that uses a user-defined template to specify the attributes of the data file.

Example 7-17 assumes that the template (mytemplate) has been defined.

Example 7-17 Using a user-defined template to specify attributes

ALTER SYSTEM SET DB_CREATE_FILE_DEST = '+data(mytemplate)';

CREATE TABLESPACE mytblspace;