1.检查主机名和网络并且配置/etc/hosts文件

关闭防火墙

#检查防火墙状态
[root@bogon app]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2022-10-18 10:35:47 CST; 2h 57min ago
Docs: man:firewalld(1)
Main PID: 5302 (firewalld)
CGroup: /system.slice/firewalld.service
└─5302 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

Oct 18 10:35:46 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
Oct 18 10:35:47 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.

Oracle 19C静默安装详解_oracle

#暂时关闭防火墙,下次启动时防火墙仍随系统启动而启动
[root@bogon app]# systemctl stop firewalld.service
#彻底永久关闭防火墙
[root@bogon app]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
#再次查看防火墙状态,已关闭
[root@bogon app]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)

Oct 18 10:35:46 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
Oct 18 10:35:47 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
Oct 18 13:34:31 bogon systemd[1]: Stopping firewalld - dynamic firewall daemon...
Oct 18 13:34:32 bogon systemd[1]: Stopped firewalld - dynamic firewall daemon.

Oracle 19C静默安装详解_vim_02

修改主机名

[root@bogon app]# vim /etc/hosts
10.0.1.143 ismdb

Oracle 19C静默安装详解_oracle_03

关闭SELINUX防火墙,将SELINUX=enforcing改为SELINUX=disabled

[root@bogon app]# vim /etc/selinux/config
***
SELINUX=disabled
***

Oracle 19C静默安装详解_vim_04

2.安装ORACLE先决条件的软件包

yum install -y bc
yum install -y compat-libcap1*
yum install -y compat-libcap*
yum install -y binutils
yum install -y compat-libstdc++-33
yum install -y elfutils-libelf
yum install -y elfutils-libelf-devel
yum install -y gcc
yum install -y gcc-c++
yum install -y glibc-2.5
yum install -y glibc-common
yum install -y glibc-devel
yum install -y glibc-headers
yum install -y ksh libaio
yum install -y libaio-devel
yum install -y libgcc
yum install -y libstdc++
yum install -y libstdc++-devel
yum install -y make
yum install -y sysstat
yum install -y unixODBC
yum install -y unixODBC-devel
yum install -y binutils*
yum install -y compat-libstdc*
yum install -y elfutils-libelf*
yum install -y gcc*
yum install -y glibc*
yum install -y ksh*
yum install -y libaio*
yum install -y libgcc*
yum install -y libstdc*
yum install -y make*
yum install -y sysstat*
yum install -y libXp*
yum install -y glibc-kernheaders
yum install -y net-tools-*

3.修改LINUX的内核文件

[root@bogon app]# vim  /etc/sysctl.conf
kernel.shmmax = 277495689510912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
fs.file-max = 6815744
kernel.shmall = 67747971072
net.ipv4.tcp_max_tw_buckets = 6000
net.ipv4.ip_local_port_range = 9000 65500
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_tw_reuse = 1
net.core.somaxconn = 262144
net.core.netdev_max_backlog = 262144
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_keepalive_time = 30
net.ipv4.tcp_keepalive_probes = 6
net.ipv4.tcp_keepalive_intvl = 5
net.ipv4.tcp_timestamps = 0
fs.aio-max-nr = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2

Oracle 19C静默安装详解_vim_05

生成系统参数

[root@bogon app]# sysctl -p 
kernel.shmmax = 277495689510912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
fs.file-max = 6815744
kernel.shmall = 67747971072
net.ipv4.tcp_max_tw_buckets = 6000
net.ipv4.ip_local_port_range = 9000 65500
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_tw_reuse = 1
sysctl: setting key "net.core.somaxconn": Invalid argument
net.core.somaxconn = 262144
net.core.netdev_max_backlog = 262144
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_keepalive_time = 30
net.ipv4.tcp_keepalive_probes = 6
net.ipv4.tcp_keepalive_intvl = 5
net.ipv4.tcp_timestamps = 0
fs.aio-max-nr = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2

Oracle 19C静默安装详解_vim_06

4.添加下列参数到/etc/security/limits.conf

vim /etc/security/limits.conf
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 134217728
oracle soft memlock 134217728

Oracle 19C静默安装详解_oracle_07

5.添加下列条目到/etc/pam.d/login

vim /etc/pam.d/login
session required /lib/security/pam_limits.so
session required pam_limits.so

Oracle 19C静默安装详解_vim_08

