asm中template特性測試!

warehouse發表於2009-06-08

都是doc的內容:

Templates are used to set redundancy (mirroring) and striping attributes of files created in an 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, 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) supported by ASM. For example, a template named ONLINELOG provides the default file redundancy and striping attributes for all redo log files written to ASM disks. Default template settings depend on the disk group type. For example, the default template for datafiles for a normal redundancy disk group sets 2-way mirroring, while the corresponding default template in a high redundancy disk group sets 3-way mirroring.You can modify these default templates. Table 12-5 lists the default templates and the attributes that they apply 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.

Note:

The striping attribute of templates applies to all disk group types (normal redundancy, high redundancy, and external redundancy). However, the mirroring attribute of templates applies only to normal redundancy disk groups, and is ignored for high-redundancy disk groups (where every file is always 3-way mirrored) and external redundancy disk groups (where no files are mirrored by ASM). Nevertheless, each type of disk group gets a full set of templates, and the redundancy value in each template is always set to the proper default for the disk group type.
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 on an individual file basis rather than on the basis of file type.The V$ASM_TEMPLATE view lists all of the templates known to the ASM instance.

[@more@]

--==================================
SQL> alter diskgroup dg add template my_template attributes (high fine);

Diskgroup altered.

SQL> select * from v$asm_template;

GROUP_NUMBER ENTRY_NUMBER REDUNDANCY STRIPE SY NAME
------------ ------------ ------------ ------------ -- --------------------
1 0 MIRROR COARSE Y PARAMETERFILE
1 1 MIRROR COARSE Y DUMPSET
1 2 HIGH FINE Y CONTROLFILE
1 3 MIRROR COARSE Y ARCHIVELOG
1 4 MIRROR FINE Y ONLINELOG
1 5 MIRROR COARSE Y DATAFILE
1 6 MIRROR COARSE Y TEMPFILE
1 7 MIRROR COARSE Y BACKUPSET
1 8 MIRROR COARSE Y AUTOBACKUP
1 9 MIRROR COARSE Y XTRANSPORT
1 10 MIRROR COARSE Y CHANGETRACKING

GROUP_NUMBER ENTRY_NUMBER REDUNDANCY STRIPE SY NAME
------------ ------------ ------------ ------------ -- --------------------
1 11 MIRROR FINE Y FLASHBACK
1 12 MIRROR COARSE Y DATAGUARDCONFIG
1 13 HIGH FINE N MY_TEMPLATE

14 rows selected.

SQL>
SQL> alter database add logfile '+DG(my_template)/asmdb/redo04.log' size 5m;

資料庫已更改。

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------

+DG/asmdb/redo03.log
+DG/asmdb/redo02.log
+DG/asmdb/redo01.log
+DG/asmdb/redo04.log

SQL> select group#,members from v$log;

GROUP# MEMBERS
---------- ----------
1 1
2 1
3 1
4 1

SQL>
--===============================
ASMCMD> pwd
+dg/asmdb/onlinelog
ASMCMD> ls
group_1.259.688401431
group_2.260.688401433
group_3.261.688401433
group_4.269.689006953
ASMCMD>
--===============================
SQL> select redundancy,striped,type from v$asm_file where file_number=269;

REDUNDANCY STRIPED TYPE
------------ ------------ --------------------
HIGH FINE ONLINELOG

SQL>
很顯然redo group 4繼承了模板my_template的REDUNDANCY和STRIPED特性

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/19602/viewspace-1022888/,如需轉載,請註明出處,否則將追究法律責任。

相關文章