Automatic Storage Management UKOUG RAC & HA SIG September 30, 2010 Frits Hoogland 1
Poll Anyone using ASM currently? Version of ASM? 10.1 10.2 11.1 11.2 Anyone using OMF? As part of ASM implementation Without ASM? 2
ASM - The Oracle definiton http://www.oracle.com/technology/products/database/asm/index.html: (link now gone) Automatic Storage Management (ASM) is a feature in Oracle Database 10g/11g that provides the database administrator with a simple storage management interface that is consistent across all server and storage platforms. As a vertically integrated file system and volume manager, purpose-built for Oracle database files, ASM provides the performance of async I/O with the easy management of a file system. ASM provides capability that saves the DBAs time and provides flexibility to manage a dynamic database environment with increased efficiency. 3
ASM - The Oracle definiton Storage management interface that is consistent across all server and storage platforms Vertically integrated file system and volume manager Purpose-built for Oracle database files Performance of async I/O with the easy management of a filesystem (http://www.oracle.com/technology/products/manageability/database/pdf/asmov.pdf) 4
The database and ASM ASM components (s)pfile CSS The function of the ASM instance Disk and diskgroup management Database and ASM disk I/O 5
Redundancy Volume manager capabilities External redundancy No redundancy at ASM level Normal redundancy Mirroring at ASM level High redundancy Triple mirroring at ASM level 6
Redundancy Is your storage redundant? Purpose of redundancy: stretch MTBF 7
ASM terminology ASM instance Diskgroup Disk Failgroup AU (allocation unit) 8
AU Spreading AU 50- AU 40- Disk header (name, AT, FST, PST) File directory Disk directory AU 30- Active Change Directory AU 20- Continuing Operation Directory Template Directory AU 10- Alias Directory AU 0- Free AU Disk1 9
AU Spreading AU 50- AU 40- Disk header (name, AT, FST, PST) File directory Disk directory AU 30- Active Change Directory AU 20- Continuing Operation Directory Template Directory AU 10- Alias Directory AU 0- Free AU Disk1 Disk2 10
AU Spreading AU 50- AU 40- Disk header (name, AT, FST, PST) File directory Disk directory AU 30- Active Change Directory AU 20- Continuing Operation Directory Template Directory AU 10- Alias Directory AU 0- Free AU Disk1 Disk2 Disk3 11
Allocation policies Scenario 1: Allocation of 10 AU s Diskgroup DG1; 1 disk: D1 DG1,D1 0... 50 51 52 53 54 55 56 57 58 59 60 12
Allocation policies Scenario 2: Allocation of 10 AU s Diskgroup DG1; 2 disks: D1,D2 (equally sized) DG1,D1 0... 50 51 52 53 54 55 DG1,D2 0... 25 26 27 28 29 30 13
Allocation policies Scenario 3: Allocation of 10 AU s Diskgroup DG1; normal redundacy 2 FG s: FG1,FG2; 4 disks: D1,D2,D3,D4 (eq. sized) DG1,FG1,D1 0... 50 51 52 53 54 55 DG1,FG1,D2 0... 25 26 27 28 29 30 DG1,FG2,D3 0... 50 51 52 53 54 55 DG1,FG2,D4 0... 25 26 27 28 29 30 14
Allocation policies Scenario 4: Allocation of AU s Diskgroup DG1; external redundacy 3 disks: D1,D2,D3 (eq. sized) DG1,D1 0... 50 51 52 53 54 55 56 57 58 59 60 61 DG1,D2 0... 25 26 27 28 29 30 31 32 33 34 35 36 DG1,D3 0... 17 18 19 20 21 22 23 24 ORA-15041: diskgroup space exhausted 15
Allocation policies Scenario 5: Allocation of 10 AU s Diskgroup DG1; external redundacy 2 disks: D1,D2 (unequally sized) DG1,D1 0... 50 51 52 53 54 DG1,D2 0... 25 26 27 28 29 30 31 16
How ASM tunes I/O I/O tuning is done using the allocation policy This means no tuning is done on runtime Mirror/secondary AU reads ASM_PREFERRED_READ_FAILURE_GROUP Corruption found Unequal sized disk (!!) 17
Oracle Managed Files First appeard in version 9 Goal: easy database files management Did never gain wide acceptance (AFAIK) Re-introduced with ASM 18
Oracle Managed Files OMF & ASM are separate options OMF can be used without ASM, and vice versa OMF makes sense with ASM File structure standardisation File naming standardisation No manual action needed with file manipulation Database removal? 19
ASM Disks ASM sees a disk as an individual entity That is why ASM stripes everything over all disks Is a disk a real individual entity nowadays? SAN/NAS anyone? Anyone who uses DAS for production databases? 20
ASMLib Support library for ASM Kernel module Disks for ASM can be used in three ways: Raw devices Block devices ASMLib devices 21
ASMLib Rumored to have started as a framework for storage vendors to add functionality Reported functionality: Device name labels Device ownership and permissions Async I/O management I/O optimisation Sanity checkups - (http://blogs.oracle.com/alejandrovargas/newsitems/viewfullitems$96) 22
ASMLib Device name labels NOT the diskname in ASM Device ownership and rights ASMLib creates a meta device with correct rights Clusterware files Can be accomplished with udev - (http://www.oracle.com/technology/products/database/asm/pdf/device-mapper-udev-crs-asm%20rh4.pdf) 23
ASMLib Async I/O management Using ASMLib there s a synchronous write to metadevice Async I/O is enabled by default I/O optimisation Same I/O using different codepath No I/O optimisation in ASMLib according to Wim Coekaerts - (http://forums.oracle.com/forums/thread.jspa?threadid=498215) 24
ASMLib Sanity checkups Ownership and rights? Can anyone think of any other checkup? Partition/disk name persistence /dev/sd* /dev/disk/by-id/! ASM recognises disks by name in the diskheader! 25
ASMLib Do NOT use ASMLib No added functionality which can not be resolved in an other way Extra layer in the technology stack Add a kernel dependency Only available on linux 26
Advantages of ASM (Part of) volume manager- & filesystemmanagement become DBA responsibility Database files become black boxed Everything always striped over all disks in a diskgroup RMAN mandatory for backup & restore No filesystem imposed limits RAC / cluster aware 27
Disadvantages of ASM (Part of) volume manager- & filesystemmanagement becomes DBA responsibility Database files become black boxed Everything always striped over all disks in a diskgroup RMAN mandatory for backup & restore Relative young Unequal disk sizes give unequal I/O 28
Conclusion File / filesystem management Error prone Hard to maintain standards Principal deployment of SAME Which is good Necessary to know ASM inner working Rebalancing ASM and online storage migration 29
30 Q & A
Bibliography http://docs.oracle.com http://otn.oracle.com http://dims.ncsa.uiuc.edu/san/src/linuxmpio.pdf http://jarniel.wordpress.com http://canali.web.cern.ch/canali 31