ASM Basic

* The smallest unit of storage written to disk is called an "allocation unit" (AU) and is usually 1MB (4MB recommended for Exadata)
* Very simply, ASM is organized around storing files
* Files are divided into pieces called "extents"
* Extent sizes are typically equal to 1 AU, except in 11g where it will use variable extent sizes that can be 1, 8, or 64 AUs
* File extent locations are maintained by ASM using file extent maps.
* ASM maintains file metadata in headers on the disks rather than in a data dictionary
* The file extent maps are cached in the RDBMS shared pool; these are consulted when an RDBMS process does I/O
* ASM is very crash resilient since it uses instance / crash recovery similar to a normal RDBMS (similar to using undo and redo logging)





Every ASM disk is divided into allocation units (AUs) of the same size.  All AUs are allocated and distribute equally and evenly across all disks. 




For Oracle Database 11g ASM, you can set large AU size




SQL> create diskgroup AN_TEST external redundancy disk 'ORCL:ORADATA_DD501_DISK30' attribute 'au_size' = '2M';


Diskgroup created.


SQL> select name, allocation_unit_size from v$asm_diskgroup;


NAME                           ALLOCATION_UNIT_SIZE
------------------------------ --------------------
DG_DBA_DD501                                1048576
DG_DBA_AU2M                                 2097152




ASM Extents:  When a database file is created in ASM diskgroup, it is composed of a set of ASM extents and distribute evently across all disks.  Each extent consists of AUs on an ASM disk.


  1* select name, total_mb, free_mb from v$asm_diskgroup where group_number = 2
SQL> /


NAME                             TOTAL_MB    FREE_MB
------------------------------ ---------- ----------
DG_QD502                           983640     280462


select count(pxn_kffxp), disk_kffxp, group_kffxp
from x$kffxp
where group_kffxp = 5
group by disk_kffxp, group_kffxp
order by group_kffxp, disk_kffxp


COUNT(PXN_KFFXP) DISK_KFFXP GROUP_KFFXP
---------------- ---------- -----------
           23438          0           5
           23433          1           5
           23430          2           5
           23441          3           5
           23439          4           5
           23442          5           5
           23439          6           5
           23436          7           5
           23441          8           5
           23436          9           5
           23434         10          5


ASM Stripping:  Coarse and fine-grained.


Coarse distribution - each coarse grain file extent is mapped to a single AU
Fine-grained:  each grain is interleaved 128K across groups of 8 AUs.  It should be used for very small files like controlfile and spfile (not good for sequential I/O full table scan).  


Varying AU Sizes:
In Oracle 10g, you must set _parameter to change AU size and requires to bounce ASM instance.  In 11g, you can set au_size to larger size ( > 1M) when creating the diskgroup.

No comments:

Post a Comment