You are on page 1of 23


Automatic Storage Management(ASM)

By Emmanuel Adarkwah

ASM is an integrated, high-performance database file system and disk manager. ASM is based on the principle that the database should manage storage instead of requiring an administrator to do it. ASM eliminates the need for directly managing potentially thousands of Oracle database files. ASM groups the disks in your storage system into one or more disk groups.

log on oradb1 and alert_+ASM2. .  The ASM instance on oradb1 is called +ASM1 and on oradb2 +ASM2. Every server running one or more database instances that use ASM for storage has an ASM instance.  The ASM instance log on each server is under /oraprod/admin/+ASM/bdump and is called alert_+ASM1.ASM Instance  ASM is implemented as a special kind of Oracle instance.  In an Oracle RAC environment. Only one ASM instance is required for each node regardless of the number of database instances on the node.log on oradb2. with its own System Global Area and background processes. there is one ASM instance for each node.  The ASM instances communicate with each other on a peer-topeer basis.  The ASM instance is tightly integrated with the database instance.

ASM disks cannot be larger than 2TB.DATA3. It has 4 disks.DATA4). Online Redo Log files and Temp files. It has 1 disk (ARCH1). o +FRA_DG: Archived Logs are kept on this diskgroup.  For NHIA System. o +DATA_DG: Stores Control file. (DATA1. Datafiles. .ASM DISKS  Currently. in 10g and 11gR1.DATA2. ASM manages two diskgroups. and needs to be a minimum of 4MB.

Mirroring—ASM can increase data availability by optionally mirroring any file. which mirrors at the disk level.ASM mirrors at the file level. This even distribution of database files eliminates the need for regular monitoring and I/O performance tuning.Advantages ASM provides the following benefits:  Striping—ASM spreads data evenly across all disks in a disk group to optimize performance and utilization. unlike operating system mirroring. .

ASM automatically redistributes the data so that it is evenly spread across all disks in the disk group. When a disk is added. including the new disk.Advantages Online storage reconfiguration and dynamic rebalancing—ASM permits : o Addition or removal of disks from disk storage system while the database is up. . It is done in the background and with minimal impact to database performance. o The process of redistributing data so that it is also spread across the newly added disks is known as rebalancing.

o ASM automatically assigns file names when files are created.Advantages Manages file creation and deletion o ASM further reduces administration tasks by enabling files stored in ASM disk groups to be managed by Oracle Database. . and automatically deletes files when they are no longer needed.

The mirrored copy of each file extent is always kept on a different disk from the original copy. If a disk fails. ASM can continue to access affected files by accessing mirrored copies on the surviving disks in the disk group.Mirroring Mirroring means keeping redundant copies or mirrored copies of each extent of the file to help avoid data loss caused by disk failures. .

.Database Processes to Support ASM In a database instance there are three sets of processes added to support the ASM diskgroups and infrastructure. o RBAL o ASMB o 000x RBAL – This process performs global opens of all the disks in the disk groups.

.  This connect string is then used to connect into ASM instance.Database Processes to Support ASM -ASMB o This process contacts CSS using the diskgroup name.  Using this persistent connection. and acquires the associated ASM connect string. periodic messages are exchanged to update statistics and provide a heartbeat mechanism.

o Additionally. such as a file creation by a database foreground. the database foreground connects directly to the ASM instance to perform the operation.Database Processes to Support ASM -ASMB  During operations that require ASM intervention. ASMB also sends database IO statistics to ASM instance. database file extent maps are sent by ASM to ASMB.  Upon successful completion of file creation. .

o These slaves are shutdown when not in use. o For example opening a file sends the open request to the ASM instance via a slave. database processes can send messages to the ASM instance.Database Processes to Support ASM .O00x o A group of slave processes establish connections to the ASM instance. o The slave (pool) connections eliminate the overhead of logging into the ASM instance for short requests. o Through this connection pool. o However slaves are not used for long running operations such as creating a file. . where x is a number from 1 to 10.

It manages the interface between the ASM logical data view and the physical disk files. The asmcmd utility is located in $ORACLE_HOME/bin/asmcmd.ASMCMD ASMCMD is a command-line utility introduced in 10gR2 to manage ASM(Automatic Storage Management) diskgroups. The idea of this tool is to make administering the ASM files similar to administering standard operating system files. .

2.Invoking ASMCMD The asmcmd interface is launched by: o Setting the environment for +ASM. o Calling it with the asmcmd command.0]$ export ORACLE_SID=+ASM [oraprod@oradb1 10.2. [oraprod@oradb1 10.0]$ cd $ORACLE_HOME/asm [oraprod@oradb1 asm]$ asmcmd -p .

Specifying the -p option allows the current directory to be displayed in the command prompt.ASMCMD [+] > help asmcmd [-p] [command] The environment variables ORACLE_HOME and ORACLE_SID determine the instance to which the program connects. in the same manner as a SQLPLUS / AS SYSDBA. The user must be a member of the SYSDBA group. like so: ASMCMD [+DATAFILE/ORCL/CONTROLFILE] > . and ASMCMD establishes a bequeath connection to it.

Type "help [command]" to get help on a specific ASMCMD command. commands: -------cd du find help ls lsct lsdg mkalias mkdir pwd rm rmalias .[command] specifies one of the following commands. along with its parameters.

0 prod1 display current directory ASMCMD [+] > pwd + list directory contents ASMCMD [+] > ls DATA_DG/ FRA_DG/ change directory ASMCMD [+] > cd DATA_DG/ ASMCMD [+DATA_DG] > .2.0list diskgroups ASMCMD [+] > lsdg State Type Rebal Unbal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Name MOUNTED EXTERN N N 512 4096 1048576 2047972 476639 0 476639 0 DATA_DG/ MOUNTED EXTERN N N 512 4096 1048576 511993 185369 0 185369 0 FRA_DG/ list all connected Oracle instances ASMCMD [+] > lsct DB_Name Status Software_Version Compatible_version Instance_Name prod CONNECTED 10.0.

ASMCMD [+DATA_DG] > ls prod/ ASMCMD [+DATA_DG] > cd prod/ ASMCMD [+DATA_DG/prod] > ls DATAFILE/ controlfile/ onlinelog/ tempfile/ .

display directory space ASMCMD> find -.remove file/directory .Other ASMCMD Commands ASMCMD> mkdir -.standard UNIX find command ASMCMD> rm -.create (make)directory ASMCMD> du -.

. These views often contain different information depending on whether they are queried from the ASM instance or a dependant database instance.ASM V$ VIEWS The ASM configuration can be viewed using the V$ASM_% views.

Displays a row for each database instance using a disk group managed by the ASM instance. V$ASM_DISKGROUP V$ASM_FILE Displays no rows. V$ASM_OPERATION Displays no rows. DB Instance Returns no rows V$ASM_CLIENT Displays a row for the ASM instance if the database has open ASM files. Displays a row for each file for each long running operation executing in the ASM instance. V$ASM_TEMPLATE Displays a row for each template present in each disk group mounted by the ASM instance.ASM V$ VIEWS View V$ASM_ALIAS ASM Instance Displays a row for each alias present in every disk group mounted by the ASM instance. . V$ASM_DISK Displays a row for each disk in disk groups in use by the database instance. Displays a row for each disk group discovered by the ASM instance. Displays a row for each disk group mounted by the local ASM instance. Displays a row for each file for each disk group mounted by the ASM instance. Displays a row for each template present in each disk group mounted by the ASM instance with which the database instance communicates. Displays a row for each disk discovered by the ASM instance. including disks which are not part of any disk group.

o Provides near-optimal I/O balancing without any manual tuning. o Manages disk redundancy within a disk group. o Enables management of database objects without specifying mount points and filenames. o Supports large files. called disk groups. .Conclusion In summary ASM provides the following functionalities: o Manages groups of disks.

Thank You .