登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

飞哥的技术博客

世上无难事,只怕有心人!

 
 
 

日志

 
 
 
 

oracle database storage administrator's guide 11gR2-7  

2009-10-18 16:57:16|  分类: Oracle |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

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 Automatic Storage Management

File Type Default Templates

Control files

DE>CONTROLFILEDE>

Data files

DE>DATAFILEDE>

Redo log files

DE>ONLINELOGDE>

Archive log files

DE>ARCHIVELOGDE>

Temporary files

DE>TEMPFILEDE>

Data file backup pieces

DE>BACKUPSETDE>

Data file incremental backup pieces

DE>BACKUPSETDE>

Archive log backup piece

DE>BACKUPSETDE>

Data file copy

DE>DATAFILEDE>

Persistent initialization parameter file (SPFILE)

DE>PARAMETERFILEDE>

Flashback logs

DE>FLASHBACKDE>

Change tracking file

DE>CHANGETRACKINGDE>

Data Pump dumpset

DE>DUMPSETDE>

Automatically generated control file backup

DE>AUTOBACKUPDE>

Cross-platform transportable data files

DE>XTRANSPORTDE>

Flash file

DE>FLASHFILEDE>

Oracle ASM Persistent initialization parameter file (SPFILE)

DE>ASMPARAMETERFILEDE>

Oracle ASM Persistent initialization parameter file (SPFILE) backup

DE>ASMPARAMETERFILEBACKUPDE>

Oracle Cluster Registry file

DE>OCRFILEDE>

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:

DE>+data/orcl/controlfile/Current.256.541956473DE>

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 DE>V$DATAFILEDE> and DE>V$LOGFILEDE>. You can use this name, or an abbreviated form of it, if you later must reference an Oracle ASM file in a SQL statement. Such as other Oracle Database filenames, Oracle ASM filenames are kept in the control file and the RMAN catalog.

  • Fully qualified and numeric filenames can be used in single-file create if you specify the DE>REUSEDE> 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 sections contains the following topics:

Table 7-2 specifies the valid usage for each filename form, and if the form is used for file creation, 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 DE>+data/orcl/ctl.fDE>, or an incomplete file name, such as a disk group name preceded by a plus sign (DE>+dataDE>). You use the alias or disk group name where a filename is called for in an SQL statement, such as DE>CREATEDE> DE>TABLESPACEDE>, DE>CREATEDE> DE>CONTROLFILEDE>.

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 DE>DB_CREATE_FILE_DESTDE>. You can also issue a DE>CREATE TABLESPACEDE> 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 (DE>+dataDE>). In this case, you set DE>DB_CREATE_FILE_DESTDE> to an incomplete filename (for example, DE>+dataDE>), and whenever a command is executed that must create a database file in DE>DB_CREATE_FILE_DESTDE>, the file is created in the designated disk group and assigned a unique fully qualified name. You can use an incomplete filename in other DE>*_DESTDE> initialization parameters.

Fully qualified File Name Form

A fully qualified form can be used 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:

DE>+diskgroup/dbname/filetype/filetypetag.file.incarnationDE>

Where:

  • DE>+diskgroupDE> is the disk group name preceded by a plus sign.

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

  • DE>dbnameDE> is the DE>DB_UNIQUE_NAMEDE> of the database to which the file belongs.

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

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

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

An example of a fully qualified Oracle ASM filename is:

DE>+data/orcl/controlfile/Current.256.541956473DE>

Table 7-3 Oracle File Types and Oracle ASM File Type Tags

Oracle ASM File Type Description Oracle ASM File Type Tag Comments

DE>CONTROLFILEDE>

Control files and backup control files

Current

Backup

Archive

Backup

DE>DATAFILEDE>

Data files and data file copies

DE>tblspnameDE>

Name of the tablespace into which the file is added

DE>ONLINELOGDE>

Online logs

DE>group_DE>DE>loggroup#DE>

 

DE>ARCHIVELOGDE>

