Oracle Database 19c Installation

 

Oracle Database 19c Installation On Oracle Linux 7 (OL7)


Download Software


Hosts File

The "/etc/hosts" file must contain a fully qualified name for the server.

<IP-address> <fully-qualified-machine-name> <machine-name>

Oracle Installation Prerequisites

Perform either the Automatic Setup or the Manual Setup to complete the basic prerequisites.

Manual Setup

If you have not used the "oracle-database-preinstall-19c" package to perform all prerequisites, 

Add the following lines to the "/etc/sysctl.conf" file,

# Customised parameters
vm.pagecache=1 15 30
vm.min_free_kbytes=1024
vm.swappiness=10
#kernel.shmmax = 68719476736
#kernel.shmall = 4294967296
kernel.shmmni=4096
kernel.sem = 1820 232960 1820 128
net.core.rmem_default = 262144
net.core.wmem_default = 262144
fs.aio-max-nr = 3145728
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576

Run one of the following commands to change the current kernel parameters

/sbin/sysctl -p
# Or
/sbin/sysctl -p /etc/sysctl.d/98-oracle.conf

Add the following lines to a file called "/etc/security/limits.d/oracle-database-preinstall-19c.conf" file.

* hard nofile 65535
* soft nofile 4096
* hard nproc 16386
* soft nproc 2047

The following packages are listed as required. Many of the packages should be installed already.

yum install -y binutils-* 2.27-41.base.el7.x86_64
yum install -y compat-cheese314-3.14.2-1.el7.x86_64
yum install -y compat-db47-4.7.25-28.el7.i686
yum install -y compat-db47-4.7.25-28.el7.x86_64
yum install -y compat-db-headers-4.7.25-28.el7.noarch
yum install -y compat-exiv2-023-0.23-2.el7.x86_64
yum install -y compat-exiv2-026-0.26-1.el7.x86_64
yum install -y compat-glibc-2.12-4.el7.x86_64
yum install -y compat-glibc-headers-2.12-4.el7.x86_64
yum install -y compat-libcap1-1.10-7.el7.x86_64
yum install -y compat-libf2c-34-3.4.6-32.el7.x86_64
yum install -y compat-libgfortran-41-4.1.2-45.el7.x86_64
yum install -y compat-libical1-1.0.1-2.el7.x86_64
yum install -y compat-libstdc++-296-2.96-144.0.2.el7.i686
yum install -y compat-libstdc++-33-3.2.3-72.el7.i686
yum install -y compat-libstdc++-33-3.2.3-72.el7.x86_64
yum install -y compat-libtiff3-3.9.4-12.el7.x86_64
yum install -y compat-openldap-2.3.43-5.el7.x86_64

yum install -y gcc-* 4.8.5-39.el7.x86_64
yum install -y gcc-* c++-4.8.5-39.el7.x86_64
yum install -y gcc-* gfortran-4.8.5-39.el7.x86_64
yum install -y glibc-* 2.17-292.el7.i686
yum install -y glibc-* 2.17-292.el7.x86_64
yum install -y glibc-* common-2.17-292.el7.x86_64
yum install -y glibc-* devel-2.17-292.el7.i686
yum install -y glibc-* devel-2.17-292.el7.x86_64
yum install -y glibc-* headers-2.17-292.el7.x86_64
yum install -y libaio-* 0.3.109-13.el7.i686
yum install -y libaio-* 0.3.109-13.el7.x86_64
yum install -y libaio-devel-* 0.3.109-13.el7.x86_64
yum install -y libgcc-* 4.8.5-39.el7.i686
yum install -y libgcc-* 4.8.5-39.el7.x86_64
yum install -y libstdc++-* 4.8.5-39.el7.i686
yum install -y libstdc++-* 4.8.5-39.el7.x86_64
yum install -y libstdc++-devel-* 4.8.5-39.el7.i686
yum install -y libstdc++-devel-* 4.8.5-39.el7.x86_64
yum install -y libXp-* 1.0.2-2.1.el7.i686
yum install -y libXp-* 1.0.2-2.1.el7.x86_64
yum install -y libXpm-* 3.5.12-1.el7.x86_64
yum install -y make-* 3.82-24.el7.x86_64
yum install -y openmotif21-* 2.1.30-11.el7.i686
yum install -y polkit-pkla-compat-* 0.1-4.el7.x86_64
yum install -y rarian-compat-* 0.8.1-11.el7.x86_64
yum install -y xorg-x11-libs-compat-* 6.8.2-1.EL.33.0.1.i386
yum install -y ksh-*

