Oracle 19c Grid Installation

  • Oracle Installation Prerequisites
  • Adding users and groups
  • Create directories
  • ASM Configuration
  • Create ASM Diskgroup

Hostfile entry

[[email protected] ~]# hostname
orcldbwr
[[email protected] ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.0.0.12      orcldbwr          orcldbwr

Oracle Installation Prerequisites

yum install -y oracle-database-preinstall-19c

[[email protected] ~]# yum install -y oracle-database-preinstall-19c
Loaded plugins: langpacks, ulninfo
ol7_UEKR5 | 2.8 kB 00:00:00
ol7_addons | 2.8 kB 00:00:00

ASM Rpm packages installation

[[email protected] ~]# yum install oracleasm-support -y
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
–> Running transaction check
—> Package oracleasm-support.x86_64 0:2.1.11-2.el7 will be installed
–> Finished Dependency Resolution

[[email protected] ~]# yum install kmod-oracleasm -y
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
–> Running transaction check
—> Package kmod-oracleasm.x86_64 0:2.0.8-26.0.1.el7 will be installed
–> Finished Dependency Resolution

Adding users and groups

[[email protected] ~]# groupadd -g 54327 asmdba
[[email protected] ~]# groupadd -g 54328 asmoper
[[email protected] ~]# groupadd -g 54329 asmadmin

[[email protected] ~]# usermod -a -G dba,oper,asmdba,asmoper,asmadmin oracle

[[email protected] ~]# passwd oracle
Changing password for user oracle.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

Create the directories for Grid and Oracle software will be installed.

[[email protected] ~]# mkdir -p /u01/app/oracle/product/19c/dbhome_1
[[email protected] ~]# chown -R oracle:oinstall /u01
[[email protected] ~]# chmod -R 775 /u01
[[email protected] ~]# mkdir -p /u01/app/oracle/19c/grid
[[email protected] ~]# vi /etc/oratab

Download Oracle Grid and Database Software

[[email protected] ~]# wget –[email protected] –ask-password “https://edelivery.oracle.com/osdc/softwareDownload?fileName=V840012-01.zip&token=<get-link-from-edelivery-site>” -O oracle19c_grid_home.zip

[[email protected] ~]# wget –[email protected] –ask-password “https://edelivery.oracle.com/osdc/softwareDownload?fileName=V839960-01.zip&token=<get-link-from-edelivery-site>” -O oracle19c_database_home.zip

[[email protected] ~]# ls -lrt
total 5809468
-rw-r–r–. 1 root root 3059705302 Apr 23 2019 oracle19c_database_home.zip
-rw-r–r–. 1 root root 2889184573 Apr 23 2019 oracle19c_grid_home.zip

[[email protected] ~]# chown -R oracle:oinstall oracle19c_database_home.zip oracle19c_grid_home.zip
[[email protected] ~]# chmod 775 oracle19c_database_home.zip oracle19c_grid_home.zip
[[email protected] ~]# mv oracle19c_database_home.zip oracle19c_grid_home.zip /home/oracle/

Increase Swap space if needed

[[email protected] ~]# dd if=/dev/zero of=/root/myswapfile1 bs=1024 count=6291456
6291456+0 records in
6291456+0 records out
6442450944 bytes (6.4 GB) copied, 48.604 s, 133 MB/s
[[email protected] ~]# ls -l /root/myswapfile1
-rw-r–r–. 1 root root 6442450944 Nov 10 14:07 /root/myswapfile1
[[email protected] ~]# chmod 600 /root/myswapfile1
[[email protected] ~]# mkswap /root/myswapfile1
Setting up swapspace version 1, size = 6291452 KiB
no label, UUID=b38d2618-942f-4ccb-bc13-3421ce7a41d6

Login to oracle user and add in the .bash_profile file

[[email protected] ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
# Oracle Settings
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/u01/app/oracle
export GRID_HOME=/u01/app/oracle/19c/grid
export DB_HOME=$ORACLE_BASE/product/19c/dbhome_1
export ORACLE_HOME=$DB_HOME
export ORACLE_SID=oradbwr
export ORACLE_TERM=xterm
export BASE_PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
alias grid=’. /home/oracle/grid’
alias db=’. /home/oracle/db’

[[email protected] ~]$ vi .grid.env
[[email protected] ~]$ cat .grid.env
export ORACLE_SID=+ASM1
export ORACLE_HOME=$GRID_HOME
export PATH=$ORACLE_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

[[email protected] ~]$ vi .db.env
[[email protected] ~]$ cat .db.env

export ORACLE_SID=oradbwr
export ORACLE_HOME=$DB_HOME
export PATH=$ORACLE_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

Double check bash profile properly working

[[email protected] ~]$ . .bash_profile
[[email protected] ~]$ . .db.env
[[email protected] ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/19c/dbhome_1
[[email protected] ~]$ . .grid.env
[[email protected] ~]$ echo $ORACLE_HOME
/u01/app/oracle/19c/grid

Unzip the grid software and install the rpm as like below

[[email protected] ~]$ mv oracle19c_grid_home.zip /u01/app/oracle/19c/grid/
[[email protected] ~]$ cd /u01/app/oracle/19c/grid/
[[email protected] grid]$ ls -lrt
total 2821472
-rwxrwxr-x. 1 oracle oinstall 2889184573 Apr 23 2019 oracle19c_grid_home.zip
[[email protected] grid]$ unzip oracle19c_grid_home.zip
Archive: oracle19c_grid_home.zip
creating: instantclient/
inflating: instantclient/libsqlplusic.so
creating: opmn/
creating: opmn/logs/

Login into root user

[[email protected] ~]# rpm -ivh /u01/app/oracle/19c/grid/cv/rpm/cvuqdisk-1.0.10-1.rpm
Preparing… ################################# [100%]
Using default group oinstall to install package
Updating / installing…
1:cvuqdisk-1.0.10-1 ################################# [100%]

ASM Configuration 

[[email protected] ~]# oracleasm configure -i
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets (‘[]’). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []: oracle
Default group to own the driver interface []: oinstall
Default user to own the driver interface []: y
Default group to own the driver interface []:
Start Oracle ASM library driver on boot (y/n) [n]:
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done

[[email protected] ~]# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module “oracleasm”: oracleasm
Configuring “oracleasm” to use device physical block size
Mounting ASMlib driver filesystem: /dev/oracleasm

[[email protected] ~]# oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes

Create ASM Diskgroup

[[email protected] ~]# oracleasm createdisk DATA /dev/sdb1
Writing disk header: done
Instantiating disk: done

[[email protected] ~]# oracleasm listdisks
DATA

[[email protected] ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks…
Scanning system for ASM disks…

[[email protected] ~]# oracleasm configure
ORACLEASM_ENABLED=true
ORACLEASM_UID=oracle
ORACLEASM_GID=oinstall
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER=””
ORACLEASM_SCANEXCLUDE=””