Oracle ASM on 11g R2: Installing Grid Infrastructure



Note: For steps on how to configure Oracle ASM before installing Grid infrastructure, check here.



This Grid Infrastructure installation on a standalone server will perform the following steps:
  1. Install Oracle ASM software
  2. Install Oracle Restart software
  3. Install and configure the Listener
  4. Create an ASM Disk group
  5. Create and configure an ASM Instance on the machine

Before proceeding, make sure that you set the path to the Oracle base directory.
On bash shell:
$ ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
$ echo $ORACLE_BASE
/u01/app/oracle

  • Logged as the Grid Infrastructure user owner,change directory to the grid infrastructure media directory, run the installation program and follow the installation steps below.
  • In our case, we will set up a single owner environment, so make sure you're logged as the user oracle.
$ ./runInstaller

Starting Oracle Universal Installer...

Checking Temp space: must be greater than 80 MB.   Actual 5902 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 2047 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2010-09-18_08-01-12PM. Please wait ...
$ 

Select installation type
  • Select option to install and configure Grid Infrastructure for a standalone server.
Select language
  • In the next screen, Select language
Select disks to form the disk group
  • The next string should list all the disks previously configured for ASM use.
  • These candidate disks should have been discovered at boot time by ASMLib.
  • If no disks are listed:
(a) Check if disk devices ownership is appropriately configured.
The disk devices must be owned by the user performing the grid installation.
Check user and group ownership with the command:
# ls -l /dev/oracleasm/disks/
total 0
brw-rw---- 1 oracle dba 8, 17 Set 18 22:33 DISK1
brw-rw---- 1 oracle dba 8, 33 Set 18 22:52 DISK2
brw-rw---- 1 oracle dba 8, 49 Set 18 22:52 DISK3
brw-rw---- 1 oracle dba 8, 65 Set 18 22:53 DISK4
(b) check whether ASMLib driver is loaded:
# oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes

# oracleasm listdisks
DISK1
DISK2
DISK3
DISK4
(c) Check the default discovery string on the installer.
In linux, the default discovery strign is '/dev/raw*'.
Click on the Change Discovery Path button and type '/dev/oracleasm/disks/*' (without quotes!).
This should list all the disks you have previously configured.

Configure ASM Disk Group
  • Select name for the disk group being created and select the disks that will compose this group.
  • Here we choose normal redundancy and create the oradata_dskgrp with disk1:(/dev/sdb1,3Gb) and disk3:(/dev/sdd1, 3Gb).
  • Each Oracle ASM disk is divided into allocation units (AU).
  • An allocation unit is the fundamental unit of allocation within a disk group and by default it is 1 Mb.












Specify the passwords for SYS and ASMSNMP users.
  • These users are created in the ASM Instance.
  • To manage an ASM Instance, a user needs the SYSASM role, which grants full access to all ASM disks (including authority to created and delete ASM disks).
  • The user ASMSNMP, with only SYSDBA role, can monitor but does not have full access to the ASM diks.
Select the name of the OS groups to be used for OS authentication to ASM:
Select installation location.
In the next two screens, accept or change the location for oracle grid home directory, and accept the location for the inventory directory (if this is the first oracle install in the machine)
Check whether all installation prerequisites were met. If so, proceed.
Review contents and click Install.
Run the Post-installation scripts (as root)
# ./root.sh 
Running Oracle 11g root.sh script...

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME=  /u01/app/oracle/product/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...

Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
2010-09-18 00:16:18: Checking for super user privileges
2010-09-18 00:16:18: User has super user privileges
2010-09-18 00:16:18: Parsing the host name
Using configuration parameter file: /u01/app/oracle/product/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE 
Creating OCR keys for user 'oracle', privgrp 'oinstall'..
Operation successful.
CRS-4664: Node quark successfully pinned.
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting
ADVM/ACFS is not supported on oraclelinux-release-5-6.0.1

quark     2010-09-18 00:16:54     /u01/app/oracle/product/11.2.0/grid/cdata/quark/backup_20100918_001654.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
Updating inventory properties for clusterware
...

  • When the installation completes, you should have an ASM instance up and running.
  • Some of the processes running include:
$ ps -ef |grep ora
...
oracle   17900     1  0 00:16 ?        00:00:03 /u01/app/oracle/product/11.2.0/grid/bin/ohasd.bin reboot
          --> This is the Oracle Restart (Oracle High Availability Service) daemon.
oracle   18356     1  0 00:18 ?        00:00:01 /u01/app/oracle/product/11.2.0/grid/bin/oraagent.bin
          --> Extends clusterware to support Oracle-specific requirements and complex resources.
          --> Runs server callout scripts when FAN events occur. 
          --> Pprocess was known as RACG in Oracle Clusterware 11g release 1 (11.1).
oracle   18375     1  0 00:18 ?        00:00:00 /u01/app/oracle/product/11.2.0/grid/bin/tnslsnr LISTENER -inherit
oracle   18563     1  0 00:18 ?        00:00:00 /u01/app/oracle/product/11.2.0/grid/bin/cssdagent
          --> Starts, stops and monitors Oracle Clusterware
