Monday, November 16, 2015

Automatic Storage Management(ASM)

Automatic Storage Management (ASM) is a new type of file system. ASM provided a foundation for highly efficient storage management with kernelized asynchronous I/O, direct I/O, redundancy, striping, and an easy way to manage storage. ASM is recommended file system for RAC and single instance ASM for storing database files. This provides direct I/O to the file and performance is comparable with that provided by raw devices. Oracle creates a separate instance for this purpose.

Automatic Storage Management (ASM) simplifies administration of Oracle related files by allowing the administrator to reference diskgroups rather than hundreds of individual disks and files, which are managed by ASM. The ASM functionality is an extension of the Oracle Managed Files (OMF) functionality that also includes striping and mirroring to provide balanced and secure storage. The ASM functionality can be used in combination with existing raw and cooked file systems, along with OMF and manually managed files.


You can store the following file types in ASM diskgroups:
  • Datafiles
  • Control files
  • Online redo logs
  • Archive logs
  • Flashback logs
  • SPFILEs
  • RMAN backups
  • Temporary datafiles
  • Datafile copies
  • Disaster recovery configurations
  • Change tracking bitmaps
  • DataPump dumpsets

In summary, ASM provides the following functionality/features:
  • Manages groups of disks, called diskgroups. Must be careful while choosing disks for a diskgroup.
  • Manages disk redundancy within a diskgroup.
  • Provides near-optimal I/O balancing without any manual tuning.
  • Enables management of database objects without specifying mount points and filenames.
  • Supports large files.
  • Replacement for CFS (Cluster File System).
  • Also useful for Non-RAC databases.
  • A new instance type - ASM is introduced in 10g.
  • ASM instance has no data dictionary.
  • A Disk can be a partial, full or a LUN from the RG.
  • I/O is spread evenly across all disks of a diskgroup.
  • Disks can be dynamically added to any diskgroup.
  • When combined with OMF increases manageability.
  • ASM cannot maintain empty directories “delete input” has issues, create a dummy directory.
  • Use of ASM diskgroup is very simple create tablespace.
  • Enterprise Manager can also be used for administering diskgroups
  • Only RMAN can be used with ASM.
  • Introduces three additional Oracle background processes – RBAL, ARBx and ASMB.
    • ASMB - This ASMB process is used to provide information to and from cluster synchronization services used by ASM to manage the disk resources. It's also used to update statistic and provide a heart beat mechanism.
    • Re-Balance, RBAL - RBAL is the ASM related process that performs rebalancing of disk resources controlled by ASM.
    • Actual Rebalance, ARBx - ARBx is configured by ASM_POWER_LIMIT.
  • ASM instance has it own set of v$views and init.ora parameters.

The advantages of ASM are
  • Disk Addition - Adding a disk is very easy. No downtime is required and file extents are redistributed automatically.
  • I/O Distribution - I/O is spread over all the available disks automatically, without manual intervention, reducing chances of a hot spot.
  • Stripe Width - Striping can be fine grained as in redolog files (128K for faster transfer rate) and coarse for datafiles (1MB for transfer of a large number of blocks at one time).
  • Mirroring - Software mirroring can be set up easily, if hardware mirroring is not available.
  • Buffering - The ASM file system is not buffered, making it direct I/O capable by design.
  • Kernelized Asynchronous I/O - There is no special setup necessary to enable kernelized asynchronous I/O, without using raw or third-party file systems such as Veritas Quick I/O.
The initialization parameters that are specific to an ASM instance are:
  • INSTANCE_TYPE - Set to ASM. The default is RDBMS.
  • ASM_DISKGROUPS - The list of diskgroups that should be mounted by an ASM instance during instance startup, or by the ALTER DISKGROUP ALL MOUNT statement. ASM configuration changes are automatically reflected in this parameter.
  • ASM_DISKSTRING - Specifies a value that can be used to limit the disks considered for discovery. The default value is NULL allowing all suitable disks to be considered. Altering the default value may improve the speed of diskgroup mount time and the speed of adding a disk to a diskgroup. Changing the parameter to a value which prevents the discovery of already mounted disks results in an error.
  • ASM_POWER_LIMIT -The maximum power for a rebalancing operation on an ASM instance. The valid values range from 1 (default) to 11. The higher the limit the more resources are allocated resulting in faster rebalancing operations. This value is also used as the default when the POWER clause is omitted from a rebalance operation. A value of 0 disables rebalancing.
  • ASM_PREFERRED_READ_FAILURE_GROUPS - This initialization parameter value (default is NULL) is a comma-delimited list of strings that specifies the failure groups that should be preferentially read by the given instance. This parameter is generally used only for clustered ASM instances and its value can be different on different nodes. This is from Oracle 11g.
  • DB_UNIQUE_NAME - Specifies a globally unique name for the database. This defaults to +ASM but must be altered if you intend to run multiple ASM instances.
While creating a diskgroup, we have to specify an ASM diskgroup type based on one of the following three redundancy levels:
  • Normal redundancy - for 2-way mirroring, requiring two failure groups, when ASM allocates an extent for a normal redundancy file, ASM allocates a primary copy and a secondary copy. ASM chooses the disk on which to store the secondary copy in a different failure group other than the primary copy.
  • High redundancy - for 3-way mirroring, requiring three failure groups, in this case the extent is mirrored across 3 disks.
  • External redundancy - to not use ASM mirroring. This is used if you are using hardware mirroring or third party redundancy mechanism like RAID, Storage arrays.

ASM is supposed to stripe the data and also mirror the data (if using Normal, High redundancy). So this can be used as an alternative for RAID (Redundant Array of Inexpensive Disks) 0+1 solutions.

Source: 

Sachin's DBA Blog

No comments:

Post a Comment