Oracle Automatic Storage Management (ASM)
Version 12.1.0.1

General Information
Library Note Morgan's Library Page Footer
The Library is currently in the process of being upgraded from Oracle Database Version 11.2.0.3 to 12.1.0.1. Demos are being upgraded to reflect the new Container paradigm as well as EBR (Edition Based Redefinition) and may contain references to CDBs, PDBs, and other objects you may not be familiar with such as CDB_OBJECTS_AE: Welcome to 12c.
Purpose  
Operating System Oracle Enterprise Linux 6.2 or above
Dependencies
GV_$ASM_ALIAS GV_$ASM_DISKGROUP GV_$ASM_FILE
GV_$ASM_CLIENT GV_$ASM_DISKGROUP_STAT GV_$ASM_OPERATION
GV_$ASM_DISK GV_$ASM_DISK_STAT GV_$ASM_TEMPLATE
 
O/S Configuration as root
Install Oracle Validated configuration rpm rpm -Uhv oracle-validated-<version>-<release>.rpm

-- review /etc/sysconfig/oracle-validated/results/orakernel.log
Create Grid Groups and the Grid Binaries Owner /usr/sbin/groupadd -g 501 ginstall
/usr/sbin/groupadd -g 502 gdba
/usr/sbin/groupadd -g 503 goper
/usr/sbin/useradd -u 500 -m -g ginstall -G gdba,goper grid
id grid

-- set the password to oracle1 (I used ora123 for PTC)
passwd grid
Create Installation Directory Tree mkdir -p /app/grid
chown -R grid:gdba /app/grid
chmod -R 775 /app/grid

mkdir /stage
chown -R grid:gdba /stage
Alter kernel parameters if any do not match the values at right fs.aio-max-nr = 3145728
fs.file-max = 6815744
kernel.core_uses_pid=1
kernel.msgmni=2878
kernel.msgmax=8192
kernel.msgmnb=65536
kernel.sem = 250 32000 100 142
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.shmmni = 4096
kernel.sysrq=1
net.core.rmem_default =262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route=0
net.ipv4.ip_forward = 0
net.ipv4.ip_local_port_range = 9000 65500
net.ipv4.tcp_syncookies=1
tcp.ipv4.tcp_wmem = 262144 262144 262144
tcp.ipv4.tcp_rmem = 4194304 4194304 4194304

-- activate changes

/sbin/sysctl -p
Modify Default Profile -- if Bourne, Korn or Bash shell. Check the install docs if C shell
cat >> /etc/profile <<EOF
if [ $USER = "grid" ]; then
  ulimit -u 16384 -n 65536
  umask 022
fi

if [ $USER = "oracle" ]; then
  ulimit -u 16384 -n 65536
  umask 022
fi
EOF
Set Shell Limits -- modify limits.conf
cat >> /etc/security/limits.conf <<EOF
oracle hard core unlimited
oracle hard memlock 50000000
oracle hard nofile 131072
oracle hard nproc 131072
oracle soft core unlimited
oracle soft memlock 50000000
oracle soft nofile 131072
oracle soft nproc 131072
EOF

-- modify /etc/pam.d/ login
session required pam_limits.so
Modify .bashrc # cd /home/grid

vi .bashrc

-- append the following:
umask 022

GRID_HOSTNAME=?.mlib.org
GRID_HOME=/app/grid
LD_LIBRARY_PATH=$GRID_HOME/lib:$LD_LIBRARY_PATH
TMP=/tmp
TEMP=/tmp
TMPDIR=/tmp
PATH=$GRID_HOME/bin:$PATH
export GRID_HOSTNAME GRID_HOME  LD_LIBRARY_PATH
export TMP TEMP TMPDIR
export PATH

alias gr='cd $GRID_HOME'
alias asm='asmclb'

-- close all open terminal windows and open new ones

$ set

-- validate the environment
 
notes unzip the installation files and verify owned by grid:ginstall
or chown -R grid:ginstall grid
 
Clusterware Installation as root
Preparation
Step 1: Accept the defaults and click [Next]
Step 2: Accept the defaults and click [Next]
Step 3: Accept the defaults and click [Next]
Step 4: Accept the defaults and click [Next]
Step 4: Accept the defaults and click [Next]
Step 4: Accept the defaults and click [Next]
Step 5: Accept the defaults and click [Next]
Step 6: Accept the defaults and click [Next]
Step 7: Accept the defaults and click [Next]
Step 8: Accept the defaults and click [Next]
Step 9: Accept the defaults and click [Next]
Step 10: Accept the defaults and click [Next]
Step 11: Accept the defaults and click [Next]
Step 11: Accept the defaults and click [Next]
Step 11: Accept the defaults and click [Next]
Step 11: Accept the defaults and click [Next]
Step 11: Accept the defaults and click [Next]
Step 11: Accept the defaults and click [Next]
Step 11: Watch patiently while the progress bar completes its journey to 100%
Step 12: Declare success and click [Close]
Use grid tools to validate installation $ crsctl check crs

