Disclaimer

Sunday 11 July 2021

What is 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 redundancy for each database that shares the same disk group. In other words you can define the redundancy at file level and a diskgroup can store both mirrored as well as  unmirrored (unprotected) file at the same time

Important notes about file groups.
  1. A disk group contains at least one file group, the default file group.
  2. A disk group must have FLEX or EXTENDED redundancy to contain a file group.
  3. A disk group can store files belonging to multiple databases with each database having a separate file group.
  4. A database can have only one file group in a disk group.
  5. A database can span multiple disk groups with multiple file groups in different disk groups.
  6. The file groups name of database in multiple disk groups have the same name for consistency and easy identification purpose
  7. A file group can belong to only one disk group.
  8. A file group can describe only one database, PDB, CDB, volume, or cluster.
  9. A file group can belong to only one quota group.
  10. Automatically created file groups are associated with the generic quota group.
  11. 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.
  12. A file group that is automatically created as a result of a create database operation is identified as system-created. This system-created file group is dropped when
  13. the database is dropped. However, if you manually create a file group, then that file group is not automatically dropped when you drop the related database. You must explicitly drop the manually-created file group.

How to Create a File Group for a Database

SQL>  ALTER DISKGROUP DG_FLEX_DATA  ADD FILEGROUP FG_PDB1 DATABASE PDB1;
Diskgroup altered.

ASMCMD> lsfg
File Group         Disk Group    Quota Group  Used Quota MB  Client Name  Client Type
DEFAULT_FILEGROUP  DG_FLEX_DATA  GENERIC      0
FG_PDB1            DG_FLEX_DATA  GENERIC      0              PDB1         DATABASE

How to Modify a File Group

SQL> ALTER DISKGROUP DG_FLEX_DATA  MODIFY FILEGROUP FG_PDB1 SET 'datafile.redundancy' = 'HIGH';
Diskgroup altered.

ASM File Group Properties

COMPATIBLE.CLIENT: default value is 12.2.0.0.0

OWNER: default value is null
           To set the OWNER property, the ACCESS_CONTROL.ENABLED should be true to

           read more about Oracle ASM Access Control 

. USER_GROUP: default value is NULL.
           To set the USER_GROUP: property, the ACCESS_CONTROL.ENABLED should be 
true read more about Oracle ASM Access Control

. POWER_LIMIT:
           This property specifies the rebalance power, which determines the number of

           parallel relocations for disk rebalancing of this file group.The valid settings are 1 to
           1024

. PRIORITY: default value is MEDIUM
           This property specifies the rebalance priority and ensures that certain types of files 
are rebalanced before others.You can set the rebalance priority setting to HIGHEST,
           HIGH, MEDIUM, LOW, or LOWEST.

. QUOTA_GROUP: default value is GENERIC.
           This property specifies the name of the quota group to which this file group belongs.

           Every file group in the disk group must be a member of a quota group

. REDUNDANCY: 
The default redundancy setting for each file type is derived from the system
           templates. The valid settings are HIGH, MIRROR, and UNPROTECTED Changing
           the redundancy on a file type granularity or on the entire file group affects all file
           types.

. STRIPING:
           is set for each file type. Usually the default value for each file type is sufficient and is

           not changed. STRIPING affects only newly-created files and cannot be changed after
           the file is created

How to Set a FileGroup Property of a File Group

SQL> ALTER DISKGROUP DG_FLEX_DATA  MODIFY FILEGROUP FG_PDB1 SET 'archivelog.redundancy' = 'UNPROTECTED';
Diskgroup altered.

How to Drop a FileGroup

SQL> ALTER DISKGROUP DG_FLEX_DATA DROP FILEGROUP FG_PDB1;
Diskgroup altered.



ASMCMD commands related to FileGroup

• chfg and chqg to modify a file group or quota group
• lsfg and lsqg to list file groups or quota groups
• mkfg and mkqg to create a file group or quota group
• rmfg and rmqg to delete a file group or quota group
• mvfg to move a file group


Views to query ASM FileGroup Info

V$ASM_FILEGROUP
V$ASM_FILEGROUP_PROPERTY
V$ASM_FILEGROUP_FILE









No comments:

Post a Comment

100 Oracle DBA Interview Questions and Answers

  Here are 100 tricky interview questions tailored for a Senior Oracle DBA role. These questions span a wide range of topics, including perf...