前言
经验证oracle 19c用静默安装,会一直报错,没有找到解决办法
报错信息如下:
换用RPM安装测试成功
安装过程
1.下载安装包
1.1 下载链接:https://www.oracle.com/database/technologies/oracle19c-linux-downloads.html
下载后上传至服务器
1.2 下载preinstall.rpm
[root@oracledb ~]# curl -o oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
2.系统环境参数设置
可以按照以下脚本内容手动执行进行参数设置,也可以直接执行脚本进行参数设置
注意:脚本执行的时候需要将编辑hosts文件中的ip换成自己的ip
[root@oracledb ~]# vim system_configure.sh
#!/bin/bash
#1.关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
#2.关闭selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce 0
#3.安装依赖
wget https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/compat-libcap1-1.10-7.el7.x86_64.rpm
wget https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
rpm -vih compat-libcap1-1.10-7.el7.x86_64.rpm compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
rm -rf compat-libcap1-1.10-7.el7.x86_64.rpm compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
dnf install -y bc binutils elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libXrender libX11 libXau libXi libXtst libgcc libnsl librdmacm libstdc++ libstdc++-devel libxcb libibverbs make policycoreutils policycoreutils-python-utils smartmontools sysstat psmisc xorg-x11-utils lsof libnsl libnsl2 vim net-tools openssl-devel glibc-compat-2.17 unixODBC unixODBC-devel libXrender-devel libXtst-devel librdmacm-devel xorg-x11-utils nfs-utils tigervnc-server
#4.修改主机名
hostnamectl set-hostname oracledb
#5.编辑hosts文件
echo "192.168.153.153 oracledb" >> /etc/hosts
#6.修改linux内核文件
echo '
kernel.shmmax = 7730941132
kernel.shmall = 1887436
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
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' >> /etc/sysctl.conf
sysctl -p
#7.修改linux限制文件
echo '
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' >> /etc/security/limits.conf
#8.修改/etc/pam.d/login文件
echo '
session required pam_limits.so' >> /etc/pam.d/login
#9.修改环境变量
echo '
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi' >> /etc/profile
source /etc/profile
[root@oracledb ~]# bash system_configure.sh
3.安装preinstall.rpm
[root@oracledb ~]# rpm -ivh --nodeps oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
[root@oracledb ~]# rpm -ivh oracle-database-ee-19c-1.0-1.x86_64.rpm
[root@oracledb ~]# vi /etc/init.d/oracledb_ORCLCDB-19c
export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
export ORACLE_VERSION=19c
export ORACLE_SID=orcl
export TEMPLATE_NAME=General_Purpose.dbc
export CHARSET=ZHS16GBK
export PDB_NAME=orcl
export LISTENER_NAME=LISTENER
export NUMBER_OF_PDBS=1
export CREATE_AS_CDB=false
[root@oracledb ~]# vi /etc/sysconfig/oracledb_ORCLCDB-19c.conf
LISTENER_PORT=13899
ORACLE_DATA_LOCATION=/oradata
[root@oracledb ~]# mkdir /archivelog
[root@oracledb ~]# chown -R oracle:oinstall /archivelog/
[root@oracledb ~]# mkdir /oradata
[root@oracledb ~]# chown -R oracle:oinstall /oradata/
[root@oracledb ~]# chmod -R 755 /oradata/
4.初始化实例
[root@oracledb ~]# /etc/init.d/oracledb_ORCLCDB-19c configure
5.测试数据库连接
5.1 修改 oracle用户环境变量
切换到oracle用户
[root@oracledb ~]# su - oracle
[oracle@oracledb ~]# vim .bash_profile
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_SID=rundb
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19c/dbhome_1
export INVENTORY_LOCATION=/opt/oracle/oraInventory
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
#export NLS_LANG="SIMPLIFIED CHINESE_CHINA.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
5.2 查看监听状态
[oracle@oracledb ~]# lsnrctl status
5.3连接数据库
[oracle@oracledb ~]# sqlplus / as sysdba
SQL> show pdbs;
SQL> select instance_name from v$instance;
SQL> select userenv('language') from dual;
SQL> select name from v$datafile;
SQL> show parameter control;