User Rating: 1 / 5

Star ActiveStar InactiveStar InactiveStar InactiveStar Inactive
 

This article will show an installation of Oracle Grid Infrastructure 12cR1 in silent mode.

The Oracle Grid Infrastructure is the Oracle software that provides system support for Oracle Automatic Storage Management (Oracle ASM), Oracle Restart (for Standalone server only) and Clusterware (for Cluster only). You must install Oracle Grid Infrastructure before installing your database.

New version ...
Grid Infrastructure 12.2 is now available.
It's recommended to install new version instead (check Install Oracle Grid Infrastructure 12cR2).

In this article ...
... root access is needed
... at least 8GB free disk space

Before starting

You will need:

Prerequisites

Users and groups

Create minimal required groups and users with the following commands as root:

[root]$ /usr/sbin/groupadd -g 54321 oinstall
[root]$ /usr/sbin/groupadd -g 54322 dba
[root]$ /usr/sbin/groupadd -g 54327 asmdba
[root]$ /usr/sbin/groupadd -g 54328 asmoper
[root]$ /usr/sbin/groupadd -g 54329 asmadmin
[root]$ /usr/sbin/useradd -u 54322 grid
[root]$ /usr/sbin/usermod -g oinstall -G dba,asmdba,asmoper,asmadmin grid
[root]$ passwd grid

Shell Limits

To improve the performance, you can increase the shell limits for the oracle user by adding the following lines to /etc/security/limits.conf:

grid   soft   nofile   1024
grid   hard   nofile   65536
grid   soft   nproc    16384
grid   hard   nproc    16384
grid   soft   stack    10240
grid   hard   stack    32768

Make sure, the following lines is in /etc/pam.d/login file:

session required pam_limits.so

User limits

Make sure oracle user's default shell is Bourne, Bash, or Korn shell.
Then add the following lines to the end of /etc/profile file:

if [ $USER = "grid" ]; then
    if [ $SHELL = "/bin/ksh" ]; then
        ulimit -p 16384
        ulimit -n 65536
    else
        ulimit -u 16384 -n 65536
    fi
fi

Disable SELinux

Edit /etc/selinux/config config file and set SELINUX to "disabled" or "permissive":

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#       targeted - Targeted processes are protected,
#       mls - Multi Level Security protection.
SELINUXTYPE=targeted

And execute the following commands as root to immediately disable SELinux:

# Disable SELinux
[root]$ /usr/sbin/setenforce 0

# Check current SELinux configuration
[root]$ /usr/sbin/getenforce
    Permissive

Mountpoint with dedicated filesystem

It is advised to create a mountpoint with a dedicated filesystem which will store oracle GI binaries for several reasons:

  • to not to fill up root filesystem
  • to increase this specific filesystem only if needed
  • to be able to move disk and filesystems to an other server

Execute theses commands as root for a new sdb disk:

# Create partition on the new disk
[root]$ fdisk /dev/sdb
    Welcome to fdisk (util-linux 2.23.2).

    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.

    Command (m for help):n
    Partition type:
       p   primary (1 primary, 0 extended, 3 free)
       e   extended
    Select (default p): p
    First cylinder (1-6, default 1): 1
    Last cylinder or +size or +sizeM or +sizeK (1-6, default 6): 6

    Command (m for help): w
    The partition table has been altered!

    Calling ioctl() to re-read partition table.
    Syncing disks.

# Check new created partition
[root]$ fdisk -l /dev/sdb
    Disk /dev/sdb: 6442 MB, 6442450944 bytes, 12582912 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x23f11588

       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1            2048    12582911     6290432   83  Linux

# Create filesystem
[root]$ mkfs -t xfs /dev/sdb1
    meta-data=/dev/sdb1              isize=256    agcount=4, agsize=131008 blks
             =                       sectsz=512   attr=2, projid32bit=1
             =                       crc=0
    data     =                       bsize=4096   blocks=1572608, imaxpct=25
             =                       sunit=0      swidth=0 blks
    naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
    log      =internal log           bsize=4096   blocks=2560, version=2
             =                       sectsz=512   sunit=0 blks, lazy-count=1
    realtime =none                   extsz=4096   blocks=0, rtextents=0

