Oracle Automatic Storage Management (ASM)

Oracle ASM Mirroring and Disk Group Redundancy

Disk Group Type Supported Mirroring Levels Default Mirroring Level
EXTERNAL redundancy Unprotected (none) Unprotected
NORMAL redundancy Two-way, three-way, unprotected (none) Two-way
HIGH redundancy Three-way Three-way
FLEX redundancy (12c) Two-way, three-way, unprotected (none) Two-way (newly-created)
EXTENDED redundancy (12c) Two-way, three-way, unprotected (none) Two-way

Setting Disk String

alter system set asm_diskstring='ORCL:*' scope=both sid='*';

select name,path from v$asm_disk;

Creating Disk Groups


-- normal
create diskgroup data normal redundancy
failgroup controller1 disk
'/devices/diska1' name diska1,
'/devices/diska2' name diska2,
'/devices/diska3' name diska3,
'/devices/diska4' name diska4
failgroup controller2 disk
'/devices/diskb1' name diskb1,
'/devices/diskb2' name diskb2,
'/devices/diskb3' name diskb3,
'/devices/diskb4' name diskb4
attribute 'au_size'='4m',
'compatible.asm' = '11.2',
'compatible.rdbms' = '11.2';

-- external
create diskgroup data external redundancy
disk 'ORCL:DATA01','ORCL:DATA02','ORCL:DATA03'
attribute 'compatible.asm' = '11.2';

Disk Group Information

-- 磁盘组文件分布情况
set lines 200 pages 100
select d.name group_name,f.type,count(*) cnt from v$asm_file f
join v$asm_diskgroup d on f.group_number=d.group_number
group by rollup (d.name,f.type);

-- 磁盘组成员,故障组
set lines 200 pages 100
col path for a50
col state for a10
col failgroup for a15
col name for a30
select dg.name,dg.state,dg.type,d.disk_number,d.path,d.mount_status,d.failgroup,d.name,d.state
from v$asm_diskgroup dg, v$asm_disk d
where dg.group_number=d.group_number
order by dg.name,d.disk_number;

Disk Group Compatibility

Valid Combinations of Compatibility Attribute Settings for 11g.

COMPATIBLE.ASM COMPATIBLE.RDBMS COMPATIBLE.ADVM ASM Instance Version COMPATIBLE Setting for RDBMS Instance
10.1 10.1 n/a >= 10.1 >= 10.1
11.1 10.1 n/a >= 11.1 >= 10.1
11.2 11.1 11.2 >= 11.2 >= 11.1
11.2 11.2 11.2 >= 11.2 >= 11.2
set lines 200 pages 100
column name format a10
column compatibility format a20
column database_compatibility format a20
select group_number, name, compatibility, database_compatibility from v$asm_diskgroup;

Using ALTER DISKGROUP with Compatibility Attributes.

alter diskgroup data set attribute 'compatible.asm' = '11.2';
alter diskgroup data set attribute 'compatible.rdbms' = '11.2';

Dropping Disk Groups

The default is EXCLUDING CONTENTS, which provides syntactic consistency and prevents you from dropping the disk group if it has any contents.

drop diskgroup DATA;

You can specify the INCLUDING CONTENTS clause if you also want to delete all files that are contained in the disk group.

drop diskgroup DATA including contents;

If you cannot mount a disk group but must drop it, you can use the FORCE option of the DROP DISKGROUP statement.

drop diskgroup DATA force;