Professional Documents
Culture Documents
Oracle ASM
CERN - IT Department
CH-1211
Genve 23
LCG
Switzerland
www.cern.ch/it
Outline
Oracle ASM for DBAs
Introduction and motivations
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
ASM
Oracle Automatic Storage Management
Provides the functionality of a volume manager
and filesystem for Oracle (DB) files
Works with RAC
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
SAN
Storage
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
Mirroring
Striping
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
Failgroup1
Striping
Failgroup2
Inside Oracle ASM, UKOUG Dec 2007 - 5
Failgroups
and ASM
mirroring
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
View Name
X$ Table
Description
V$ASM_DISKGROUP
X$KFGRP
V$ASM_DISK
X$KFDSK, X$KFKID
V$ASM_FILE
X$KFFIL
V$ASM_ALIAS
X$KFALS
V$ASM_TEMPLATE
X$KFTMTA
V$ASM_CLIENT
X$KFNCL
V$ASM_OPERATION
X$KFGMG
N.A.
X$KFKLIB
N.A.
X$KFDPARTNER
N.A.
X$KFFXP
N.A.
X$KFDAT
ASM Parameters
Notable ASM instance parameters:
*.asm_diskgroups='TEST1_DATADG1','TEST1_
RECODG1'
*.asm_diskstring='/dev/mpath/itstor*p*'
*.asm_power_limit=5
*.shared_pool_size=70M
*.db_cache_size=50M
*.large_pool_size=50M
*.processes=100
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
X$KFFXP
Column Name
Description
NUMBER_KFFXP
COMPOUND_KFFXP
INCARN_KFFXP
XNUM_KFFXP
PXN_KFFXP
GROUP_KFFXP
DISK_KFFXP
AU_KFFXP
LXN_KFFXP
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
X$KFDAT
where fnum_kfdat=(select
file_number from v$asm_alias where
name='spfiletest1.ora');
GROUP#
DISK#
AU#
---------- ---------- ---------1
4
14838
1
16
17528
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
X$KFDAT
Column Name (subset)
Description
GROUP_KFDAT
NUMBER_KFDAT
COMPOUND_KFDAT
AUNUM_KFDAT
V_KFDAT
FNUM_KFDAT
XNUM_KFDAT
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
dbms_diskgroup.read(hdl,1,blkSz,data_buf);
dbms_output.put_line(data_buf);
end;
/
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
DBMS_DISKGROUP
Can be used to read/write ASM files directly
Its an Oracle internal package
Does not require a RDBMS instance
11gs asmcmd cp command uses dbms_diskgroup
Procedure Name
Parameters
dbms_diskgroup.open
dbms_diskgroup.read
dbms_diskgroup.createfile
dbms_diskgroup.close
(:hdl)
dbms_diskgroup.commitfile
(:handle)
dbms_diskgroup.resizefile
(:handle,:fsz)
dbms_diskgroup.remap
dbms_diskgroup.getfileattr
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
RMAN
DBMS_FILE_TRANSFER
FTP (XDB)
WebDAV (XDB)
They all require a RDBMS instance
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
Example:
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
sys@+ASM1>select number_kffxp,
xnum_kffxp from x$kffxp where
group_kffxp=1 and disk_kffxp=20 and
au_kffxp=451;
NUMBER_KFFXP XNUM_KFFXP
------------ ---------268
17
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
B0
B1
B2
B3
B4
B5
B6
B7
AU = 1MB
A0
A1
A2
A3
A4
A5
A6
A7
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
Metadata Files
ASM diskgroups contain hidden files
Not listed in V$ASM_FILE (file# <256)
Details are available in X$KFFIL
In addition the first 2 AUs of each disk are marked as
file#=0 in X$KFDAT
Example (10g):
GROUP#
FILE#
FILESIZE_AFTER_MIRR RAW_FILE_SIZE
---------- ---------- ------------------- ------------1
1
2097152
6291456
1
2
1048576
3145728
1
3
264241152
795869184
1
4
1392640
6291456
1
5
1048576
3145728
1
6
1048576
3145728
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
ASM Rebalancing
Rebalancing is performed (and mandatory)
after space management operations
Goal: balanced space allocation across disks
Not based on performance or utilization
ASM spreads every file across all disks in a diskgroup
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
Does it scale?
In 10g serialization wait events can limit
scalability
Even at maximum speed rebalancing is not
always I/O bound
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
Rebalancing, an Example
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
Rebalancing Workload
When ASM mirroring is used (e.g. with
normal redundancy)
Rebalancing operations can move more data
than expected
Example:
5 TB (allocated): ~100 disks, 200 GB each
A disk is replaced (diskgroup rebalance)
The total IO workload is 1.6 TB (8x the disk size!)
How to see this: query v$asm_operation, the column
EST_WORK keeps growing during rebalance
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
8675 IOPS
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
Implementation Details
Multipathing
Linux Device Mapper (2.6 kernel)
Block devices
RHEL4 and 10gR2 allow to skip raw devices mapping
External half of the disk for data disk groups
JBOD config
No HW RAID
ASM used to mirror across disk arrays
HW:
Storage arrays (Infortrend): FC controller, SATA disks
FC (Qlogic): 4Gb switch and HBAs (2Gb in older HW)
Servers are 2x CPUs, 4GB RAM, 10.2.0.3 on RHEL4,
RAC of 4 to 8 nodes
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
Conclusions
CERN deploys RAC and ASM on Linux on
commodity HW
2.5 years of production, 110 Oracle 10g RAC
nodes and 300TB of raw disk space (Dec 2007)
ASM metadata
Most critical part, especially rebalancing
Knowledge of some ASM internals helps
troubleshooting
ASM on VLDB
Know and work around pitfalls in 10g
11g has important manageability and
performance improvements
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
Q&A
Q&A
Links:
http://cern.ch/phydb
http://twiki.cern.ch/twiki/bin/view/PSSGroup/ASM_Internals
http://www.cern.ch/canali
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it