IMPORTANT TO MAKE SURE FOLLOWING 32bit packegs are installed:-
yum -y install libaio-*.i686
yum -y install glibc-*.i686
yum -y install compat-*.i686
yum -y install compat-libstdc++-*.i686
yum -y install glibc-devel-*.i686
yum -y install libaio-*.i686
yum -y install libgcc-*.i686
yum -y install libstdc++-*.i686
yum -y install libXp-*.i686
yum -y install openmotif21-*.i686
yum -y install xorg-x11-libs-compat-*.i386
yum -y install libXtst.i686
yum -y install libXi-*.i686
yum -y install libXtst-*.i686
yum -y install gdbm-*.i686


IMPORTAnt:-
**yum install glibc-devel.i686

yum install -y binutils-*
yum install -y compat-*
yum install -y gcc-*
yum install -y glibc-*
yum install -y libaio-*
yum install -y libgcc-*
yum install -y libstdc++-*
yum install -y libXp-*
yum install -y libXpm-*
yum install -y make-*
yum install -y openmotif21-*
yum install -y polkit-pkla-compat-*
yum install -y rarian-compat-*
yum install -y xorg-*
yum install -y ksh-*
yum install -y libXrender-*
yum install -y motif-*
yum install -y motif-devel-*
yum install -y libXi-*
yum install -y libgomp-*
yum install -y gdbm-*
yum install -y util-linux-*
yum install -y compat-libcap1-*
yum install -y elfutils-libelf-devel-*
yum install httpd -y
# End of file
----------------------------
/etc/selinux/config
SELINUX=disabled
--------------------------------

# systemctl stop firewalld
# systemctl disable firewalld    
Set time Zone
-----------------
timedatectl set-timezone "Asia/Kolkata"                

Set the password for the "oracle" user.

passwd oracle
Set secure Linux to permissive by editing the "/etc/selinux/config" file, ensuring the SELINUX flag is set as follows.
SELINUX=permissive
Create the directories in which the Oracle software will be installed.
mkdir -p /u01/app/oracle/product/19.0.0/dbhome_1
mkdir -p /u02/oradata
chown -R oracle:oinstall /u01 /u02
chmod -R 775 /u01 /u02
unless you are working from the console, or using SSH tunnelling, login as root and issue the following command.
xhost +<machine-name>

Create a "scripts" directory.

mkdir /home/oracle/scripts
cat > /home/oracle/scripts/setEnv.sh <<EOF
# Oracle Settings
export TMP=/tmp
export TMPDIR=\$TMP

export ORACLE_HOSTNAME=ol7-19.localdomain
export ORACLE_UNQNAME=cdb1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=\$ORACLE_BASE/product/19.0.0/dbhome_1
export ORA_INVENTORY=/u01/app/oraInventory
export ORACLE_SID=cdb1
export PDB_NAME=pdb1
export DATA_DIR=/u02/oradata

export PATH=/usr/sbin:/usr/local/bin:\$PATH
export PATH=\$ORACLE_HOME/bin:\$PATH

export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib
EOF

Add a reference to the "setEnv.sh" file at the end of the "/home/oracle/.bash_profile" file.

echo ". /home/oracle/scripts/setEnv.sh" >> /home/oracle/.bash_profile


Create a "start_all.sh" and "stop_all.sh" script that can be called from a startup/shutdown service. Make sure the ownership and permissions are correct.

cat > /home/oracle/scripts/start_all.sh <<EOF
#!/bin/bash
. /home/oracle/scripts/setEnv.sh

export ORAENV_ASK=NO
. oraenv
export ORAENV_ASK=YES

dbstart \$ORACLE_HOME
EOF


cat > /home/oracle/scripts/stop_all.sh <<EOF
#!/bin/bash
. /home/oracle/scripts/setEnv.sh

