oracle19c 静默安装 centos7.5
1.基础环境配置
关闭防火墙:systemctl disable firewalld
关闭selinux:/etc/selinux/config
更改主机名:
/ect/hosts
192.168.80.148(写自己的ip) oracle19c
1.2.yum安装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-*
1.3.修改linux的内核文件
cat << EOF >> /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
EOF
sysctl -p 生效
1.4. 修改limits.conf
cat << 'EOF' >> /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
EOF
1.5.添加下列条目到/etc/pam.d/login
cat << 'EOF' >> /etc/pam.d/login
session required /lib/security/pam_limits.so
session required pam_limits.so
EOF
1.6.在/etc/profil添加下列语句
cat << 'EOF' >> /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
EOF
#使环境变量生效
source /etc/profile
2.创建文件和相应的目录
groupadd dba
groupadd oper
groupadd oinstall
useradd -g oinstall -G dba,oper oracle
mkdir -p /u01/app/oracle
mkdir -p /u01/app/oracle/oradata
mkdir -p /u01/oraInventory
chown -R oracle.oinstall /u01
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle
mkdir -p /u01/app/oracle/product/19c/db_1 #ORACLE的HOME目录
chown -R oracle:oinstall /u01/app/oracle/product/
passwd oracle #增加密码
2.1配置oracle用户环境变量
su - oracle
cat << 'EOF' >> .bash_profile
export EDITOR=vi #默认的编辑器是vi
export TMP=/tmp #ORACLE默认的临时目录是/tmp
export TMPDIR=$TMP #临时目录生成
export ORACLE_SID=orcl #ORACLE实例名称是orcl
export ORACLE_BASE=/u01/app/oracle #ORACLE的基本目录
export ORACLE_HOME=$ORACLE_BASE/product/19c/db_1 #ORACLE数据库的HOME目录
ex