Archive logs

DE>thread_DE>DE>thread#DE>DE>_seq_DE>DE>sequence#DE>

 

DE>TEMPFILEDE>

Tempfiles

DE>tsnameDE>

Name of the tablespace into which the file is added

DE>BACKUPSETDE>

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

DE>spfile?DE>_DE>timestampDE>

DE>spfile?DE> can take one of two values: DE>sDE> indicates that the backup set includes the DE>spfileDE>; DE>nDE> indicates that the backup set does not include the DE>spfileDE>.

DE>timestampDE> is the time that the backup is started.

DE>PARAMETERFILEDE>

Persistent parameter files

DE>spfileDE>

Name of the SPFILE

DE>DATAGUARDCONFIGDE>

Data Guard configuration file

DE>db-unique-nameDE>

Data Guard uses the value of the DE>DB_UNIQUE_NAMEDE> initialization parameter.

DE>FLASHBACKDE>

Flashback logs

DE>log_DE>DE>flashbacklog#DE>

 

DE>CHANGETRACKINGDE>

Block change tracking data

DE>ctfDE>

Used during incremental backups

DE>DUMPSETDE>

Data Pump dumpset

DE>userDE>_DE>obj#DE>_DE>file#DE>

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

DE>XTRANSPORTDE>

Data file convert

DE>tblspnameDE>

Name of the tablespace into the Oracle ASM metadata is added

DE>AUTOBACKUPDE>

Automatic backup files

DE>spfile?DE>_DE>timestampDE>

DE>spfile?DE> can take one of two values: DE>sDE> indicates that the backup set includes the DE>spfileDE>; DE>nDE> indicates that the backup set does not include the DE>spfileDE>.

DE>timestampDE> is the time that the backup is started.

DE>ASMPARAMETERFILEDE>

Oracle ASM persistent parameter files

DE>spfileDE>

Name of the Oracle ASM SPFILE

DE>OCRFILEDE>

Oracle Clusterware Registry files

DE>ocrfileDE>

Name of the OCR files


Alias Oracle ASM Filename Forms

Alias Oracle ASM filenames can be used 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 (DE>+DE>).

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 DE>USERS.259.685366091DE>. Examples of Oracle ASM alias filenames are:


DE>+data/orcl/control_file1DE>
DE>+fra/recover/second.dbfDE>

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 DE>V$DATAFILEDE> view shows the alias filename.

  • When a control file points to data files and online redo log files, it can use alias filenames.

  • The DE>CONTROL_FILESDE> initialization parameter can use the alias filenames of the control files. The 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 DE>my_undo_templateDE>. This example assumes that a directory has been created in disk group DE>dataDE> 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 be 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:

DE>+diskgroup(templatename)/aliasDE>

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:

DE>+data(mytemplate)/config1DE>

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, the DE>DATAFILEDE> template is used.

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

DE>+dataDE>

With this setting, every time you create a tablespace, a data file is created in the disk group DE>dataDE>, 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 DE>DB_CREATE_FILE_DESTDE> initialization parameter to:

DE>+data(mytemplate)DE>

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, DE>DATAFILEDE> 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:

  • DE>DB_CREATE_FILE_DESTDE>

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

  • DE>DB_CREATE_ONLINE_LOG_DEST_DE>DE>nDE>

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

  • DE>DB_RECOVERY_FILE_DESTDE>

    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 DE>DB_CREATE_ONLINE_LOG_DEST_DE>DE>nDE> and DE>CONTROL_FILESDE> are not specified.

  • DE>CONTROL_FILESDE>

    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:

  • DE>LOG_ARCHIVE_DEST_DE>DE>nDE>

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

  • DE>LOG_ARCHIVE_DESTDE>

    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.

  • DE>STANDBY_ARCHIVE_DESTDE>

    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 DE>CREATEDE> DE>TABLESPACEDE> 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 DE>DB_CREATE_FILE_DESTDE> initialization parameter has been set to DE>+dataDE>.