oracle   18565     1  0 00:18 ?        00:00:00 /u01/app/oracle/product/11.2.0/grid/bin/orarootagent.bin
          --> specialized oraagent process that helps crsd manage resources 
          (con't) owned by root, such as the network, and the Grid virtual IP address.
oracle   18599     1  0 00:18 ?        00:00:00 /u01/app/oracle/product/11.2.0/grid/bin/diskmon.bin -d -f
          --> I/O Fencing and SKGXP HA monitoring daemon
oracle   18600     1  0 00:18 ?        00:00:00 /u01/app/oracle/product/11.2.0/grid/bin/ocssd.bin 
          --> Oracle Cluster Synchronization Service Daemon (OCSSD). 
          --> performs some of the clusterware functions on UNIX-based systems
          --> ocssd.bin is required for ASM Instance. 

oracle   18884     1  0 00:19 ?        00:00:00 asm_pmon_+ASM  ----
oracle   18888     1  0 00:19 ?        00:00:00 asm_vktm_+ASM      |
oracle   18894     1  0 00:19 ?        00:00:00 asm_gen0_+ASM      |
oracle   18898     1  0 00:19 ?        00:00:00 asm_diag_+ASM      |
oracle   18902     1  0 00:19 ?        00:00:00 asm_psp0_+ASM      |
oracle   18906     1  0 00:19 ?        00:00:00 asm_dia0_+ASM      |
oracle   18910     1  0 00:19 ?        00:00:00 asm_mman_+ASM      |==================
oracle   18914     1  0 00:19 ?        00:00:00 asm_dbw0_+ASM      |=>     +ASM Instance 
oracle   18918     1  0 00:19 ?        00:00:00 asm_lgwr_+ASM      |=> background processes
oracle   18922     1  0 00:19 ?        00:00:00 asm_ckpt_+ASM      |==================
oracle   18926     1  0 00:19 ?        00:00:00 asm_smon_+ASM      |
oracle   18930     1  0 00:19 ?        00:00:00 asm_rbal_+ASM      |
oracle   18934     1  0 00:19 ?        00:00:00 asm_gmon_+ASM      |
oracle   18938     1  0 00:19 ?        00:00:00 asm_mmon_+ASM      |
oracle   18942     1  0 00:19 ?        00:00:00 asm_mmnl_+ASM  ----
oracle   19119 13210  0 00:23 pts/2    00:00:00 ps -ef
oracle   19120 13210  0 00:23 pts/2    00:00:00 grep ora
$


using Oracle Restart
  • When created, a new database instance will automatically register with Oracle Restart.
  • Once added to the Oracle Restart configuration, if the database then accesses data in an Oracle ASM disk group, a dependency between the database that disk group is created.
  • Oracle Restart then ensures that the disk group is mounted before attempting to start the database.

About SRVCTL
  • You can use SRVCTL commands to add, remove, start, stop, modify, enable, and disable a number of entities, such as databases, instances, listeners, SCAN listeners, services, grid naming service (GNS), and Oracle ASM.
  • SRVCTL utility can be used to start and stop the Oracle Restart components manually.
  • When you start/stop a component with SRVCTL, any components on which this component depends are automatically started/stopped first, and in the proper order.
  • Important Note:
    • To manage Oracle ASM on Oracle Database 11g R2 installations, use the SRVCTL binary in the Oracle Grid Infrastructure home for a cluster (Grid home).
    • If you have Oracle RAC or Oracle Database installed, then you cannot use the SRVCTL binary in the database home to manage Oracle ASM.

Usage: srvctl command object []
    commands: enable|disable|start|stop|status|add|remove|modify|getenv|setenv|unsetenv|config
    objects: database|service|asm|diskgroup|listener|home|ons|eons

(a) check status of grid services and objects
jdoe@quark $ srvctl status asm
ASM is running on quark

jdoe@quark $ srvctl status diskgroup -g  oradata_dskgrp
Disk Group oradata_dskgrp is running on quark

jdoe@quark $ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): quark

-- Displaying the running status of all of the components that are managed by Oracle Restart in the specified Oracle home. 
-- The Oracle home can be an Oracle Database home or an Oracle Grid Infrastructure home.

jdoe@quark $ ./srvctl status home -o /u01/app/oracle/product/11.2.0/grid -s /home/oracle/statefile
Disk Group ora.ORADATA_DSKGRP.dg is running on quark
ASM is running on quark
Listener LISTENER is running on node quark


(b) The srvctl config command displays the Oracle Restart configuration of the specified component or set of components
jdoe@quark $ srvctl config asm -a
ASM home: /u01/app/oracle/product/11.2.0/grid
ASM listener: LISTENER
Spfile: +ORADATA_DSKGRP/asm/asmparameterfile/registry.253.768442773
ASM diskgroup discovery string: /dev/oracleasm/disks
ASM is enabled.

jdoe@quark $ srvctl config listener
Name: LISTENER
Home: /u01/app/oracle/product/11.2.0/grid
End points: TCP:1521

-- Display configuration and enabled/disabled status for the database with the DB_UNIQUE_ID orcl:
jdoe@quark $ srvctl config database -d orcl -a

Database unique name: orcl
Database name: orcl
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/orcl/spfileorcl.ora
Domain: us.example.com
Start options: open
Stop options: immediate
Database role:
Management policy: automatic
Disk Groups: DATA
Services: mfg,sales
Database is enabled

No comments:

Post a Comment