export ORAENV_ASK=NO
. oraenv
export ORAENV_ASK=YES

dbshut \$ORACLE_HOME
EOF

chown -R oracle:oinstall /home/oracle/scripts
chmod u+x /home/oracle/scripts/*.sh

Once the installation is complete and you've edited the "/etc/oratab", you should be able to start/stop the database with the following scripts run from the "oracle" user.

~/scripts/start_all.sh
~/scripts/stop_all.sh

Installation

Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable.

DISPLAY=<machine-name>:0.0; export DISPLAY
# Unzip software.
cd $ORACLE_HOME
unzip -oq /path/to/software/LINUX.X64_19C_db_home.zip

# Interactive mode.
./runInstaller

# Silent mode.
./runInstaller -ignorePrereq -waitforcompletion -silent                        \
    -responseFile ${ORACLE_HOME}/install/response/db_install.rsp               \
    oracle.install.option=INSTALL_DB_SWONLY                                    \
    ORACLE_HOSTNAME=${ORACLE_HOSTNAME}                                         \
    UNIX_GROUP_NAME=oinstall                                                   \
    INVENTORY_LOCATION=${ORA_INVENTORY}                                        \
    SELECTED_LANGUAGES=en,en_GB                                                \
    ORACLE_HOME=${ORACLE_HOME}                                                 \
    ORACLE_BASE=${ORACLE_BASE}                                                 \
    oracle.install.db.InstallEdition=EE                                        \
    oracle.install.db.OSDBA_GROUP=dba                                          \
    oracle.install.db.OSBACKUPDBA_GROUP=dba                                    \
    oracle.install.db.OSDGDBA_GROUP=dba                                        \
    oracle.install.db.OSKMDBA_GROUP=dba                                        \
    oracle.install.db.OSRACDBA_GROUP=dba                                       \
    SECURITY_UPDATES_VIA_MYORACLESUPPORT=false                                 \
    DECLINE_SECURITY_UPDATES=true

un the root scripts when prompted.

As a root user, execute the following script(s):
        1. /u01/app/oraInventory/orainstRoot.sh
        2. /u01/app/oracle/product/19.0.0/dbhome_1/root.sh

Database Creation

You create a database using the Database Configuration Assistant (DBCA). The interactive mode will display GUI screens to allow user input, while the silent mode will create the database without displaying any screens, as all required options are already specified on the command line.

# Start the listener.
lsnrctl start

# Interactive mode.
dbca

# Silent mode.
dbca -silent -createDatabase                                                   \
     -templateName General_Purpose.dbc                                         \
     -gdbname ${ORACLE_SID} -sid  ${ORACLE_SID} -responseFile NO_VALUE         \
     -characterSet AL32UTF8                                                    \
     -sysPassword SysPassword1                                                 \
     -systemPassword SysPassword1                                              \
     -createAsContainerDatabase true                                           \
     -numberOfPDBs 1                                                           \
     -pdbName ${PDB_NAME}                                                      \
     -pdbAdminPassword PdbPassword1                                            \
     -databaseType MULTIPURPOSE                                                \
     -memoryMgmtType auto_sga                                                  \
     -totalMemory 2000                                                         \
     -storageType FS                                                           \
     -datafileDestination "${DATA_DIR}"                                        \
     -redoLogFileSize 50                                                       \
     -emConfiguration NONE                                                     \
     -ignorePreReqs


Post Installation

Edit the "/etc/oratab" file setting the restart flag for each instance to 'Y'.

cdb1:/u01/app/oracle/product/19.0.0/dbhome_1:Y

Enable Oracle Managed Files (OMF) and make sure the PDB starts when the instance starts.

sqlplus / as sysdba <<EOF
alter system set db_create_file_dest='${DATA_DIR}';
alter pluggable database ${PDB_NAME} save state;
exit;
EOF
                           

Comments

the invisible said…
This is a very informative blog regarding installing Oracle 19c.
the invisible said…
This is a great blog.
Anonymous said…
Very useful document waiting for Next part

Popular posts from this blog

Configure Oracle Database Vault Realms

Configure Transparent Database Encryption (TDE) in Oracle CDB

Cloning Oracle E-Business Suite 12.2.11: RMAN + Rapid Clone