SQL> CREATE TABLESPACE mytblspace;  

Oracle ASM automatically creates and manages the data file for DE>mytblspaceDE> on Oracle ASM disks in the disk group DE>dataDE>. 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, use the creation form of an Oracle ASM filename. If the Oracle ASM file exists, you must use the reference form of the filename, and if you are trying to re-create the file, you must add the DE>REUSEDE> 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 DE>REUSEDE> keyword and the file does not exist, an error results.

Example 7-2 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 DE>mytblspaceDE> is created and is comprised of one data file of size 200 MB contained in the disk group DE>dataDE>. The data file is set to auto-extensible with an unlimited maximum size. An DE>AUTOEXTENDDE> clause can be used 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 DE>ADD ALIASDE> clause of the DE>ALTER DISKGROUPDE> 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 (DE>+DE>).

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 DE>ADDDE> DE>ALIASDE> clause of the DE>ALTER DISKGROUPDE> 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 DE>RENAME ALIASDE> clause of the DE>ALTER DISKGROUPDE> 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 Example: 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 DE>DROP ALIASDE> clause of the DE>ALTER DISKGROUPDE> 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 DE>DROPDE> DE>FILEDE> clause of the DE>ALTER DISKGROUPDE> 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 Files and Associated Aliases from a Disk Group

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 Files and Associated Aliases from a Disk Group

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:

DE>+data/orcl/CONTROLFILE/Current.256.541956473DE>

The plus sign represents the root of the Oracle ASM file system. The DE>dataDE> directory is the parent directory for all files in the DE>dataDE> disk group. The DE>orclDE> directory is the parent directory for all files in the DE>orclDE> database, and the DE>CONTROLFILEDE> directory contains all control files for the DE>orclDE> 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 DE>ALTER DISKGROUPDE> 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 New Directory

Use the DE>ADD DIRECTORYDE> clause of the DE>ALTER DISKGROUPDE> 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 DE>dataDE>, which can contain, for example, the alias name DE>+data/orcl/control_file1DE>.

Example 7-9 Creating a New Directory

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

Assuming no subdirectory exists under the directory DE>+data/orclDE>, 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 DE>RENAME DIRECTORYDE> clause of the DE>ALTER DISKGROUPDE> 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 DE>DROP DIRECTORYDE> clause of the DE>ALTER DISKGROUPDE> statement. You cannot drop a system-created directory. You cannot drop a directory containing alias names unless you also specify the DE>FORCEDE> 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 DE>/sys/asmDE>. The folder is virtual because its contents do not actually reside in the repository; they exist as normal Oracle ASM files and directories. DE>/sys/asmDE> provides a means to access and manipulate the Oracle ASM files and directories with programmatic APIs such as the DE>DBMS_XDBDE> package and with XML DB protocols such as FTP and HTTP/WebDAV. You can also use the ASMCMD DE>cpDE> command to copy files. See "cp".

A typical use for this capability might be to view DE>/sys/asmDE> 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 DE>SYSDE> and you must have been granted the DE>DBADE> role to access DE>/sys/asmDE> 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 DE>ftp-portDE> parameter to the FTP port to use, such as DE>2100DE>.

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 DE>/sys/asmDE> 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

oracle database storage administrators guide 11gR2-7 - yangzhongfei - 阿飞的技术博客

Desc="img_text/ostmg006.htm" height=402>
Description of "Figure 7-1 Hierarchical Structure of Oracle ASM Folders in an XML DB Installation"

The following are usage restrictions on DE>/sys/asmDE>:

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

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