# Create mountpoint
[root]$ mkdir /u01

# Mount mountpoint
[root]$ printf "\n/dev/sdb1\t/u01\txfs\tdefaults\t1 2\n" >> /etc/fstab
[root]$ mount /u01
[root]$ df -m | grep /u01
    /dev/sdb1                6133   4049      2085  67% /u01

# Change permissions
[root]$ chown root.oinstall /u01
[root]$ chmod 775 /u01

Prerequisite packages

Choose to install prerequisite packages manually or with the special oracle preinstall package

# Automatic oracle packages prerequisite install
[root]$ yum -y install oracle-rdbms-server-12cR1-preinstall

# Manually oracle packages prerequisite install
[root]$ yum -y install compat-libcap1 compat-libstdc++-33 gcc-c++ ksh libaio-devel libstdc++-devel glibc

Install Oracle Grid Infrastructure

Unpack installation files

# Go to folder containing installation zip files first
# Then execute this command
$ ls linuxamd64_12102_grid*.zip | xargs -I{} unzip {} 

Check prerequisite verification report

# Setup ssh passwordless access to node
$ cd grid/sshsetup
$ ./sshUserSetup.sh -user grid -hosts "oralab01" -advanced -confirm -noPromptPassphrase
$ cd ../..

# Run verification utility script
$ cd grid
$ ./runcluvfy.sh stage -pre crsinst -fixupnoexec -n oralab01

Silent mode

Here is a simple script you can update for your needs

#!/bin/ksh

  #== variables ==#
ORACLE_INSTALL_SRC=/media/sf_uxora_share/grid

ORACLE_USER=grid
ORACLE_GRP_DBA=dba
ORACLE_GRP_INST=oinstall

ORACLE_GRP_ASMDBA=asmdba
ORACLE_GRP_ASMOPER=asmoper
ORACLE_GRP_ASMADM=asmadmin

ORACLE_INVENTORY_LOC=/u01/app/oraInventory
ORACLE_DB_FOLDER_NAME=grid_1

ORACLE_BASE=/u01/app/grid

HOSTNAME=$(hostname)

  #== Make sure only root can run this script ==#
if [[ $(id -u) -ne 0 ]]; then
   echo "ERROR: This script must be run as root" 1>&2
   exit 1
fi

  #== Retrieve oracle grid version ==#
if [[ -r "${ORACLE_INSTALL_SRC}/stage/products.xml" ]]; then
   ORACLE_VERSION=$( grep  -e "^<COMP NAME=\"oracle.crs\" VER=" "${ORACLE_INSTALL_SRC}/stage/products.xml" 2>/dev/null | cut -c30-35 | grep -e "^[0-9][0-9]\.[0-9]\.[0-9]" )
else
    echo "ERROR: Oracle GRID version cannot be found in ${ORACLE_INSTALL_SRC}/stage/products.xml" 1>&2
    exit 2
fi
 
  #== Check ORACLE_HOME ==#
ORACLE_HOME=${ORACLE_BASE}/product/${ORACLE_VERSION}/${ORACLE_DB_FOLDER_NAME}
if [[ -e "${ORACLE_HOME}" ]]; then
   echo "ERROR: ORACLE_HOME already exists: ${ORACLE_HOME}" 1>&2
   exit 3
fi

  #== Create directories ==#
mkdir -p ${ORACLE_INVENTORY_LOC}
mkdir -p ${ORACLE_BASE}/base
mkdir -p ${ORACLE_HOME}

chown -R ${ORACLE_USER}:${ORACLE_GRP_INST} ${ORACLE_INVENTORY_LOC} ${ORACLE_BASE} ${ORACLE_HOME}
chmod -R 775 ${ORACLE_INVENTORY_LOC} ${ORACLE_BASE} ${ORACLE_HOME}

ORACLE_BASE=${ORACLE_BASE}/base
  #== Oracle GRID install ==#