6.环境变量中添加下列语句

vim /etc/profile

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

Oracle 19C静默安装详解_oracle_09

使环境变量生效

[root@bogon app]# source /etc/profile

7.创建文件目录和相应的用户

创建用户及组


groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba,oper oracle

Oracle 19C静默安装详解_linux_10

设置密码

passwd oracle

Oracle 19C静默安装详解_oracle_11

创建文件目录

mkdir -p /app/oracle/product/19c/db_1
mkdir -p /app/oraInventory
chown -R oracle.oinstall /app
chmod -R 775 /app/oracle

8.配置ORACLE用户的环境变量

su - oracle
vim .bash_profile

export EDITOR=vi
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_SID=orcl
export ORACLE_BASE=/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19c/db_1
export INVENTORY_LOCATION=/app/oraInventory
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export NLS_LANG="AMERICAN_AMERICA.ZHS16GBK"
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
export PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin:$PATH:$HOME/bin
umask 022

Oracle 19C静默安装详解_vim_12

使环境变量生效

source .bash_profile

9.将Oracle19C安装包与静默安装配置文件【db_install.rsp、dbca.rsp、netca.rsp】上传至服务器中进行解压安装

Oracle 19C静默安装详解_vim_13

10.静态安装数据库

./runInstaller  -silent  -force -noconfig  -ignorePrereq  -responseFile /app/rsp/db_install.rsp
Launching Oracle Database Setup Wizard...

[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-10-18_08-07-09PM.log
ACTION: Identify the list of failed prerequisite checks from the log: installActions2022-10-18_08-07-09PM.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:
/app/oracle/product/19c/db_1/install/response/db_2022-10-18_08-07-09PM.rsp

You can find the log of this install session at:
/tmp/InstallActions2022-10-18_08-07-09PM/installActions2022-10-18_08-07-09PM.log

As a root user, execute the following script(s):
1. /app/oraInventory/orainstRoot.sh
2. /app/oracle/product/19c/db_1/root.sh

Execute /app/oraInventory/orainstRoot.sh on the following nodes:
[ismdb]
Execute /app/oracle/product/19c/db_1/root.sh on the following nodes:
[ismdb]


Successfully Setup Software with warning(s).
Moved the install session logs to:
/app/oraInventory/logs/InstallActions2022-10-18_08-07-09PM

Oracle 19C静默安装详解_linux_14

当提示如下内容时,需使用root用户执行

As a root user, execute the following script(s):

1. /u01/oraInventory/orainstRoot.sh

2. /u01/app/oracle/product/19c/db_1/root.sh

Oracle 19C静默安装详解_linux_15

Oracle 19C静默安装详解_linux_16

11.静默配置监听

netca -silent -responsefile /app/rsp/netca.rsp

出现如下内容代表完成

Parsing command line arguments:
Parameter "silent" = true
Parameter "responsefile" = /app/rsp/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
Running Listener Control:
/app/oracle/product/19c/db_1/bin/lsnrctl start LISTENER
Listener Control complete.
Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0

Oracle 19C静默安装详解_vim_17

查看监听

lsnrctl status

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 18-OCT-2022 20:28:33

Copyright (c) 1991, 2019, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ismdb)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 18-OCT-2022 20:27:23
Uptime 0 days 0 hr. 1 min. 10 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /app/oracle/product/19c/db_1/network/admin/listener.ora
Listener Log File /app/oracle/diag/tnslsnr/ismdb/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ismdb)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully

Oracle 19C静默安装详解_linux_18

12.静默建库

dbca -silent -createDatabase -responseFile /app/rsp/dbca.rsp

[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
CAUSE:
a. 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].
b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
CAUSE:
a. 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].
b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
Prepare for db operation
10% complete
Copying database files
40% complete
Creating and starting Oracle instance
42% complete
46% complete
50% complete
54% complete
58% complete
60% complete
Completing Database Creation
66% complete
69% complete
70% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
/app/oracle/cfgtoollogs/dbca/orcl.
Database Information:
Global Database Name:orcl
System Identifier(SID):orcl
Look at the log file "/app/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.

Oracle 19C静默安装详解_vim_19

安装完成,测试登录

[oracle@ismdb /]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Oct 18 21:47:10 2022
Version 19.3.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL>

Oracle 19C静默安装详解_vim_20