Overview of Automatic Storage Management (ASM) : Instance - Type DB - Unique - Name Asm - Power - Limit
Overview of Automatic Storage Management (ASM) : Instance - Type DB - Unique - Name Asm - Power - Limit
Automatic Storage Management (ASM) simplifies administration of Oracle related files by allowing the
administrator to reference disk groups rather than individual disks and files, which are managed by ASM.
The ASM functionality is an extention of the Oracle Managed Files (OMF) functionality that also includes
striping and mirroring to provide balanced and secure storage. The new ASM functionality can be used in
combination with existing raw and cooked file systems, along with OMF and manually managed files.
The ASM functionality is controlled by an ASM instance. This is not a full database instance, just the
memory structures and as such is very small and lightweight.
The main components of ASM are disk groups, each of which comprise of several physical disks that are
controlled as a single unit. The physical disks are known as ASM disks, while the files that reside on the
disks are know as ASM files. The locations and names for the files are controlled by ASM, but user-
friendly aliases and directory structures can be defined for ease of reference.
The level of redundancy and the granularity of the striping can be controlled using templates. Default
templates are provided for each file type stored by ASM, but additional templates can be defined as
needed.
Failure groups are defined within a disk group to support the required level of redundancy. For two-way
mirroring you would expect a disk group to contain two failure groups so individual files are written to two
locations.
The initialization parameters that are of specific interest for an ASM instance are:
INSTANCE_TYPE - Set to ASM or RDBMS depending on the instance type. The default is
RDBMS.
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.
ASM_POWER_LIMIT -The maximum power for a rebalancing operation on an ASM instance. The
valid values range from 1 to 11, with 1 being the default. 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.
ASM_DISKGROUPS - The list of disk groups 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. Altering the default value may improve the speed of disk group mount time and the
speed of adding a disk to a disk group. Changing the parameter to a value which prevents the
discovery of already mounted disks results in an error. The default value is NULL allowing all
suitable disks to be considered.
Incorrect usage of parameters in ASM or RDBMS instances result in ORA-15021 errors.
To create an ASM instance first create a file called "init+ASM.ora" in the "/tmp" directory containing the
following information.
INSTANCE_TYPE=ASM
export ORACLE_SID=+ASM
sqlplus / as sysdba
File created.
The ASM instance is now ready to use for creating and mounting disk groups. To shutdown the ASM
instance issue the following command.
SQL> shutdown
ASM instance shutdown
SQL>
Once an ASM instance is present disk groups can be used for the following parameters in database
instances (INSTANCE_TYPE=RDBMS) to allow ASM file creation:
DB_CREATE_FILE_DEST
DB_CREATE_ONLINE_LOG_DEST_n
DB_RECOVERY_FILE_DEST
CONTROL_FILES
LOG_ARCHIVE_DEST_n
LOG_ARCHIVE_DEST
STANDBY_ARCHIVE_DEST
ASM instance are started and stopped in a similar way to normal database instances. The options for
the STARTUP command are:
NORMAL - The ASM instance waits for all connected ASM instances and SQL sessions to exit
then shuts down.
IMMEDIATE - The ASM instance waits for any SQL transactions to complete then shuts down. It
doesn't wait for sessions to exit.
TRANSACTIONAL - Same as IMMEDIATE.
ABORT - The ASM instance shuts down instantly.
There are a few basic points to consider when planning to use ASM:
In most cases you will only need two disk groups (DATA and FRA), where DATA holds all
database related files and FRA holds the fast recovery area, including multiplexed copies on
online redo logs and controlfiles. Typically, the FRA disk group will be twice the size of the DATA
disk group, since it must hold all backups.
Oracle recommend a minimum of 4 LUNs per disk group, with LUNs using hardware RAID and
external redundancy if possible.
All LUNs within a disk group should be the same size and have the same performance
characteristics.
LUNs should be made up from disks dedicated to Oracle, not shared with other applications.
Disks
Disk groups are created using the CREATE DISKGROUP statement. This statement allows you to specify
the level of redundancy:
Disks can be added or removed from disk groups using the ALTER DISKGROUP statement. Remember
that the wildcard "*" can be used to reference disks so long as the resulting string does not match a disk
already used by an existing disk group.
-- Add disks.
ALTER DISKGROUP disk_group_1 ADD DISK
'/devices/disk*3',
'/devices/disk*4';
-- Drop a disk.
ALTER DISKGROUP disk_group_1 DROP DISK diska2;
Disks can be resized using the RESIZE clause of the ALTER DISKGROUP statement. The statement can
be used to resize individual disks, all disks in a failure group or all disks in the disk group. If
the SIZE clause is omitted the disks are resized to the size of the disk returned by the OS.
The UNDROP DISKS clause of the ALTER DISKGROUP statement allows pending disk drops to be
undone. It will not revert drops that have completed, or disk drops associated with the dropping of a disk
group.
ALTER DISKGROUP disk_group_1 UNDROP DISKS;
Disk groups can be rebalanced manually using the REBALANCE clause of the ALTER
DISKGROUP statement. If the POWER clause is omitted the ASM_POWER_LIMIT parameter value is used.
Rebalancing is only needed when the speed of the automatic rebalancing is not appropriate.
Disk groups are mounted at ASM instance startup and unmounted at ASM instance shutdown. Manual
mounting and dismounting can be accomplished using the ALTER DISKGROUP statement as seen below.
Templates
Templates are named groups of attributes that can be applied to the files within a disk group. The
following example show how templates can be created, altered and dropped.
-- Modify template.
ALTER DISKGROUP disk_group_1 ALTER TEMPLATE my_template ATTRIBUTES (COARSE);
-- Drop template.
ALTER DISKGROUP disk_group_1 DROP TEMPLATE my_template;
Directories
A directory heirarchy can be defined using the ALTER DISKGROUP statement to support ASM file
aliasing. The following examples show how ASM directories can be created, modified and deleted.
-- Create a directory.
ALTER DISKGROUP disk_group_1 ADD DIRECTORY '+disk_group_1/my_dir';
-- Rename a directory.
ALTER DISKGROUP disk_group_1 RENAME DIRECTORY '+disk_group_1/my_dir' TO
'+disk_group_1/my_dir_2';
Aliases
Aliases allow you to reference ASM files using user-friendly names, rather than the fully qualified ASM
filenames.
-- Rename an alias.
ALTER DISKGROUP disk_group_1 RENAME ALIAS '+disk_group_1/my_dir/my_file.dbf'
TO '+disk_group_1/my_dir/my_file2.dbf';
-- Delete an alias.
ALTER DISKGROUP disk_group_1 DELETE ALIAS '+disk_group_1/my_dir/my_file.dbf';
Files
Files are not deleted automatically if they are created using aliases, as they are not Oracle Managed Files
(OMF), or if a recovery is done to a point-in-time before the file was created. For these circumstances it is
necessary to manually delete the files, as shown below.
Checking Metadata
The internal consistency of disk group metadata can be checked in a number of ways using
the CHECK clause of the ALTER DISKGROUP statement.
ASM Views
The ASM configuration can be viewed using the V$ASM_% views, which often contain different information
depending on whether they are queried from the ASM instance, or a dependant database instance.
ASM Filenames
There are several ways to reference ASM file. Some forms are used during creation and some for
referencing ASM files. The forms for file creation are incomplete, relying on ASM to create the fully
qualified name, which can be retrieved from the supporting views. The forms of the ASM filenames are
summarised below.
Filename Type Format
Fully Qualified ASM Filename +dgroup/dbname/file_type/file_type_tag.file.incarnation
Numeric ASM Filename +dgroup.file.incarnation
Alias ASM Filenames +dgroup/directory/filename
Alias ASM Filename with Template +dgroup(template)/alias
Incomplete ASM Filename +dgroup
Incomplete ASM Filename with Template +dgroup(template)
ASM filenames can be used in place of conventional filenames for most Oracle file types, including
controlfiles, datafiles, logfiles etc. For example, the following command creates a new tablespace with a
datafile in the disk_group_1 disk group.
Monitors the other background processes and performs process recovery when a
server or dispatcher process terminates abnormally
Provides a wall clock time and reference time for time interval measurements
VKTM acts as a time publisher for an Oracle instance. VKTM publishes two sets of
time: a wall clock time using a seconds interval and a higher resolution time (which
is not wall clock time) for interval measurements. The VKTM timer service
centralizes time tracking and offloads multiple timer calls from other clients.
asm_dia0_+ASM=Diagnostic Process
The primary responsibility of DBWn is to write data blocks to disk. DBWn also
handles checkpoints, file open synchronization, and logging of Block Written
records.
In many cases the blocks that DBWn writes are scattered throughout the
disk. Thus, the writes tend to be slower than the sequential writes performed
by LGWR. DBWn performs multiblock writes when possible to improve
efficiency. The number of blocks written in a multiblock write varies by
operating system.
The DB_WRITER_PROCESSES initialization parameter specifies the number of
DBWn processes (DBW0-DBW9 and DBWa-DBWz). The database selects an
appropriate default setting for this parameter or adjusts a user-specified
setting based on the number of CPUs and processor groups.
Redo log entries are generated in the redo log buffer of the system global area
(SGA). LGWR writes the redo log entries sequentially into a redo log file. If the
database has a multiplexed redo log, then LGWR writes the redo log entries to a
group of redo log files.
asm_ckpt_+ASM=Checkpoint Process
Performs critical tasks such as instance recovery and dead transaction recovery,
and maintenance tasks such as temporary space reclamation, data dictionary
cleanup, and undo tablespace management
GMON monitors all the disk groups mounted in an ASM instance and is responsible
for maintaining consistent disk membership and status information. Membership
changes result from adding and dropping disks, whereas disk status changes result
from taking disks offline or bringing them online.
Communicates with the ASM instance, managing storage and providing statistics
ASMB runs in ASM instances when the ASMCMD cp command runs or when the
database instance first starts if the server parameter file is stored in ASM. ASMB
also runs with Oracle Cluster Registry on ASM.
ASM_DISKGROUPS
The ASM_DISKGROUPS initialization parameter specifies a list of the names of disk groups
that an Oracle ASM instance mounts at startup. Oracle ignores the value that you set for
ASM_DISKGROUPS when you specify the NOMOUNT option at startup or when you run the
ALTER DISKGROUP ALL MOUNT statement. The default value of the ASM_DISKGROUPS
parameter is a NULL string. For information about disk groups that are mounted at startup
time, see "About Mounting Disk Groups at Startup" on page 3-16.
The ASM_DISKGROUPS parameter is dynamic. If you are using a server parameter file
(SPFILE), then you do not have to manually alter the value of ASM_DISKGROUPS. Oracle ASM
automatically adds a disk group to this parameter when the disk group is successfully
created or mounted. Oracle ASM also automatically removes a disk group from this
parameter when the disk group is dropped or dismounted.
The following is an example of setting the ASM_DISKGROUPS parameter dynamically:
SQL> ALTER SYSTEM SET ASM_DISKGROUPS = DATA, FRA;
When using a text initialization parameter file (PFILE), you may edit the initialization
parameter file to add the name of any disk group so that it is mounted automatically at
instance startup. You must remove the name of any disk group that you no longer want
automatically mounted.
The following is an example of the ASM_DISKGROUPS parameter in the initialization file:
ASM_DISKGROUPS = DATA, FRA
ASM_DISKSTRING
For example, on a Linux server that does not use ASMLib, to limit the discovery process to
only include disks that are in the /dev/rdsk/mydisks directory, set the ASM_DISKSTRING
initialization parameter to: /dev/rdsk/mydisks/*
The asterisk is required. To limit the discovery process to only include disks that have a
name that ends in disk3 or disk4, set ASM_DISKSTRING to:
/dev/rdsk/*disk3, /dev/rdsk/*disk4
The ? character, when used as the first character of a path, expands to the Oracle home
directory. Depending on the operating system, when you use the ? character elsewhere in
the path, it is a wildcard for one character.
The default value of the ASM_DISKSTRING parameter is a NULL string. A NULL value causes
Oracle ASM to search a default path for all disks in the system to which the Oracle ASM
instance has read and write access. The default search path is platform-specific. Refer to
your operating system specific installation guide for more information about the default
search path.
Oracle ASM cannot use a disk unless all of the Oracle ASM instances in the cluster can
discover the disk through one of their own discovery strings. The names do not have to be
the same on every node, but all disks must be discoverable by all of the nodes in the
cluster. This may require dynamically changing the initialization parameter to enable
adding new storage.
ASM_POWER_LIMIT
The ASM_POWER_LIMIT initialization parameter specifies the default power for disk
rebalancing in a disk group. The range of values is 0 to 1024. The default value is 1. A
value of 0 disables rebalancing. Higher numeric values enable the rebalancing operation to
complete more quickly, but might result in higher I/O overhead and more rebalancing
processes.
■For disk groups that have the disk group ASM compatibility set to 11.2.0.2 or greater
(for example, COMPATIBLE.ASM = 11.2.0.2), the operational range of values is 0 to 1024
for the rebalance power.
■For disk groups that have the disk group ASM compatibility set to less than 11.2.0.2, the
operational range of values is 0 to 11 inclusive. If the value for ASM_POWER_LIMIT is larger
than 11, a value of 11 is used for these disk groups.
You can also specify the power of the rebalancing operation in a disk group with the POWER
clause of the SQL ALTER DISKGROUP ... REBALANCE statement. The range of allowable
values for the POWER clause is the same for the ASM_POWER_LIMIT initialization parameter.
If the value of the POWER clause is specified larger than 11 for a disk group with ASM
compatibility set to less than 11.2.0.2, then a warning is displayed and a POWER value
equal to 11 is used for rebalancing.
ASM_PREFERRED_READ_FAILURE_GROUPS
The ASM_PREFERRED_READ_FAILURE_GROUPS initialization parameter value is a comma-
delimited list of strings that specifies the failure groups that should be preferentially read
by the given instance. The ASM_PREFERRED_READ_FAILURE_GROUPS parameter setting is
instance specific. The default value is NULL. This parameter is generally used for clustered
Oracle ASM instances and its value can be different on different nodes.
For example: diskgroup_name1.failure_group_name1, ...
DB_CACHE_SIZE
You do not have to set a value for the DB_CACHE_SIZE initialization parameter if you use
automatic memory management. The setting for the DB_CACHE_SIZE parameter determines
the size of the buffer cache. This buffer cache is used to store metadata blocks. The default
value for this parameter is suitable for most environments.
DIAGNOSTIC_DEST
The DIAGNOSTIC_DEST initialization parameter specifies the directory where diagnostics for
an instance are located. The default value for an Oracle ASM instance is the $ORACLE_BASE
directory for the Oracle Grid Infrastructure installation.
$ ls $ORACLE_BASE/diag/asm/+asm/+ASM
INSTANCE_TYPE
The INSTANCE_TYPE initialization parameter is optional for an Oracle ASM instance in an
Oracle Grid Infrastructure home.
The following is an example of the INSTANCE_TYPE parameter in the initialization file:
INSTANCE_TYPE = ASM
LARGE_POOL_SIZE
You do not have to set a value for the LARGE_POOL_SIZE initialization parameter if you use
automatic memory management.
The setting for the LARGE_POOL_SIZE parameter is used for large allocations. The default
value for this parameter is suitable for most environments.
PROCESSES
The PROCESSES initialization parameter affects Oracle ASM, but the default value is usually
suitable. However, if multiple database instances are connected to an Oracle ASM instance,
you can use the following formula:
PROCESSES = 50 + 50*n
where n is the number database instances connecting to the Oracle ASM instance.
REMOTE_LOGIN_PASSWORDFILE
The REMOTE_LOGIN_PASSWORDFILE initialization parameter specifies whether the Oracle
ASM instance checks for a password file. This parameter operates the same for Oracle
ASM and database instances.
SHARED_POOL_SIZE
You do not have to set a value for the SHARED_POOL_SIZE initialization parameter if you use
automatic memory management. The setting for the SHARED_POOL_SIZE parameter
determines the amount of memory required to manage the instance. The setting for this
parameter is also used to determine the amount of space that is allocated for extent
storage. The default value for this parameter is suitable for most environments.
ASM DISK group status
Former:- Given disk was earlier part of some ASM Disk Group but now its available
Foreign:- Given disk is being used by some other software other than ASM
---------------------------------
--------------------------------------------
-----------------------------------------------
QUORUM | REGULAR
Specify either QUORUM or REGULAR before the keyword FAILGROUP if you are
explicitly specifying the failure group. If you are creating a disk group with
implicitly created failure groups, then specify these keywords before the
keyword DISK.