Automatic Storage Management
Automatic Storage Management
Automatic Storage Management (ASM) is oracle’s logical volume manager, it uses OMF
(Oracle Managed Files) to name and locate the database files. It can use raw disks, filesystems or
files which can be made to look like disks as long as the device is raw. ASM uses its own
database instance to manage the disks, it has its own processes and pfile or spfile, it uses ASM
disk groups to manage disks as one logical unit.
Provides automatic load balancing over all the available disks, thus reducing hot spots in
the file system
Prevents fragmentation of disks, so you don't need to manually relocate data to tune I/O
performance
Adding disks is straight forward - ASM automatically performs online disk
reorganization when you add or remove storage
Uses redundancy features available in intelligent storage arrays
The storage system can store all types of database files
Using disk group makes configuration easier, as files are placed into disk groups
ASM provides stripping and mirroring (fine and coarse gain - see below)
ASM and non-ASM oracle files can coexist
ASM is free!!!!!!!!!!!!!
is a special instance that does not have any data files, there is only ASM instance one per s
which manages all ASM files for each database. The instance looks after the disk groups a
ASM Instance
access to the ASM files. Databases access the files directly but uses the ASM instance to lo
If the ASM instance is shutdown then the database will either be automatically shutdown o
ASM Disk Groups Disks are grouped together via disk groups, these are very much like logical volumes.
Files are stored in the disk groups and benefit from the disk group features i.e. stripping an
ASM Files
mirroring.
ASM Summary database is allowed to have multiple disk groups
You can store all of your database files as ASM files
Disk group comprises a set of disk drives
ASM disk groups are permitted to contain files from more than one disk
Files are always spread over every disk in an ASM disk group and belong to one di
only
ASM Processes
There are a number of new processes that are started when using ASM, both the ASM instance and
Database will start new processes
ASM Instance
RBAL
(rebalance coordinates the rebalancing when a new disk is add or removed
master)
ARB[1-9]
actually does the work requested by the RBAL process (upto 9 of these)
(rebalance)
Database Instance
RBAL opens and closes the ASM disk
connects to the ASM instance via session and is the communication between ASM and RBMS,
ASMB
could be file creation, deletion, resizing and also various statistics and status messages.
ASM registers its name and disks with the RDBMS via the cluster synchronization service
(CSS). This is why the oracle cluster services must be running, even if the node and instance is
not clustered. The ASM must be in mount mode in order for a RDBMS to use it and you only
require the instance type in the parameter file.
An ASM disk group is a logical volume that is created from the underlying physical disks. If
storage grows you simply add disks to the disks groups, the number of groups can remain the
same.
ASM file management has a number of good benefits over normal 3rd party LVM's
performance
redundancy
ease of management
security
ASM Stripping
ASM stripes files across all the disks within the disk group thus increasing performance, each stripe is
called an ‘allocation unit’. ASM offers two types of stripping which is dependent on the type of database
file
ASM Mirroring
Disk mirroring provides data redundancy, this means that if a disk were to fail Oracle will use
the other mirrored disk and would continue as normal. Oracle mirrors at the extent level, so you
have a primary extent and a mirrored extent. When a disk fails, ASM rebuilds the failed disk
using mirrored extents from the other disks within the group, this may have a slight impact on
performance as the rebuild takes place.
All disks that share a common controller are in what is called a failure group, you can ensure
redundancy by mirroring disks on separate failure groups which in turn are on different
controllers, ASM will ensure that the primary extent and the mirrored extent are not in the same
failure group. When mirroring you must define failure groups otherwise the mirroring will not
take place.
External redundancy - doesn't have failure groups and thus is effectively a no-mirroring
strategy
Normal redundancy - provides two-way mirroring of all extents in a disk group, which
result in two failure groups
High redundancy - provides three-way mirroring of all extents in a disk group, which
result in three failure groups
ASM Files
The data files you create under ASM are not like the normal database files, when you create a
file you only need to specify the disk group that the files needs to be created in, Oracle will then
create a stripped file across all the disks within the disk and carry out any redundancy required,
ASM files are OMF files. ASM naming is dependent on the type file being created, here are the
different file-naming conventions
fully qualified ASM filenames - are used when referencing existing ASM files
(+dgroupA/dbs/controlfile/CF.123.456789)
numeric ASM filenames - are also only used when referencing existing ASM files
(+dgroupA.123.456789)
alias ASM filenames - employ a user friendly name and are used when creating new files
and when you refer to existing files
alias filenames with templates - are strictly for creating new ASM files
incomplete ASM filenames - consist of a disk group only and are used for creation only.
Creating a ASM instance is like creating a normal instance but the parameter file will be smaller,
ASM does not mount any data files, it only maintains ASM metadata. ASM normally only needs
about 100MB of disk space and will consume about 25MB of memory for the SGA, ASM does
not have a data dictionary like a normal database so you must connect to the instance using either
O/S authentication as SYSDBA or SYSOPER or using a password file.
You can start an ASM instance with nomount, mount but not open. When shutting down a ASM instance
this passes the shutdown command to the RDBMS (normal, immediate, etc)
ASM Configuration
instance_type=’asm’
instance_name=’+asm’
Parameter file asm_power_limit=2
(init+asm.ora) asm_diskstring=’\\.\f:’,’\\.\g:’,’\\.\h:’
asm_diskgroup= dgroupA, dgroupB
Note: file should be created in $ORACLE_HOME/databa
Create service (windows only) c:> oradim –new –asmsid +ASM –startmode manual
Set the oracle_sid environment variable (windows or c:> set ORACLE_SID=+ASM (windows only)
unix) export ORACLE_SID=+ASM (unix only)
Login to ASM instance and start instance c:> sqlplus /nolog;
sql> connect / as sysdba;
sql> startup pfile=init+asm.ora
Note: sometimes you get a ora-15110 which means that t
ASM Operations
Instance name select instance_name from v$instance;
create diskgroup diskgrpA high redundancy
failgroup failgrpA disk ’\\.\f:’ name disk1
failgroup failgrpB disk ’\\.\g:’ name disk2 force
failgroup failgrpC disk ’\\.\h:’ name disk3;
Create disk group
create diskgroup diskgrpA external redundancy