You can use the directory DE>/sys/asmDE> for storing the names of disk groups. You cannot store other files in this directory. Within the disk group directories under DE>/sys/asmDE>, such as DE>/sys/asm/DATADE>, 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 DE>DBMS_FILE_TRANSFERDE> package provides procedures to copy Oracle ASM files within a database or to transfer binary files between databases that use Oracle ASM. The DE>DBMS_FILE_TRANSFERDE> package has the following procedures:

  • DE>COPY_FILEDE>—Reads a file from a source directory and creates a copy of the file in a destination directory. The source and destination directories can both be in a local file system or in an Oracle ASM disk group. You can also use this procedure to copy between a local file system and an Oracle ASM disk group; the copy operation is valid in either direction.

  • DE>GET_FILEDE>—Contacts a remote database to read a remote file and then creates a copy of the file in the local file system or Oracle ASM disk group.

  • DE>PUT_FILEDE>—Reads a local file or Oracle ASM disk group and contacts a remote database to create a copy of the file in the remote file system.

See Also:

Oracle Database PL/SQL Packages and Types Reference for more information about the DE>DBMS_FILE_TRANSFERDE> 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 DE>ONLINELOGDE> 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 (DE>ONLINELOGDE> template) for a normal redundancy disk group is DE>MIRRORDE>. 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 DE>controller1DE>, a mirrored copy of the file extent is written to a disk in failure group DE>controller2DE>. 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 DE>ALTER DISKGROUPDE> 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 DE>V$ASM_TEMPLATEDE> view lists all of the templates known to the Oracle ASM instance. For an example of the information displayed in the DE>V$ASM_TEMPLATEDE> 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 DE>STRIPEDE> column of DE>V$ASM_TEMPLATEDE>.

Table 7-4 Permitted Values for Oracle ASM Template Striping Attribute

Striping Attribute Value Description

DE>FINEDE>

Striping in 128 KB chunks.

DE>COARSEDE>

Striping in 1 MB chunks.


Table 7-5 shows the permitted redundancy values for Oracle ASM templates. These values correspond to the DE>REDUNDDE> column of DE>V$ASM_TEMPLATEDE>.

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

DE>MIRRORDE>

Two-way mirroring

Three-way mirroring

(Not allowed)

DE>HIGHDE>

Three-way mirroring

Three-way mirroring

(Not allowed)

DE>UNPROTECTEDDE>

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 DE>MIRRORDE> in Table 7-6. In Table 7-5, the DE>MIRRORDE> value for high redundancy disk groups corresponds to DE>Three-wayDE> DE>mirroringDE>.

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

DE>CONTROLFILEDE>

DE>FINEDE>

DE>HIGHDE>

DE>MIRRORDE>

DE>UNPROTECTEDDE>

DE>COLDDE>

DE>MIRRORCOLDDE>

DE>DATAFILEDE>

DE>COARSEDE>

DE>MIRRORDE>

DE>MIRRORDE>

DE>UNPROTECTEDDE>

DE>COLDDE>

DE>MIRRORCOLDDE>

DE>ONLINELOGDE>

DE>COARSEDE>

DE>MIRRORDE>

DE>MIRRORDE>

DE>UNPROTECTEDDE>

DE>COLDDE>

DE>MIRRORCOLDDE>

DE>ARCHIVELOGDE>

DE>COARSEDE>

DE>MIRRORDE>

DE>MIRRORDE>

DE>UNPROTECTEDDE>

DE>COLDDE>

DE>MIRRORCOLDDE>

DE>TEMPFILEDE>

DE>COARSEDE>

DE>MIRRORDE>

DE>MIRRORDE>

DE>UNPROTECTEDDE>

DE>COLDDE>

DE>MIRRORCOLDDE>

DE>BACKUPSETDE>

DE>COARSEDE>

DE>MIRRORDE>

DE>MIRRORDE>

DE>UNPROTECTEDDE>

DE>COLDDE>

DE>MIRRORCOLDDE>

DE>PARAMETERFILEDE>

DE>COARSEDE>

DE>MIRRORDE>

DE>MIRRORDE>

DE>UNPROTECTEDDE>

DE>COLDDE>

DE>MIRRORCOLDDE>

DE>DATAGUARDCONFIGDE>

DE>COARSEDE>