su - ${ORACLE_USER} -c "
cd ${ORACLE_INSTALL_SRC} && \
./runInstaller -waitForCompletion -showProgress -silent \
SELECTED_LANGUAGES=en \
oracle.install.option=CRS_SWONLY \
oracle.install.asm.OSDBA=${ORACLE_GRP_ASMDBA} \
oracle.install.asm.OSOPER=${ORACLE_GRP_ASMOPER} \
oracle.install.asm.OSASM=${ORACLE_GRP_ASMADM} \
ORACLE_BASE=${ORACLE_BASE} \
ORACLE_HOME=${ORACLE_HOME} \
ORACLE_HOSTNAME=${HOSTNAME} \
INVENTORY_LOCATION=${ORACLE_INVENTORY_LOC}
"

  #== Post install ==#
[[ -r ${ORACLE_HOME}/root.sh ]] && ${ORACLE_HOME}/root.sh || echo "ERROR: root.sh not found"

echo "Please check log file for error."

exit 0

 

Check script output below

# Execute script to install oracle grid
[root]$ ./ora_install_grid.sh
	Starting Oracle Universal Installer...

	Checking Temp space: must be greater than 415 MB.   Actual 4212 MB    Passed
	Checking swap space: must be greater than 150 MB.   Actual 7370 MB    Passed
	Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-06-23_02-44-34AM. Please wait ...[WARNING] [INS-13014] Target environment does not meet some optional requirements.
	   CAUSE: Some of the optional prerequisites are not met. See logs for details. /u01/app/oraInventory/logs/installActions2015-06-23_02-44-34AM.log
	   ACTION: Identify the list of failed prerequisite checks from the log: /u01/app/oraInventory/logs/installActions2015-06-23_02-44-34AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
	You can find the log of this install session at:
	 /u01/app/oraInventory/logs/installActions2015-06-23_02-44-34AM.log

	Prepare in progress.
	..................................................   8% Done.

	Prepare successful.

	Copy files in progress.
	..................................................   14% Done.
	..................................................   25% Done.
	..................................................   30% Done.
	..................................................   35% Done.
	..................................................   40% Done.
	..................................................   46% Done.
	..................................................   51% Done.
	..................................................   56% Done.
	..................................................   61% Done.
	..................................................   66% Done.
	..................................................   71% Done.
	..................................................   76% Done.

	Copy files successful.

	Link binaries in progress.

	Link binaries successful.

	Setup files in progress.
	..............................
	Setup files successful.
	..........
	Setup Inventory in progress.

	Setup Inventory successful.
	..................................................   84% Done.

	Finish Setup successful.
	The installation of Oracle Grid Infrastructure 12c was successful.
	Please check '/u01/app/oraInventory/logs/silentInstall2015-06-23_02-44-34AM.log' for more details.

	Setup Oracle Base in progress.

	Setup Oracle Base successful.
	..................................................   95% Done.

	As a root user, execute the following script(s):
		1. /u01/app/grid/product/12.1.0/grid_1/root.sh



	..................................................   100% Done.
	Successfully Setup Software.
	As install user, execute the following script to complete the configuration.
		1. /u01/app/grid/product/12.1.0/grid_1/cfgtoollogs/configToolAllCommands RESPONSE_FILE=<response_file>

		Note:
		1. This script must be run on the same host from where installer was run. 
		2. This script needs a small password properties file for configuration assistants that require passwords (refer to install guide documentation).


	Check /u01/app/grid/product/12.1.0/grid_1/install/root_uxoravmoel7_2015-06-23_02-48-54.log for the output of root script
	Please check log file for error.

[root]$ cat /u01/app/grid/product/12.1.0/grid_1/install/root_uxoravmoel7_2015-06-23_02-48-54.log
	Performing root user operation.

	The following environment variables are set as:
		ORACLE_OWNER= grid
		ORACLE_HOME=  /u01/app/grid/product/12.1.0/grid_1
	   Copying dbhome to /usr/local/bin ...
	   Copying oraenv to /usr/local/bin ...
	   Copying coraenv to /usr/local/bin ...

	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 script.
	Now product-specific root actions will be performed.

	To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:
	/u01/app/grid/product/12.1.0/grid_1/perl/bin/perl -I/u01/app/grid/product/12.1.0/grid_1/perl/lib -I/u01/app/grid/product/12.1.0/grid_1/crs/install /u01/app/grid/product/12.1.0/grid_1/crs/install/roothas.pl


	To configure Grid Infrastructure for a Cluster execute the following command as grid user:
	/u01/app/grid/product/12.1.0/grid_1/crs/config/config.sh
	This command launches the Grid Infrastructure Configuration Wizard. The wizard also supports silent operation, and the parameters can be passed through the response file that is available in the installation media.

