Install Oracle18c under Linux

Install Oracle18c under Linux

  • confirm hostname
[root@test /]# hostnamectl status

– modify hostname

[root@test /]# hostnamectl status
   Static hostname: test.xyb.com

-Edit host file information

[root@test /]# vi /etc/hosts

– turn off the firewall

//stop firewall
[root@test /]# systemctl stop firewalld.service
//Prohibit firewall from booting
[root@test /]# systemctl disable firewalld.service

– turn off SELinux

# sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

– RPM packages required to install common tools

# yum -y install vim telnet net-tools wget psmisc tree unzip
# yum install bc binutils compat-libcap compat-libstdc glibc glibc-devel ksh libaio libaio-devel libX11 libXau libXi libXtst libgcc libstdc + + libstdc + + -devel libxcb make smartmontools sysstat
# rpm -ivh /install/compat-libstdc++ -33-3.2.3-72.el7.x86_64.rpm

-Create Oracle required user groups & users

# groupadd oinstall
#groupadd dba
# useradd -g oinstall -G dba -m oracle
# passwd oracle

-Modify Linux kernel parameters

# vim /etc/sysctl.conf
//The following is the parameter configuration, among which kernel.shmall and kernel.shmmax can be queried and changed by themselves
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 3774873
kernel.shmmax = 15461882265
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=262144
net.core.rmem_max = 4194304
net.core.wmem_default=262144
net.core.wmem_max = 1048586

– Modify Linux resource limits

# vim /etc/security/limits.conf
//The following is the parameter configuration
-------------------------------------------------- --
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle soft memlock 3145728
oracle hard memlock 3145728
-------------------------------------------------- --

– Disable Transparent HugePages

# vim /etc/default/grub
//Just modify GRUB_CMDLINE_LINUX
-------------------------------------------------- ------------------------------------
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet transparent_hugepage=never"
GRUB_DISABLE_RECOVERY="true"
-------------------------------------------------- ------------------------------------

-Generate a new gurb.cfg file and restart to make the file take effect

# grub2-mkconfig -o /boot/grub2/grub.cfg

– Modify the oracle user bash_profile configuration (Oracle user)

# vim /home/oracle/.bash_profile
//The following is the configuration information
-------------------------------------------------- ------------------------------------
umask 022
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/18.3/dbhome_1
export ORACLE_SID=orcl
export LANG=en_US.UTF-8
export NLS_LANG=American_America.AL32UTF8
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/.local/bin:$HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/lib64
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
-------------------------------------------------- ------------------------------------

– Extract the Oracle installation media

# mkdir -p /u01/app/oracle/product/18.3/dbhome_1
# unzip /install/LINUX.X64_180000_db_home.zip -d /u01/app/oracle/product/18.3/dbhome_1
# chmod -R 755 /u01
# chown -R oracle:oinstall /u01

– Configure the Oracle installation response file

Configure one by one according to the following parameters, other parameters can not be configured first
oracle.install.option=INSTALL_DB_AND_CONFIG

UNIX_GROUP_NAME=oinstall

INVENTORY_LOCATION=/u01/app/oraInventory

ORACLE_BASE=/u01/app/oracle

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

oracle.install.db.config.starterdb.type=GENERAL_PURPOSE

oracle.install.db.config.starterdb.globalDBName=orcl

oracle.install.db.config.starterdb.SID=orcl

oracle.install.db.ConfigureAsContainerDB=true

oracle.install.db.config.PDBName=orclpdb

oracle.install.db.config.starterdb.characterSet=AL32UTF8

oracle.install.db.config.starterdb.memoryOption=false

oracle.install.db.config.starterdb.memoryLimit=6354

oracle.install.db.config.starterdb.installExampleSchemas=false

oracle.install.db.config.starterdb.managementOption=DEFAULT

oracle.install.db.config.starterdb.enableRecovery=false

oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE

oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/u01/app/oracle/oradata

-Execute the Oracle installation response file (Oracle users)

# cd /u01/app/oracle/product/18.3/dbhome_1
# ./runInstaller -force -silent -responseFile /u01/app/oracle/product/18.3/dbhome_1/install/response/db_install.rsp
//The following is the execution result

Launching Oracle Database Setup Wizard...

[WARNING] [INS-30011] The ADMIN password entered does not conform to the Oracle recommended standards.
   CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
   ACTION: Provide a password that conforms to the Oracle recommended standards.
[WARNING] [INS-13014] Target environment does not meet some optional requirements.
   CAUSE: Some of the optional prerequisites are not met. See logs for details. installActions2022-07-22_03-32-49PM.log
   ACTION: Identify the list of failed prerequisite checks from the log: installActions2022-07-22_03-32-49PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
The response file for this session can be found at:
 /u01/app/oracle/product/18.3/dbhome_1/install/response/db_2022-07-22_03-32-49PM.rsp

You can find the log of this install session at:
 /tmp/InstallActions2022-07-22_03-32-49PM/installActions2022-07-22_03-32-49PM.log

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

Execute /u01/app/oraInventory/orainstRoot.sh on the following nodes:
[test]
Execute /u01/app/oracle/product/18.3/dbhome_1/root.sh on the following nodes:
[test]


Successfully Setup Software with warning(s).
As install user, execute the following command to complete the configuration.
/u01/app/oracle/product/18.3/dbhome_1/runInstaller -executeConfigTools -responseFile /u01/app/oracle/product/18.3/dbhome_1/install/response/db_install_18c.rsp [-silent]


Moved the install session logs to:
 /u01/app/oraInventory/logs/InstallActions2022-07-22_03-32-49PM


-execute file (Root user)

//Execute the sh file of the previous step
# sh /u01/app/oraInventory/orainstRoot.sh
# sh /u01/app/oracle/product/18.3/dbhome_1/root.sh

– Execute db_install.rsp to complete the configuration (Oracle users)

# sh /u01/app/oracle/product/18.3/dbhome_1/runInstaller -silent -executeConfigTools -responseFile /u01/app/oracle/product/18.3/dbhome_1/install/response/db_install.rsp

– Verify database status (Oracle user)

# sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on Tue Jul 19 17:06:59 2022
Version 18.3.0.0.0

Copyright (c) 1982, 2018, Oracle. All rights reserved.

Connected to an idle instance.