DE>MIRRORDE>

DE>MIRRORDE>

DE>UNPROTECTEDDE>

DE>COLDDE>

DE>MIRRORCOLDDE>

DE>FLASHBACKDE>

DE>COARSEDE>

DE>MIRRORDE>

DE>MIRRORDE>

DE>UNPROTECTEDDE>

DE>COLDDE>

DE>MIRRORCOLDDE>

DE>CHANGETRACKINGDE>

DE>COARSEDE>

DE>MIRRORDE>

DE>MIRRORDE>

DE>UNPROTECTEDDE>

DE>COLDDE>

DE>MIRRORCOLDDE>

DE>DUMPSETDE>

DE>COARSEDE>

DE>MIRRORDE>

DE>MIRRORDE>

DE>UNPROTECTEDDE>

DE>COLDDE>

DE>MIRRORCOLDDE>

DE>XTRANSPORTDE>

DE>COARSEDE>

DE>MIRRORDE>

DE>MIRRORDE>

DE>UNPROTECTEDDE>

DE>COLDDE>

DE>MIRRORCOLDDE>

DE>AUTOBACKUPDE>

DE>COARSEDE>

DE>MIRRORDE>

DE>MIRRORDE>

DE>UNPROTECTEDDE>

DE>COLDDE>

DE>MIRRORCOLDDE>

DE>ASMPARAMETERFILEDE>

DE>COARSEDE>

DE>MIRRORDE>

DE>MIRRORDE>

DE>UNPROTECTEDDE>

DE>COLDDE>

DE>MIRRORCOLDDE>

DE>OCRFILEDE>

DE>COARSEDE>

DE>MIRRORDE>

DE>MIRRORDE>

DE>UNPROTECTEDDE>

DE>COLDDE>

DE>MIRRORCOLDDE>


Table 7-7 shows the permitted primary and mirror region values for Oracle ASM templates. These values correspond to the DE>PRIMARY_REGIONDE> and DE>MIRROR_REGIONDE> columns of DE>V$ASM_TEMPLATEDE>. 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

DE>COLDDE>, DE>MIRRORCOLDDE>

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

DE>HOTDE>, DE>MIRRORHOTDE>

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 DE>ADD TEMPLATEDE> clause of the DE>ALTER DISKGROUPDE> 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, the value defaults to DE>MIRRORDE> for a normal redundancy disk group, DE>HIGHDE> for a high redundancy disk group, and DE>UNPROTECTEDDE> for an external redundancy disk group. If you do not specify a striping attribute, then the value defaults to DE>COARSEDE>. If you do not specify a value for the primary or mirror region attributes, then the value defaults to DE>COLDDE> and DE>MIRRORCOLDDE> respectively.

Example 7-13 creates a new template named DE>reliableDE> for the normal redundancy disk group DE>dataDE>.

Example 7-13 Adding a Template to a Disk Group

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

Example 7-14 creates a new template named DE>unreliableDE> that specifies files are to be unprotected (no mirroring).

Example 7-14 Adding a Template 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 DE>ALTER DISKGROUP...ADD TEMPLATEDE> command.

Modifying a Disk Group Template

The DE>MODIFY TEMPLATEDE> clause of the DE>ALTER DISKGROUPDE> 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 DE>reliableDE> template for disk group DE>dataDE>.

Example 7-15 Modifying a Disk Group Template

ALTER DISKGROUP data MODIFY TEMPLATE reliable        ATTRIBUTES (COARSE);  

Dropping Templates from a Disk Group

Use the DE>DROP TEMPLATEDE> clause of the DE>ALTER DISKGROUPDE> 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 DE>unreliableDE> from DE>dataDE>:

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 DE>ALTERDE> DE>SYSTEMDE> and DE>CREATEDE> DE>TABLESPACEDE> 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 (DE>mytemplateDE>) 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;



引文来源  Administering Oracle ASM Files, Directories, and Templates
  评论这张
 
阅读(1162)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018