asm支持的文件类型
Table 12-6 File TypesSupported by Automatic Storage Management
File Type
Supported
Default Templates
Control files
yes
CONTROLFILE
Datafiles
DATAFILE
Redo log files
ONLINELOG
Archive log files
ARCHIVELOG
Trace files
no
n/a
Temporary files
TEMPFILE
Datafile backup pieces
BACKUPSET
Datafile incremental backup pieces
Archive log backup piece
Datafile copy
Persistent initialization parameter file (SPFILE)
PARAMETERFILE
Disaster recovery configurations
DATAGUARDCONFIG
Flashback logs
FLASHBACK
Change tracking file
CHANGETRACKING
Data Pump dumpset
DUMPSET
Automatically generated control file backup
AUTOBACKUP
Cross-platform transportable datafiles
XTRANSPORT
Operating system files
在asm中创建表空间
Creating a Tablespace in ASM: Example 1
This example illustrates "out of the box" usage of Automatic Storage Management. You let Automatic Storage Management create and manage the tablespace datafile for you, using Oracle supplied defaults that are adequate for most situations.
Assume the following initialization parameter setting:
The following statement creates the tablespace and its datafile:
Creating a Tablespace in ASM: Example 2
The following statements create a tablespace that uses a user defined template (assume it has been defined) to specify the redundancy and striping attributes of the datafile:
Creating a Tablespace in ASM: Example 3
The following statement creates an undo tablespace with a datafile that has an alias name, and with attributes that are set by the user defined template <code>my_undo_template</code>. It assumes a directory has been created in disk group <code>dgroup3</code> to contain the alias name and that the user defined template exists. Because an alias is used to create the datafile, the file is not an Oracle-managed file and will not be automatically deleted when the tablespace is dropped.
The following statement drops the file manually after the tablespace has been dropped:
Online redo logs can be created in multiple disk groups, either implicitly in the initialization parameter file or explicitly in an <code>ALTER DATABASE...ADD LOGFILE</code> statement. Each online log should have one log member in multiple disk groups. The filenames for log file members are automatically generated.
All partially created redo log files, created as a result of a system error, are automatically deleted.
Adding New Redo Log Files: Example
The following example creates a log file with a member in each of the disk groups <code>dgroup1</code> and <code>dgroup2</code>.
The following parameter settings are included in the initialization parameter file:
The following statement is issued at the SQL prompt:
Control files can be explicitly created in multiple disk groups. The filenames for control files are automatically generated. If an attempt to create a control file fails, partially created control files will be automatically be deleted.
There may be times when you need to specify a control file by name. Alias filenames are provided to allow administrators to reference ASM files with human-understandable names. The use of an alias in the specification of the control file during its creation allows the DBA to later refer to the control file with a human-meaningful name. Furthermore, an alias can be specified as a control file name in the <code>CONTROL_FILES</code> initialization parameter. Control files created without aliases can be given alias names at a later time. The <code>ALTER</code> <code>DISKGROUP...CREATE</code> <code>ALIAS</code> statement is used for this purpose.
When creating a control file, datafiles and log files stored in an ASM disk group should be given to the <code>CREATE</code> <code>CONTROLFILE</code> command using the file reference context form of their ASM filenames. However, the use of the <code>RESETLOGS</code> option requires the use of a file creation context form for the specification of the log files.
Creating a Control File in ASM: Example 1
The following <code>CREATE</code> <code>CONTROLFILE</code> statement is generated by an <code>ALTER</code> <code>DATABASE</code> <code>BACKUP</code> <code>CONTROLFILE</code> <code>TO</code> <code>TRACE</code> command for a database with datafiles and log files created on disk groups <code>dgroup1</code> and <code>dgroup2</code>:
Creating a Control File in ASM: Example 2
This example is a <code>CREATE</code> <code>CONTROLFILE</code> statement for a database with datafiles, but uses a <code>RESETLOGS</code> clause, and thus uses the creation context form for log files:
Disk groups can be specified as archive log destinations in the <code>LOG_ARCHIVE_DEST</code> and <code>LOG_ARCHIVE_DEST_n</code> initialization parameters. When destinations are specified in this manner, the archive log filename will be unique, even if archived twice. All partially created archive files, created as a result of a system error, are automatically deleted.
If <code>LOG_ARCHIVE_DEST</code> is set to a disk group name, <code>LOG_ARCHIVE_FORMAT</code> is ignored. Unique filenames for archived logs are automatically created by the Oracle database. If <code>LOG_ARCHIVE_DEST</code> is set to a directory in a disk group, <code>LOG_ARCHIVE_FORMAT</code> has its normal semantics.
The following sample archive log names might be generated with <code>DB_RECOVERY_FILE_DEST</code> set to <code>+dgroup2</code>. SAMPLE is the value of the <code>DB_UNIQUE_NAME</code> parameter:
查看asm的视图
View
Description
<code>V$ASM_DISKGROUP</code>
In an ASM instance, describes a disk group (number, name, size related info, state, and redundancy type).
In a DB instance, contains one row for every ASM disk group mounted by the local ASM instance.
This view performs disk discovery every time it is queried.
<code>V$ASM_DISK</code>
In an ASM instance, contains one row for every disk discovered by the ASM instance, including disks that are not part of any disk group.
In a DB instance, contains rows only for disks in the disk groups in use by that DB instance.
<code>V$ASM_DISKGROUP_STAT</code>
Has the same columns as V$ASM_DISKGROUP, but to reduce overhead, does not perform a discovery when it is queried. It therefore does not return information on any disks that are new to the storage system. For the most accurate data, use V$ASM_DISKGROUP instead.
<code>V$ASM_DISK_STAT</code>
Has the same columns as V$ASM_DISK, but to reduce overhead, does not perform a discovery when it is queried. It therefore does not return information on any disks that are new to the storage system. For the most accurate data, use V$ASM_DISK instead.
<code>V$ASM_FILE</code>
In an ASM instance, contains one row for every ASM file in every disk group mounted by the ASM instance.
In a DB instance, contains no rows.
<code>V$ASM_TEMPLATE</code>
In an ASM or DB instance, contains one row for every template present in every disk group mounted by the ASM instance.
<code>V$ASM_ALIAS</code>
In an ASM instance, contains one row for every alias present in every disk group mounted by the ASM instance.
<code>V$ASM_OPERATION</code>
In an ASM instance, contains one row for every active ASM long running operation executing in the ASM instance.
<code>V$ASM_CLIENT</code>
In an ASM instance, identifies databases using disk groups managed by the ASM instance.
In a DB instance, contains one row for the ASM instance if the database has any open ASM files.