Managing Oracle ASM Flex Disk Groups
Oracle ASM provides database-oriented storage management with flex and extended disk groups.
An Oracle ASM flex disk group is a disk group type that supports Oracle ASM file groups. An Oracle ASM file group describes a group of files that belong to a database, and enables storage management to be performed at the file group, or database, level. An Oracle ASM extended disk group has all the features of a flex disk group, with a specific design to be highly available in an extended (or stretch) cluster environment.
This section discusses the following topics:
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
FLEXREDUNDANCYand 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
HIGHredundancy 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.
-
Migrating (converting) to a flex disk group can be performed for a
NORMALorHIGHredundancy disk group with theCONVERTREDUNDANCYTOFLEXclause of theALTERDISKGROUPSQL statement. You cannot migrate anEXTERNALredundancy disk group to aFLEXredundancy disk group. -
When migrating to a flex disk group, the disk group must have a minimum of three failure groups and must be mounted in restricted mode (
MOUNTEDRESTRICTED) for the duration of the migration. -
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.
-
The
COMPATIBLE.ASMandCOMPATIBLE.RDBMSdisk group attributes must be set to12.2or 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 create and migrate to a flex disk group with SQL statements.
Example 4-13 Using CREATE DISKGROUP to create a flex disk group
SQL> 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> ALTER DISKGROUP data MOUNT RESTRICTED; SQL> ALTER DISKGROUP data CONVERT REDUNDANCY TO FLEX;
About Oracle ASM File Groups
An Oracle ASM file group is a group of files that share the same set of properties and characteristics.
A major benefit of file groups is the ability to have a different availability specification for each database that shares the same disk group.
The set of properties for an Oracle ASM file group includes redundancy, rebalance rebuild priority, rebalance power limit, client compatibility, striping, quota group, and the access control list.
The following list provides important notes about file groups.
-
A disk group contains at least one file group, the default file group.
-
A disk group can contain multiple file groups.
-
A disk group must have
FLEXorEXTENDEDredundancy to contain a file group. -
A disk group can store files belonging to multiple databases with each database having a separate file group.
-
A database can have only one file group in a disk group.
-
A database can span multiple disk groups with multiple file groups in different disk groups. The file groups belonging to a database in multiple disk groups should all have the same name for consistency and easy identification.
-
A file group can belong to only one disk group.
-
A file group can describe only one database, PDB, CDB, volume, or cluster.
-
A file group can belong to only one quota group.
-
Automatically created file groups are associated with the generic quota group.
-
When a database, PDB, or CDB is created, if an existing file group has a client ID or name that matches the ID or name of the database, PDB, or CDB, then that file group is used to describe its files. Otherwise, a new file group is created for the database, PDB, or CDB.
The following figure illustrates the use of Oracle ASM file groups and quota groups in a multitenant environment. File groups and quota groups in different disk groups can have the same name.
In the figure, file groups named PDB1 in disk group 1 and disk group 2 are dedicated to pluggable database PDB1, file groups named PDB2 in disk group 1 and disk group 2 are dedicated to pluggable database PDB2, and file groups named PDB3 in disk group 1 and disk group 2 are dedicated to pluggable database PDB3.
File group PDB1 in disk group 1 belongs to quota group QGRP1 in disk group 1. File group PDB1 in disk group 2 belongs to quota group QGRP1 in disk group 2. File groups PDB2 and PDB3 in disk group 1 belong to quota group QGRP2 in disk group 1. File groups PDB2 and PDB3 in disk group 2 belong to quota group QGRP2 in disk group 2.
You can administer file groups with SQL statements. For example, you can use the FILEGROUP clause of the ALTER DISKGROUP SQL statement to administer file groups. Example 4-15 illustrates how SQL statements are used to add a file group for a pluggable database. The SQL statements also associate the newly added file group to an existing quota group.Example 4-16 illustrates how to modify the redundancy property for a specific file type in a file group.
Example 4-15 Adding a File Group to a Database
ALTER DISKGROUP DiskGroup_1 ADD FILEGROUP FileGroup_PDB1
DATABASE PDB1
SET 'quota_group' = 'QuotaGroup_QGRP1';
ALTER DISKGROUP DiskGroup_1 ADD FILEGROUP FileGroup_PDB2
DATABASE PDB2
SET 'quota_group' = 'QuotaGroup_QGRP2';
Example 4-16 Modifying a File Group
ALTER DISKGROUP DiskGroup_1 MODIFY FILEGROUP FileGroup_PDB1
SET 'datafile.redundancy' = 'HIGH';
ASMCMD also supports commands to manage and track file and quota groups. These commands include:
-
chfgandchqgto modify a file group or quota group -
lsfgandlsqgto list file groups or quota groups -
mkfgandmkqgto create a file group or quota group -
rmfgandrmqgto delete a file group or quota group -
mvfgto move a file group
To monitor Oracle ASM file groups, you can check the V$ASM_FILEGROUP, V$ASM_FILEGROUP_PROPERTY, and V$ASM_FILEGROUP_FILE views.
See Also:
-
About Quota Groups for Oracle ASM File Groups for information about quota groups.
-
ASMCMD File Group Management Commands for information about ASMCMD commands to administer Oracle ASM File Groups
-
Oracle Database Reference for information about the
V$ASM*dynamic performance views
About Oracle ASM File Group Properties
The following list summarizes the properties of file groups.
-
COMPATIBLE.CLIENTThis is a file group property. The current value is the last known client compatibility during a file open operation. The default value for
COMPATIBLE.CLIENTis12.2.0.0.0.The
COMPATIBLE.RDBMSdisk group attribute must be set less than or equal to:-
COMPATIBLE.CLIENTof each file group (when set) -
COMPATIBLEdatabase initialization parameter (for each database that is connected to Oracle ASM) -
COMPATIBLE.ASMof the disk group
You must be an Oracle ASM administrator to modify this property.
-
-
OWNERThis is a file group property. To set the
OWNERproperty, theACCESS_CONTROL.ENABLEDdisk group attribute must be set toTRUEto enable Oracle ASM File Access Control. The user specified as the owner must be a member of the disk group.Only the Oracle ASM administrator, the
OWNER, theOWNERof theUSER_GROUPassociated with the file group, and a member of theUSER_GROUPassociated with the file group can modify the attributes of file groups that are labeled withA database administrator can modify this property. This is true only ifACCESS_CONTROL.ENABLEDis true.You can display the owner with the
USER_NUMBERandUSER_INCARNATIONcolumns of theV$ASM_FILEGROUPview. The values inUSER_NUMBERandUSER_INCARNATIONcan be joined with theUSER_NUMBERandINCARNATIONcolumns of theV$ASM_USERview to display the user names.The default value is
NULL.You must be an Oracle ASM administrator to modify this property.
-
POWER_LIMITThis is a file group property. This property specifies the rebalance power, which determines the number of parallel relocations for disk rebalancing of this file group. The valid settings are
1to1024. When rebalancing a file group, the power limit value is applied as follows:-
If the power option has been explicitly specified in the
ALTERDISKGROUPREBALANCESQL statement or the ASMCMDrebalcommand, then the power value specified in the SQL rebalance statement or ASMCMD rebalance command is used for rebalancing all file groups. -
If the power option has not been specified in the SQL rebalance statement or ASMCMD rebalance command, then the file group
POWER_LIMITproperty value, if set, applies for the file group rebalance. -
If the power option has not been specified in the SQL rebalance statement or ASMCMD rebalance command, and the
POWER_LIMITproperty has not been set for the file group, then the power value defaults to the value of theASM_POWER_LIMITinitialization parameter for the file group rebalance.
You must be a database administrator to modify this property.
-
-
PRIORITYThis is a file group property. This property specifies the rebalance priority and ensures that certain types of files are rebalanced before others. File groups with the highest priority are completely rebalanced first, then file groups with the next highest priority, and so on to the lowest priority.
You can set the rebalance priority setting to
HIGHEST,HIGH,MEDIUM,LOW, orLOWEST. The default value isMEDIUM.You must be a database administrator to modify this property.
-
QUOTA_GROUPThis is a file group property. This property specifies the name of the quota group to which this file group belongs. The valid setting is an existing quota group name. The default value is
GENERIC. Every file group in the disk group must be a member of a quota group.You must be an Oracle ASM administrator to modify this property.
-
REDUNDANCYThis is a file type property. The default redundancy setting for each file type is derived from the system templates. The valid settings are
HIGH,MIRROR, andUNPROTECTED.The redundancy of a file can be changed after the file is created. If redundancy has been changed, then the
REMIRRORcolumn ofV$ASM_FILEcontainsYto indicate that the file needs new mirroring which initiates a rebalance is run to put the new redundancy into effect. After the rebalance completes, the value in theREMIRRORcolumn containsN.If the redundancy in the file group is increased, then the value of the
REDUNDANCYcolumn ofV$ASM_FILEis increased after rebalance completes. However, if the redundancy in the file group is decreased, then the value of theREDUNDANCYcolumn ofV$ASM_FILEis lowered immediately before rebalance is run.Changing the redundancy on a file type granularity or on the entire file group affects all file types.
You must be a database administrator to modify this property.
-
STRIPINGThis is a file type property, and is set for each file type. Usually the default value for each file type is sufficient and is not changed.
Most files have a
COARSEstripe, except for the control file which has aFINEstripe by default. The valid settings areCOARSEandFINE. The default value isCOARSEor derived from the file type template.STRIPINGaffects only newly-created files and cannot be changed after the file is created.You must be a database administrator to set this property.
-
USER_GROUPThis is a file group property. To set the
USER_GROUPproperty, theACCESS_CONTROL.ENABLEDdisk group attribute must be set toTRUEto enable Oracle ASM File Access Control. The user group specified must be an existing user group.Only the Oracle ASM administrator, the
OWNER, theOWNERof theUSER_GROUPassociated with the file group, and a member of theUSER_GROUPassociated with the file group can modify the attributes of file groups that are labeled withA database administrator can modify this property. This is true only ifACCESS_CONTROL.ENABLEDis true.You can display the user group information with the
USERGROUP_NUMBERandUSERGROUP_INCARNATIONcolumns of theV$ASM_FILEGROUPview. The values inUSERGROUP_NUMBERandUSERGROUP_INCARNATIONcan be joined with theUSERGROUP_NUMBERandINCARNATIONcolumns of theV$ASM_USERGROUPview to display the user group names.Files created in a file group inherit the
USER_GROUPproperty setting.The default value is
NULL.You must be an Oracle ASM administrator to modify this property.
The following example illustrates how to set the REDUNDANCY file group property for the datafile and archivelog file types.
Example 4-17 Setting a file group property
ALTER DISKGROUP DiskGroup_2 MODIFY FILEGROUP FileGroup_PDB1
SET 'datafile.redundancy' = 'HIGH';
ALTER DISKGROUP DiskGroup_2 MODIFY FILEGROUP FileGroup_PDB1
SET 'archivelog.redundancy' = 'MIRROR';See Also:
-
What Types of Files Does Oracle ASM Support? for a list of Oracle ASM file types
-
Managing Oracle ASM File Access Control for Disk Groups for information about Oracle ASM File Access Control
About Quota Groups for Oracle ASM File Groups
A quota group defines the quota allocated to a group of Oracle ASM File Groups. A file group belongs to only one quota group. For information about file groups, refer to About Oracle ASM File Groups.
A quota can describe an aggregate of space used by different databases.
The following list provides important notes about quota groups for file groups.
-
A file group can belong to only one quota group.
-
A quota group cannot span multiple disk groups.
-
A quota group describes an aggregate of space used by one file group or multiple file groups in the same disk group.
A quota is enforced when a file is created and resized.
-
A quota is a physical space.
As a consequence, if the quota limit has been set to 10 M, then a two-way mirrored 6 M file exceeds the quota.
-
Each quota group has two values: the limit and the current used space.
The limit value can be set below the current used space. This action prevents any additional space being allocated for files described by file groups associated with this quota group.
-
A file group can be moved from one quota group to another, regardless whether or not the target quota group has enough space for the file group.
This capability enables an Oracle ASM administrator to stop any files described by a specific file group from allocating additional space.
You can administer quota groups with SQL and ASMCMD commands. The following examples illustrate how SQL statements are used to add a quota group to a disk group and how to move a file group from its current quota group to a new quota group.
Example 4-18 Adding a Quota Group to a Disk Group
ALTER DISKGROUP DiskGroup_2 ADD QUOTAGROUP QuotaGroup_QGRP3
SET 'quota'= 10m;
Example 4-19 Moving a File Group to a new Quota Group
ALTER DISKGROUP DiskGroup_2 MODIFY FILEGROUP FileGroup_PDB1
SET 'quota_group' = 'QuotaGroup_QGRP3';
About Oracle ASM Extended Disk Groups
An Oracle ASM extended disk group has all the features of a flex disk group, with a specific design to be highly available in an extended (stretch) cluster environment, which contains nodes that span multiple physically separated sites.
The following are characteristics of an extended disk group:
-
The redundancy setting of an extended disk group is set to
EXTENDEDREDUNDANCYand each file group of the extended disk group has its own redundancy property setting. -
The redundancy of files and file groups in an extended disk group is specified for each site, rather than for each disk group.
This means that the number of copies determined by the
REDUNDANCYsetting is multiplied by the number of data sites. If theREDUNDANCYis set toMIRROR, then that specifies two copies, resulting in four copies total for two data sites. -
An extended disk group can tolerate the loss of an entire site, plus the loss of up to two failure groups in another site.
This means that an extended disk group can tolerate failures at the site level in addition to the failure group level.
-
All data sites must have the same number of failure groups during disk group creation.
-
A quota group is specified for each disk group, rather than for each site.
-
The quota group limit is the physical space required for all copies across all sites.
For example, with two data sites, a 6 M file with redundancy set to
MIRRORuses 24 M of the quota limit. -
There must be a total of three sites, two data sites and one quorum site, to create an extended disk group. Each data site should have three failure groups, and the quorum site should have one failure group.
-
For database files, the redundancy setting is dictated by the redundancy setting of the file groups of the extended disk group.
-
The
COMPATIBLE.ASMandCOMPATIBLE.RDBMSdisk group attributes must be set to12.2or greater. -
The minimum allocation unit (AU) size is 4 M.
-
Converting from another disk group type to an extended disk group is not supported.
-
The
SITEspecification for failure groups can be inferred from cells if Oracle Exadata has been configured. Otherwise, the site specification can be specified with the SQL statement when creating a disk group.
Note:
The REQUIRED_MIRROR_FREE_MB and USABLE_FILE_MB columns in the V$ASM_DISKGROUP view report no values for an extended disk group.
The following example illustrates how to create an extended disk group with a SQL statement.
Example 4-20 Using CREATE DISKGROUP with extended disk groups
SQL> CREATE DISKGROUP extended_site_data EXTENDED REDUNDANCY
SITE NY FAILGROUP fg1 DISK '/devices/disks/disk01'
FAILGROUP fg2 DISK '/devices/disks/disk02'
FAILGROUP fg3 DISK '/devices/disks/disk03'
SITE NJ FAILGROUP fg4 DISK '/devices/disks/disk04'
FAILGROUP fg5 DISK '/devices/disks/disk05'
FAILGROUP fg6 DISK '/devices/disks/disk06'
SITE QM QUORUM
FAILGROUP fg7 DISK '/devices/disks/disk07';