重庆思庄Oracle、Redhat认证学习论坛

标题: ORACLE 12cr2开始的flex diskgroup [打印本页]

作者: 郑全    时间: 2023-4-12 14:58
标题: ORACLE 12cr2开始的flex diskgroup
本帖最后由 郑全 于 2023-4-12 15:00 编辑

直接上官方文档吧:原文见:https://docs.oracle.com/en/datab ... 8-A721-E8B97D574632

About Oracle ASM Flex Disk Groups
An Oracle ASM flex disk group is a disk group type that supports Oracle ASM file groups and quota groups.
In general, a flex disk group enables users to manage storage at the granularity of the database, in addition to at the disk group level.
The following are characteristics of a flex disk group:
  • The redundancy of files in a flex disk group is flexible and enables storage management at the database level.
  • File groups of flex disk groups are used to describe database files.
    Each database has its own file group, and storage management can be done at the file group level, in addition to the disk group level. For example, you can specify different redundancy and rebalance settings for different file groups. File groups are associated with a quota group, enabling easy quota management.
  • The redundancy setting of a flex disk group is set to FLEX REDUNDANCY and each file group of the flex disk group has its own redundancy property setting.
  • A flex disk group generally tolerates two failures, the same as a HIGH redundancy disk group.
    However, if the disk group has fewer than five failure groups, then it can only tolerate one failure. This restriction is the result of the quorum requirement of the disk group.
  • The failure tolerated by a database is dependent on the redundancy setting of its associated file group in the flex disk group.
  • A flex disk group requires a minimum of three failure groups.
  • If a disk group with FLEX REDUNDANCY has only two regular failure groups and one quorum failure group, then only two copies of the data are stored, even if HIGH REDUNDANCY is selected for a database file in the flex disk group. This behavior is a consequence of having only two regular failure groups. However, if an additional regular failure group is added later, then a third copy of the data is created automatically. After the addition of the regular failure group, if one failure group is lost and a rebalance completes successfully, then the disk group can remain mounted after a second failure group goes offline.
  • Migrating (converting) to a flex disk group can be performed for a NORMAL or HIGH redundancy disk group with the CONVERT REDUNDANCY TO FLEX clause of the ALTER DISKGROUP SQL statement. You cannot migrate an EXTERNAL redundancy disk group to a FLEX redundancy disk group.
    Note:

    • When migrating to a flex disk group, a disk group with NORMAL redundancy must have a minimum of three failure groups and a disk group with HIGH redundancy must have a minimum of five failure groups.
    • The Virtual Allocation Metadata (VAM) migration disk group attribute must be enabled and the migration completed before migrating without the use of a restrictive mount.

  • A flex disk group enables the creation of point-in-time database clones.
    A point-in-time database clone is a full copy of a specific database, not the underlying storage system. Only data files are copied. Other files are created, or referenced as required to create the clone. For information about flex disk groups and point-in-time database clones, refer to About Point-In-Time Database Cloning With Oracle ASM Flex Disk Groups.
  • The default size of the allocation unit (AU) is 4 M.
  • The Virtually Allocated Metadata (VAM) is enabled and required for a flex disk group.
  • Flex disk groups require the COMPATIBLE.ASM and COMPATIBLE.RDBMS disk group attributes to be set at 12.2 or greater.
  • To create an Oracle ADVM volume on a flex disk group, the COMPATIBLE.ADVM disk group attribute must be set to 12.2 or greater.

Note:
The REQUIRED_MIRROR_FREE_MB and USABLE_FILE_MB columns in the V$ASM_DISKGROUP view report no values for a flex disk group.

The following examples illustrate how to use SQL statements to:
  • Create a flex disk group
  • Migrate a normal disk group to a flex disk group

Example 4-13 Using CREATE DISKGROUP to create a flex disk group


CopySQL> CREATE DISKGROUP flex_data FLEX REDUNDANCY DISK my_disk_discovery_path;


Example 4-14 Using ALTER DISKGROUP to migrate a normal disk group to a flex disk group


SQL> CREATE DISKGROUP normaltoflex NORMAL REDUNDANCY  DISK '/devices/diskm*'  
           ATTRIBUTE
             'au_size'='4M',   
              'compatible.asm' = '19.0',     
               'compatible.rdbms' = '19.0',   
                 'compatible.advm' = '19.0';
Diskgroup created.


SQL> ALTER DISKGROUP normaltoflex CONVERT REDUNDANCY TO FLEX;
Diskgroup altered.


SQL> SELECT name, type FROM V$ASM_DISKGROUP WHERE name = 'NORMALTOFLEX';
NAME                           TYPE
------------------------------ ------
NORMALTOFLEX                   FLEX


作者: 郑全    时间: 2023-8-27 11:02
本帖最后由 郑全 于 2023-8-27 11:14 编辑

要求:
      磁盘必须是3个以上
      compatible.asm 必须是12.2以上
      compatible.rdbms 必须是12.2以上
      如果要创建ADVM,compatible.advm必须是12.2以上

--1.直接创建FLEX磁盘组
   SQL> create diskgroup dgflex flex redundancy disk '/dev/asmdisk15','/dev/asmdisk16','/dev/asmdisk17';

Diskgroup created.

--2.通过NORMAL磁盘组转换
   --2.1 创建NORMAL 磁盘组
   SQL> create diskgroup normaltoflex normal redundancy disk '/dev/asmdisk15','/dev/asmdisk16';

   --2.2 限制模式转转
   SQL> alter diskgroup normaltoflex convert redundancy to flex;