$ srvctl status asm

$ ./cluvfy.sh stage –post crsinst -n node1 –verbose > server_post_crsinst.txt
 
ASMCMD Commands
   
 
   
 
   
 
 
CREATE DISKGROUP
Names a group of disks and specifies the Oracle Database to manage it as a logical unit (LUN). Files are spread across all available disks in the group to balance I/O with automatic storage rebalancing whenever the storage configuration changes. CREATE DISKGROUP <diskgroup_name> <HIGH | NORMAL | LOW> REDUNDANCY
[<QUORUM | REGULAR>] [FAILGROUP <failgroup_name>]
DISK <search_string> [NAME <disk_name>] [SIZE <size_clause>] [<FORCE | NOFORCE>]
[ATTRIBUTE <'attribute'=attribute_value>];

Attribute Description
ACCESS_CONTROL.ENABLED TRUE or FALSE
ACCESS_CONTROL.UMASK a umask, for example 022 the defaul is 066
COMPATIBLE.RDBMS The minimum compatible database version for example 11.2
   
   
 
   
   
 
 
ALTER DISKGROUP
ADD ALTER DISKGROUP <disk_group_name> ADD <path_name, path_name, ...>;
[root@mlibp1n1 mapper]# ls -la /dev/oracleasm/disks/POD2_PRD_DG1*
brw-rw---- 1 oracle dba 253, 34 Dec 12 23:10 /dev/oracleasm/disks/POD2_PRD_DG1_01
brw-rw---- 1 oracle dba 253, 61 Dec 12 23:10 /dev/oracleasm/disks/POD2_PRD_DG1_02
brw-rw---- 1 oracle dba 253, 59 Dec 12 23:10 /dev/oracleasm/disks/POD2_PRD_DG1_03
brw-rw---- 1 oracle dba 253, 57 Dec 12 23:10 /dev/oracleasm/disks/POD2_PRD_DG1_04
brw-rw---- 1 oracle dba 253, 54 Dec 12 23:10 /dev/oracleasm/disks/POD2_PRD_DG1_05
brw-rw---- 1 oracle dba 253, 52 Dec 12 23:10 /dev/oracleasm/disks/POD2_PRD_DG1_06
brw-rw---- 1 oracle dba 253, 65 Jan 29 03:52 /dev/oracleasm/disks/POD2_PRD_DG1_07
brw-rw---- 1 oracle dba 253, 64 Jan 29 03:52
/dev/oracleasm/disks/POD2_PRD_DG1_08

A second  validation method is:
Login as oracle and source the ASM environment using oraenv
Login to sqlplus as sysasm and run the query to check the status of the newly added disks.


conn / as sysasm

SQL> SELECT name, path, header_status
   2 FROM v$asm_disk
   3 WHERE header_status = 'PROVISIONED';

NAME                           PATH                           HEADER_STATUS
------------------------------ ------------------------------ -----------------
                               ORCL:POD2_PRD_DG1_08           PROVISIONED
                               ORCL:POD2_PRD_DG1_07           PROVISIONED


A third  validation method is:

/usr/sbin/oracleasm-discover 'ORCL:*'

Output:

Discovered disk: ORCL:POD2_PRD_DG1_07 [268429957 blocks (137436137984 bytes), maxio 512]
Discovered disk: ORCL:POD2_PRD_DG1_08 [268429957 blocks (137436137984 bytes), maxio 512]


If RAC ensure that you can see disk on all nodes. you may have to run the following as root

/usr/sbin/oracleasm scandisks /dev/mapper/ pod2-prd-dg1-07p1
/usr/sbin/oracleasm scandisks /dev/mapper/ pod2-prd-dg1-08p1


Now add the disks to diskgroup

SQL> select name, total_mb, free_mb from v$asm_diskgroup;

NAME                             TOTAL_MB    FREE_MB
------------------------------ ---------- ----------
DG1                                786414      47918
DG2                                327640     136228
DG3                                 65504      24260
DG4                                262112     256888

SQL> ALTER DISKGROUP DG1 ADD DISK 'ORCL:POD2_PRD_DG1_07','ORCL:POD2_PRD_DG1_08';
Diskgroup altered.

SQL> SELECT name, total_mb, free_mb FROM v$asm_diskgroup;

NAME                             TOTAL_MB    FREE_MB
------------------------------ ---------- ----------
DG1                               1048552     310050
DG2                                327640     136228
DG3                                 65504      24260
DG4                                262112     256888
 
DROP DISKGROUP
   
 
   
 
   
   
 
Add a disk to a diskgroup
   
   

Related Topics
AMDU
KFED
RAC

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2014 Daniel A. Morgan All Rights Reserved