Make sure you check log file for error other than non-critical prerequisites.
Check this article here if you encounter some errors

Post Installation

Configure for standalone server

As you can see in root.sh script log output, the following command line need to be executed as root user to configure as a standalone server:

[root]$ /u01/app/grid/product/12.1.0/grid_1/perl/bin/perl -I/u01/app/grid/product/12.1.0/grid_1/perl/lib -I/u01/app/grid/product/12.1.0/grid_1/crs/install /u01/app/grid/product/12.1.0/grid_1/crs/install/roothas.pl
    Using configuration parameter file: /u01/app/grid/product/12.1.0/grid_1/crs/install/crsconfig_params

Configure for cluster

coming soon...

User profile

Add to the ~/.bash_profile if use bash or ~/.profile if use ksh as shell login

umask 022

export EDITOR=vi
export NLS_LANG='American_America.UTF8'

# Keyboard
stty erase ^?
set -o vi

# UNIX Prompt
export PS1='[\u@\h:\w (${ORACLE_SID:-"no sid"})]$ '

# For oracle grid
ORACLE_HOME=/u01/app/grid/product/12.1.0/grid_1
ORACLE_BASE=/u01/app/grid/base
ORACLE_SID=+ASM
PATH=$ORACLE_HOME/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export ORACLE_HOME ORACLE_BASE ORACLE_SID PATH LD_LIBRARY_PATH PS1
alias crsstat='crsctl status resource -t'
alias sqasm='sqlplus / as sysasm'

# aliases
alias ll='ls -l --color=tty'
alias mv='mv -i'
alias rm='rm -i'

alias cdoh='cd $ORACLE_HOME'
alias cdtns='cd $ORACLE_HOME/network/admin'
alias cdadm='cd $ORACLE_BASE/admin/$ORACLE_SID'

alias sq='sqlplus / as sysdba'
alias os='echo $ORACLE_SID'

Add listener

[grid]$ srvctl add listener -l LISTENER
[grid]$ srvctl start listener

List status ressources

[grid]$ crsctl status resource -t
    --------------------------------------------------------------------------------
    Name           Target  State        Server                   State details       
    --------------------------------------------------------------------------------
    Local Resources
    --------------------------------------------------------------------------------
    ora.DATA.dg
                   ONLINE  ONLINE       oralab01                 STABLE
    ora.FRA.dg
                   ONLINE  ONLINE       oralab01                 STABLE
    ora.LISTENER.lsnr
                   ONLINE  ONLINE       oralab01                 STABLE
    ora.asm
                   ONLINE  ONLINE       oralab01                 Started,STABLE
    ora.ons
                   OFFLINE OFFLINE      oralab01                 STABLE
    --------------------------------------------------------------------------------
    Cluster Resources
    --------------------------------------------------------------------------------
    ora.cssd
          1        ONLINE  ONLINE       oralab01                 STABLE
    ora.diskmon
          1        OFFLINE OFFLINE                               STABLE
    ora.evmd
          1        ONLINE  ONLINE       oralab01                 STABLE
    --------------------------------------------------------------------------------

What's next ...

- Configure Oracle ASM (see here)
- Install Oracle 11g/12c rdbms (see here)

Please leave comments and suggestions,
Michel.

Reference
Grid Infrastructure Installation Guide (oracle.com)

Enjoyed this article? Please like it or share it.

Add comment

Please connect with one of social login below (or fill up name and email)

     


Security code
Refresh

Comments   

Esmeralda
# Silent install of Oracle Grid Infrastructure 12cEsmeralda 2016-11-23 20:01
Hello, I enjoy reading through your article post. I like
to write a little comment to support you.
Reply | Reply with quote | Quote