alter diskgroup normaltoflex convert redundancy to flex
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15419: disk group NORMALTOFLEX is not mounted in restricted mode


SQL> alter diskgroup normaltoflex dismount;

Diskgroup altered.

SQL> alter diskgroup normaltoflex mount restricted;

Diskgroup altered.

--2.3 要求asm兼容参数为12.2以上
SQL> alter diskgroup normaltoflex convert redundancy to flex;
alter diskgroup normaltoflex convert redundancy to flex
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15221: ASM operation requires compatible.asm of 12.2.0.0.0 or higher

QL> select name,state,type,COMPATIBILITY from v$asm_diskgroup;

NAME                           STATE       TYPE   COMPATIBILITY
------------------------------ ----------- ------ ------------------------------------------------------------
。。。
NORMALTOFLEX                   RESTRICTED  NORMAL 11.2.0.2.0


SQL> create diskgroup normaltoflex normal redundancy disk '/dev/asmdisk15','/dev/asmdisk16'
  2     attribute
  3       'compatible.asm'='12.2.0.1',
  4        'compatible.rdbms'='12.2.0.1';

Diskgroup created.

SQL> alter diskgroup normaltoflex mount restricted;

Diskgroup altered.

SQL> alter diskgroup normaltoflex convert redundancy to flex;

Diskgroup altered.
--2.4 要求3个磁盘
SQL>  alter diskgroup normaltoflex convert redundancy to flex;
alter diskgroup normaltoflex convert redundancy to flex
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15167: command requires at least 3 failure groups; found only 2

SQL> create diskgroup normaltoflex normal redundancy disk '/dev/asmdisk15','/dev/asmdisk16','/dev/asmdisk17'
  2     attribute
  3       'compatible.asm'='12.2.0.1',
  4        'compatible.rdbms'='12.2.0.1';

Diskgroup created.

SQL> alter diskgroup normaltoflex mount restricted;

Diskgroup altered.

SQL> alter diskgroup normaltoflex convert redundancy to flex;

Diskgroup altered.

--3.验证信息

SQL> select dskgrp.GROUP_NUMBER ,dskgrp.name dskgrpname, attr.NAME as attrname,attr.VALUE,dskgrp.state
               FROM  V$ASM_ATTRIBUTE attr,v$asm_diskgroup dskgrp
              WHERE attr.group_number=dskgrp.group_number
               and dskgrp.name='NORMALTOFLEX'
               and (UPPER(attr.NAME) like '%COMP%' OR UPPER(attr.NAME) LIKE '%AU_SIZE%');

GROUP_NUMBER DSKGRPNAME           ATTRNAME                       VALUE                          STATE
------------ -------------------- ------------------------------ ------------------------------ -----------
           5 NORMALTOFLEX         compatible.asm                 12.2.0.1.0                     RESTRICTED
           5 NORMALTOFLEX         au_size                        1048576                        RESTRICTED
           5 NORMALTOFLEX         compatible.rdbms               12.2.0.1.0                     RESTRICTED

--发现是限制模式打开,要使用,需要正常模式打开

SQL> alter diskgroup normaltoflex dismount;

Diskgroup altered.

SQL> alter diskgroup normaltoflex mount;

Diskgroup altered.

SQL> select dskgrp.GROUP_NUMBER ,dskgrp.name dskgrpname, attr.NAME as attrname,attr.VALUE,dskgrp.state
  2                 FROM  V$ASM_ATTRIBUTE attr,v$asm_diskgroup dskgrp
  3                WHERE attr.group_number=dskgrp.group_number
  4                 and dskgrp.name='NORMALTOFLEX'
  5                 and (UPPER(attr.NAME) like '%COMP%' OR UPPER(attr.NAME) LIKE '%AU_SIZE%');

GROUP_NUMBER DSKGRPNAME           ATTRNAME                       VALUE                          STATE
------------ -------------------- ------------------------------ ------------------------------ -----------
           5 NORMALTOFLEX         compatible.asm                 12.2.0.1.0                     MOUNTED
           5 NORMALTOFLEX         au_size                        1048576                        MOUNTED
           5 NORMALTOFLEX         compatible.rdbms               12.2.0.1.0                     MOUNTED




SQL> select grp.name as dskgrpname,grp.type,dsk.name dskname,path,label,FAILGROUP ,os_mb,dsk.free_mb
  2        from v$asm_diskgroup grp,
  3             v$asm_disk dsk
  4       where grp.group_number=dsk.group_number
  5         and grp.name ='NORMALTOFLEX'
  6  ;

DSKGRPNAME           TYPE   DSKNAME                        PATH                 LABEL      FAILGROUP                           OS_MB    FREE_MB
-------------------- ------ ------------------------------ -------------------- ---------- ------------------------------ ---------- ----------
NORMALTOFLEX         FLEX   NORMALTOFLEX_0000              /dev/asmdisk15                  NORMALTOFLEX_0000                    3072       2989
NORMALTOFLEX         FLEX   NORMALTOFLEX_0002              /dev/asmdisk17                  NORMALTOFLEX_0002                    3072       2989
NORMALTOFLEX         FLEX   NORMALTOFLEX_0001              /dev/asmdisk16                  NORMALTOFLEX_0001                    3072       2989







欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2