Oracle 11gr2 ASM On AIX
Oracle 11gr2 ASM On AIX
R. Ballough
[email protected]
IBM Advanced Technical Support
October 1, 2013
Version 12/18/2013
________________________________________________________________________
Page 1 of 27
Version 12/18/2013
________________________________________________________________________
Page 2 of 27
Version 12/18/2013
________________________________________________________________________
Page 3 of 27
Introduction
Prior to the release of Oracle Database Server 10g, database administrators had to choose
between raw logical volumes or filesystems to house their data files. The decision to
implement one or the other was always a compromise, as raw logical volumes offer the
best performance, but filesystems are easier to administer.
The choice of filesystems offers many features for the dba. Since the unit of storage
allocation is a filesystem, and the filesystem is owned by the Oracle user, the DBA can
allocate additional data files as needed. Oracles autoextend feature can also be used to
increase the space allocation for data files when necessary, and free space can be easily
seen at the system level to be used with capacity planning tools. When it comes to
backups, the data copy can also take place at the system level, backing up only used data.
When raw logical volumes are used, a logical volume must be allocated for each database
file. Adding or resizing a logical volume must be performed by the systems
administrator. For backups, either RMAN must be used, or the entire raw logical
volume must be written to the backup media, including unused sectors.
Although the management issues are more complex, raw logical volumes traditionally
offered the best performance, though filesystem improvements to bypass the filesystem
buffer cache such as AIXs Concurrent I/O (CIO) can offer response time near that of
raw in some configurations.
In Oracle 10g, a new choice for data file storage was introduced, called Automatic
Storage Management (ASM).
Built on raw device files, ASM offers the performance
of raw logical volumes, but offers the configuration flexibility of filesystems to the DBA.
As ASM has largely replaced raw logical volume configurations, Oracle has desupported
raw device storage in 12c.1
The purpose of this paper is to provide information about the requirements and
considerations for ASM implementation for a both single instance and Real Applications
Cluster (RAC) environments using the AIX operating system.
Version 12/18/2013
________________________________________________________________________
Page 4 of 27
ASM also supports NFS files as ASM disks, and for that configuration, the NFS filesystem is used as the
ASM device rather than a raw device file. However, this configuration is seen infrequently, so it is out of
scope for this paper.
Version 12/18/2013
________________________________________________________________________
Page 5 of 27
New in 11gR2 is a logical volume and filesystem layer in ASM, called ASM Dynamic
Volume Manager (ADVM) and ASM Cluster File System (ACFS), respectively. This
new layer may be used for non-database files such as application files, exports, even
Oracle database binaries. ADVM and ACFS are not intended for Oracle data files or
Oracle Clusterware files. The parameter compatible.rdbms must be at least 11.2.0.2 in
order to user ADVM and ACFS.
Or the primary user and group of the Grid Infrastructure software, if a different user id is configured for
this role.
Version 12/18/2013
________________________________________________________________________
Page 6 of 27
Versions prior to 11gR2 can use DBCA for ASM configuration, but ASM diskgroups
must be created manually in order to alter the AU_SIZE. Manual creation, as well as
2013, IBM Advanced Technical Support Techdocs
http://w3.ibm.com/support/Techdocs
Version 12/18/2013
________________________________________________________________________
Page 7 of 27
Datafiles can be created normally on the newly created ASM diskgroup, using the '+' sign
and diskgroup name rather than the usual file and path name.
export ORACLE_SID=client_sid
SQL> create tablespace bigautbs datafile '+BIGAU' size 64M;
Tablespace created.
The AU_SIZE can be verified from the v$asm_diskgroup view within the ASM instance,
for example:
SQL> select name, allocation_unit_size from v$asm_diskgroup;
NAME
ALLOCATION_UNIT_SIZE
------------------------------ -------------------DATA
1048576
BIGAU
16777216
Since data file information such as location and free space by are not visible from the
operating system command line when using ASM, Oracle has provided a utility called
ASMCMD to provide a unix-like command line environment for querying information
about ASM storage. The utility was first released in 10.2.0.1, but it has not been until
the 11gR2 release that ASMCMD has evolved to include most commands needed to
manage ASM storage.
Within ASMCMD, the systems administrator will find familiar
navigation commands like cd, cp, du, find, ls, mkdir, pwd, and rm.
Instead of checking the diskgroup AU_SIZE attribute as described earlier, ASMCMD
could be used:
$ export ORACLE_SID=+ASM
$ asmcmd
ASMCMD> lsattr l G data
2013, IBM Advanced Technical Support Techdocs
http://w3.ibm.com/support/Techdocs
Version 12/18/2013
________________________________________________________________________
Page 8 of 27
Value
FALSE
066
8388608
FALSE
11.2.0.0.0
11.1.0.0.0
3.6h
512
The lsdg command lists all disk groups and their attributes, including total and free disk
space:
ASMCMD> lsdg
State
Type
Rebal Sector Block
AU Total_MB Free_MB
Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N
512
4096 8388608
15360
15224
0
15224
0
N DATA/
MOUNTED EXTERN N
512
4096 1048576
10240
8672
0
8672
0
N RECO/
Mount_Stat
Header_Stat
Mode_Stat
CACHED
MEMBER
ONLINE
CACHED
MEMBER
ONLINE
CACHED
MEMBER
ONLINE
CACHED
MEMBER
ONLINE
The iostat command includes performance statistics similar to the operating system iostat
information:
ASMCMD> iostat -t
Group_Name Dsk_Name
DATA
DATA_0000
DATA
DATA_0001
RECO
RECO_0000
RECO
RECO_0001
Reads
8650752
208896
918290432
920691200
Writes
45522944
16384
27210886656
22919404032
Read_Time
.044531
.014472
5.861197
5.49306
Write_Time
6.432436
.001202
1117.007562
804.800452
Information about individual datafiles can be seen, just like at the operating system level,
with the ls command.
ASMCMD> ls -s
Block_Size
Blocks
8192 1048577
Bytes
8589942784
Space
8592031744
Name
CLASS.261.781456745
Version 12/18/2013
________________________________________________________________________
Page 9 of 27
99841
93441
87681
641
817897472
765468672
718282752
5251072
819986432
767557632
720371712
6291456
SYSAUX.266.779650785
SYSTEM.260.779650785
UNDOTBS1.264.779650785
USERS.263.779650785
Databases using ASM can be seen with the ASMCMD command lsct
ASMCMD> lsct
DB_Name Status
Disk_Group
DB06ASM CONNECTED
DATA
DB06ASM CONNECTED
RECO
Software_Version
Compatible_version
Instance_Name
11.2.0.2.0
11.2.0.0.0
DB06ASM
11.2.0.2.0
11.2.0.0.0
DB06ASM
Additional commands available with ASMCMD can be seen by issuing the 'help'
command, and further information about specific commands can be shown with 'help
<command>'
ASMCMD> help
ASMCMD> help chdg
State
Power
If an ACFS filesystem needs to be created, the easiest method is using the ASMCA
utility.
2013, IBM Advanced Technical Support Techdocs
http://w3.ibm.com/support/Techdocs
Version 12/18/2013
________________________________________________________________________
Page 10 of 27
After creation is complete, the new filesystem is visible at the operating system level as
any other filesystem:
grid@lp11 /home/grid$ df -k
Filesystem
1024-blocks
Free %Used
/dev/hd4
458752
152076
67%
/dev/hd2
2686976
142996
95%
/dev/asm/test-114
2097152
1986300
2013, IBM Advanced Technical Support Techdocs
http://w3.ibm.com/support/Techdocs
________________________________________________________________________
Page 11 of 27
rootvg
orabinvg
None
active
active
ASM disks do not need a PVID, as ASM preserves its own mapping between LUNs
based on data preserved in the ASM disk header. Unfortunately, the ASM header and
the AIX PVID are both stored in the same disk region, so assigning a PVID to an ASM
disk will cause ASM header corruption.4
To avoid this conflict, PVIDs should not be assigned to ASM disks unless an AIX LVM
structure is used underneath ASM.
At the operating system level, ASM disks can be identified using the lquerypv
command, which must be executed as root. In the following example, it can be seen that
the disk is an ORCLDISK, the diskgroup name is DATA, and the ASM disk name is
DATA_0000.
root@lp06 / # lquerypv -h /dev/rhdiskASM4
00000000
00820101 00000000 80000000 0EAE8A6C
00000010
00000000 00000000 00000000 00000000
00000020
4F52434C 4449534B 00000000 00000000
00000030
00000000 00000000 00000000 00000000
00000040
0B200000 00000103 44415441 5F303030
00000050
30000000 00000000 00000000 00000000
00000060
00000000 00000000 44415441 00000000
00000070
00000000 00000000 00000000 00000000
00000080
00000000 00000000 44415441 5F303030
00000090
30000000 00000000 00000000 00000000
000000A0
00000000 00000000 00000000 00000000
000000B0
00000000 00000000 00000000 00000000
000000C0
00000000 00000000 01F70A8D 8408D800
4
|...............l|
|................|
|ORCLDISK........|
|................|
|. ......DATA_000|
|0...............|
|........DATA....|
|................|
|........DATA_000|
|0...............|
|................|
|................|
|................|
Version 12/18/2013
________________________________________________________________________
Page 12 of 27
|................|
|................|
|................|
Several improvements have been made in AIX to improve the safety of ASM managed
storage.
In AIX 5.3 TL7 and above, the AIX commands mkvg and extendvg have
been enhanced to check for the presence of an ASM header, and will not overwrite the
ASM information if header data is discovered
# mkvg -y testvg hdiskASM3
0516-1339 mkvg: Physical volume contains some 3rd party volume group.
0516-1397 mkvg: The physical volume hdiskASM3, will not be added to
the volume group.
0516-862 mkvg: Unable to create volume group.
AIX 6.1 TL6 added two important enhancements, the ability to rename hdisks, and the
ability to lock them.
The rendev command allows a disk to be dynamically renamed, so an hdisk can be
labeled with a tag indicating ASM usage, for example, the following command renames
hdisk3 to hdiskASM3:
# rendev l hdisk3 n hdiskASM3
It is strongly recommended to keep the initial hdisk in the name, as this prevents issues
with other tools or utilities expecting AIX LUNs to have the standard naming convention.
The lkdev command locks device attributes from being changed with the chdev
command, which is the command which can explicitly change a PVID.
# lkdev l hdiskASM3 a
hdiskASM3 locked
# chdev -l hdiskASM3 -a pv=clear
chdev: 0514-558 Cannot perform the requested function because hdiskASM3
is currently locked.
Version 12/18/2013
________________________________________________________________________
Page 13 of 27
Version 12/18/2013
________________________________________________________________________
Page 14 of 27
Version 12/18/2013
________________________________________________________________________
Page 15 of 27
Violin Memory
For Violin memory attachment requirements, refer to the technical report Connecting
Violin to AIX and PowerVM . Violin provides a path control module (PCM) for use
with MPIO.
Version 12/18/2013
________________________________________________________________________
Page 16 of 27
While either method is a valid, supported configuration6, there are pros and cons to each
approach. The Clustered Grid Infrastructure method does not prevent data files from
multiple nodes being placed on a common disk group, which can limit maintenance
capabilities where different databases with different SLAs are included in the cluster.
The Clustered Grid Infrastrure method also opens the door for Oracle RAC database
configurations to be installed on top of the shared diskgroup configuration, which may
increase the requirement for purchasing RAC licenses from Oracle.
On the other hand, the Clustered Grid Infrastructure method provides the easiest method
for RAC failover.
The Single-Instance Grid Infrastructure method addresses the potential issues with the
Clustered Grid Infrastructure configuration, as it does not allow the disk group to be
shared across disk groups. However, during failover events it does require an 'alter
diskgroup mount' statement to mount the disk group from the source node on to the target
node of the cluster.
Version 12/18/2013
________________________________________________________________________
Page 17 of 27
Using the ASMCA utility is the easiest way to add the LUN, but the LUNs can also be
added from the SQLPlus command line using the alter diskgroup command:
SQL>
It is also possible to use the ASMCMD command line utility to add a LUN, but an XML
configuration file must be created to specify the changes. More detail on this method
can be seen from the ASMCMD command line by typing in the following command:
ASMCMD> help chdg
Removing a LUN
In theory, the process of removing a LUN from ASM is as simple as using ASMCA or,
from the SQLPlus command line, running the command:
2013, IBM Advanced Technical Support Techdocs
http://w3.ibm.com/support/Techdocs
Version 12/18/2013
________________________________________________________________________
Page 18 of 27
Check to see that the rebalance operation to move data off of the disk has completed:
ASMCMD> lsop
Group_Name Dsk_Num
DATA
REBAL
ASMCMD> lsop
Group_Name Dsk_Num
State
RUN
Power
1
State
Power
In practice, however, depending on the Oracle version, the ASM device file may remain
open. In that case, LUNs can be reassigned to other disk groups, but can't be dropped at
the OS level without closing the open files (generally by shutting down the database
and/or the grid infrastructure clusterware). The asmcmd command 'lsod' shows the
process open against the device:
ASMCMD> lsod
Instance
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Process
oracle@lp06
oracle@lp06
oracle@lp06
oracle@lp06
oracle@lp06
oracle@lp06
oracle@lp06
oracle@lp06
oracle@lp06
oracle@lp06
oracle@lp06
oracle@lp06
oracle@lp06
oracle@lp06
oracle@lp06
(DBW0)
(DBW0)
(GMON)
(GMON)
(LGWR)
(LGWR)
(RBAL)
(RBAL)
(RBAL)
(RBAL)
(TNS V1-V3)
(TNS V1-V3)
(TNS V1-V3)
(TNS V1-V3)
(TNS V1-V3)
OSPID
8126714
8126714
8192118
8192118
7930100
7930100
8061054
8061054
8061054
8061054
12517500
7471334
12517500
7405796
7471334
Path
/dev/rhdiskASM2
/dev/rhdiskASM3
/dev/rhdiskASM2
/dev/rhdiskASM3
/dev/rhdiskASM2
/dev/rhdiskASM3
/dev/rhdiskASM2
/dev/rhdiskASM2
/dev/rhdiskASM3
/dev/rhdiskASM3
/dev/rhdiskASM2
/dev/rhdiskASM2
/dev/rhdiskASM3
/dev/rhdiskASM3
/dev/rhdiskASM3
Even though the disk has clearly been removed from the ASM disk group:
SQL> select name, path, header_status from v$asm_disk where path like
'%ASM2';
NAME
PATH
HEADER_STATUS
----------------------------------------------------------/dev/rhdiskASM2
FORMER
2013, IBM Advanced Technical Support Techdocs
http://w3.ibm.com/support/Techdocs
Version 12/18/2013
________________________________________________________________________
Page 19 of 27
Version 12/18/2013
________________________________________________________________________
Page 20 of 27
Version 12/18/2013
________________________________________________________________________
Page 21 of 27
Version 12/18/2013
________________________________________________________________________
Page 22 of 27
AIX parameters
Asynchronous I/O
AIX can use two types of asynchronous I/O, kernelized and threaded. All filesystem
implementations use threaded asynchronous I/O, and require the configuration of the
threaded asynchronous I/O subsystem through smit aio, typically increasing the number of I/O
servers (maximum # of servers) and the size of the request queue (maximum # of requests).
ASM, however, like raw, uses the kernelized asynchronous I/O subsystem, which does not
require configuration, although in order to install the Oracle software, the STATE to be configured
at system restart for asynchronous I/O threads must be set to available from the smit aio menu.
For Oracle to take advantage of asynchronous I/O, the spfile must include the parameters
disk_asynch_io=TRUE' and 'filesystemio_options=asynch.
Disk and Fibre Channel Maximum Transfer Sizes
The maximum transfer size set at the hdisk and fibre channel device level should be set equal to
the maximum IO size issued by the Oracle database (db_block_size *
db_multiblock_read_count). Typically this is a 1M IO size.
# chdev -l hdiskASM7 -a max_transfer=0x100000
# chdev -l fcs0 -a max_xfer_size=0x100000
Database Parameters
SGA and PGA size
Because ASM does not utliize filesystem buffer cache, it may be necessary to increase the SGA
and/or PGA size following a move from a cached filesystem implementation to ASM in order to
match the performance of the filesystem environment. Utilizing filesystem buffer cache to store
database blocks is generally less efficient than utilizing the SGA to do so; however, if buffer
cache is used, it does increase the available memory to cache data blocks. That memory should
be reassigned to the database instance by increasing any of the following parameters as
appropriate:
db_cache_size - size of area specifically allocated for caching database blocks
2013, IBM Advanced Technical Support Techdocs
http://w3.ibm.com/support/Techdocs
Version 12/18/2013
________________________________________________________________________
Page 23 of 27
Version 12/18/2013
________________________________________________________________________
Page 24 of 27
Version 12/18/2013
________________________________________________________________________
Page 25 of 27
Reminders
Copyright 2013 IBM Corporation. All Rights Reserved.
Neither this documentation nor any part of it may be copied or reproduced in any form or by any
means or translated into another language, without the prior consent of the IBM Corporation.
The information in this paper is provided by IBM on an "AS IS" basis. IBM makes no warranties
or representations with respect to the content hereof and specifically disclaim any implied
warranties of merchantability or fitness for any particular purpose. IBM assumes no
responsibility for any errors that may appear in this document. The information contained in this
document is subject to change without any notice. IBM reserves the right to make any such
changes without obligation to notify any person of such revision or changes. IBM makes no
commitment to keep the information contained herein up to date.
Version 1.0, published December 18, 2013
Trademarks
IBM, AIX, and pSeries are trademarks or registered trademarks of the International Business
Machines Corporation.
Oracle, Oracle9i, Oracle10g, Oracle 11g, Oracle 12c are trademarks or registered trademarks of Oracle
Corporation.
EMC, PowerPath are trademarks or registered trademarks of EMC.
HDS, HDLM are trademarks or registered trademarks of Hitachi.
UNIX is a registered trademark in the United States and other countries exclusively through
X/Open Company Limited.
All other products or company names are used for identification purposes only, and may be
trademarks of their respective owners.
References
Oracle Automatic Storage Management Administrator's Guide 11g Release 2 (11.2)
http://docs.oracle.com/cd/E11882_01/server.112/e18951/asmdiskgrps.htm
Oracle Database Release Notes 11g Release 2 (10.2) for AIX-Based Systems
http://docs.oracle.com/cd/E11882_01/relnotes.112/e23560/toc.htm
Grid Infrastructure Installation Guide 11g Release 2 (11.2) for IBM AIX on POWER
Systems
http://docs.oracle.com/cd/E11882_01/install.112/e24614.pdf
EMC Networked Storage Topology Guide.
https://elabnavigator.emc.com
Hitachi Dynamic Link Manager Software User Guide for AIX
2013, IBM Advanced Technical Support Techdocs
http://w3.ibm.com/support/Techdocs
Version 12/18/2013
________________________________________________________________________
Page 26 of 27
Acknowledgements
Version 12/18/2013
________________________________________________________________________
Page 27 of 27