asm支持的文件类型
Table 12-6 File TypesSupported by Automatic Storage Management
File Type | Supported | Default Templates |
Control files | yes | CONTROLFILE |
Datafiles | yes | DATAFILE |
Redo log files | yes | ONLINELOG |
Archive log files | yes | ARCHIVELOG |
Trace files | no | n/a |
Temporary files | yes | TEMPFILE |
Datafile backup pieces | yes | BACKUPSET |
Datafile incremental backup pieces | yes | BACKUPSET |
Archive log backup piece | yes | BACKUPSET |
Datafile copy | yes | DATAFILE |
Persistent initialization parameter file (SPFILE) | yes | PARAMETERFILE |
Disaster recovery configurations | yes | DATAGUARDCONFIG |
Flashback logs | yes | FLASHBACK |
Change tracking file | yes | CHANGETRACKING |
Data Pump dumpset | yes | DUMPSET |
Automatically generated control file backup | yes | AUTOBACKUP |
Cross-platform transportable datafiles | yes | XTRANSPORT |
Operating system files | no | n/a |
在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:
DB_CREATE_FILE_DEST = '+dgroup2'
The following statement creates the tablespace and its datafile:
CREATE TABLESPACE tspace2;
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:
SQL> ALTER SYSTEM SET DB_CREATE_FILE_DEST = '+dgroup1(my_template)'; SQL> CREATE TABLESPACE tspace3;
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 my_undo_template
. It assumes a directory has been created in disk group dgroup3
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.
CREATE UNDO TABLESPACE myundo DATAFILE '+dgroup3(my_undo_template)/myfiles/my_undo_ts' SIZE 200M;
The following statement drops the file manually after the tablespace has been dropped:
ALTER DISKGROUP dgroup3 DROP FILE '+dgroup3/myfiles/my_undo_ts';
Creating Redo Logs in ASM
Online redo logs can be created in multiple disk groups, either implicitly in the initialization parameter file or explicitly in an ALTER DATABASE...ADD LOGFILE
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 dgroup1
and dgroup2
.
The following parameter settings are included in the initialization parameter file:
DB_CREATE_ONLINE_LOG_DEST_1 = '+dgroup1' DB_CREATE_ONLINE_LOG_DEST_2 = '+dgroup2'
The following statement is issued at the SQL prompt:
ALTER DATABASE ADD LOGFILE;
Creating a Control File in ASM
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 CONTROL_FILES
initialization parameter. Control files created without aliases can be given alias names at a later time. The ALTER
DISKGROUP...CREATE
ALIAS
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 CREATE
CONTROLFILE
command using the file reference context form of their ASM filenames. However, the use of the RESETLOGS
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 CREATE
CONTROLFILE
statement is generated by an ALTER
DATABASE
BACKUP
CONTROLFILE
TO
TRACE
command for a database with datafiles and log files created on disk groups dgroup1
and dgroup2
:
CREATE CONTROLFILE REUSE DATABASE "SAMPLE" NORESETLOGS ARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 2 MAXDATAFILES 30 MAXINSTANCES 1 MAXLOGHISTORY 226 LOGFILE GROUP 1 ( '+DGROUP1/db/onlinelog/group_1.258.541956457', '+DGROUP2/db/onlinelog/group_1.256.541956473' ) SIZE 100M, GROUP 2 ( '+DGROUP1/db/onlinelog/group_2.257.541956477', '+DGROUP2/db/onlinelog/group_2.258.541956487' ) SIZE 100M DATAFILE '+DGROUP1/db/datafile/system.260.541956497', '+DGROUP1/db/datafile/sysaux.259.541956511' CHARACTER SET US7ASCII ;
Creating a Control File in ASM: Example 2
This example is a CREATE
CONTROLFILE
statement for a database with datafiles, but uses a RESETLOGS
clause, and thus uses the creation context form for log files:
CREATE CONTROLFILE REUSE DATABASE "SAMPLE" RESETLOGS ARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 2 MAXDATAFILES 30 MAXINSTANCES 1 MAXLOGHISTORY 226 LOGFILE GROUP 1 ( '+DGROUP1', '+DGROUP2' ) SIZE 100M, GROUP 2 ( '+DGROUP1', '+DGROUP2' ) SIZE 100M DATAFILE '+DGROUP1/db/datafile/system.260.541956497', '+DGROUP1/db/datafile/sysaux.259.541956511' CHARACTER SET US7ASCII ;
Creating Archive Log Files in ASM
Disk groups can be specified as archive log destinations in the LOG_ARCHIVE_DEST
and LOG_ARCHIVE_DEST_n
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 LOG_ARCHIVE_DEST
is set to a disk group name, LOG_ARCHIVE_FORMAT
is ignored. Unique filenames for archived logs are automatically created by the Oracle database. If LOG_ARCHIVE_DEST
is set to a directory in a disk group, LOG_ARCHIVE_FORMAT
has its normal semantics.
The following sample archive log names might be generated with DB_RECOVERY_FILE_DEST
set to +dgroup2
. SAMPLE is the value of the DB_UNIQUE_NAME
parameter:
+DGROUP2/SAMPLE/ARCHIVELOG/2003_09_23/thread_1_seq_38.614.541956473 +DGROUP2/SAMPLE/ARCHIVELOG/2003_09_23/thread_4_seq_35.609.541956477 +DGROUP2/SAMPLE/ARCHIVELOG/2003_09_23/thread_2_seq_34.603.541956487 +DGROUP2/SAMPLE/ARCHIVELOG/2003_09_25/thread_3_seq_100.621.541956497 +DGROUP2/SAMPLE/ARCHIVELOG/2003_09_25/thread_1_seq_38.614.541956511
查看asm的视图
View | Description |
---|---|
V$ASM_DISKGROUP | 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. |
V$ASM_DISK | 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. This view performs disk discovery every time it is queried. |
V$ASM_DISKGROUP_STAT | 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. |
V$ASM_DISK_STAT | 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. |
V$ASM_FILE | 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. |
V$ASM_TEMPLATE | In an ASM or DB instance, contains one row for every template present in every disk group mounted by the ASM instance. |
V$ASM_ALIAS | In an ASM instance, contains one row for every alias present in every disk group mounted by the ASM instance. In a DB instance, contains no rows. |
V$ASM_OPERATION | In an ASM instance, contains one row for every active ASM long running operation executing in the ASM instance. In a DB instance, contains no rows. |
V$ASM_CLIENT | 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. |