本帖最后由 郑全 于 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
|