1.安装前准备
1.1关闭防火墙和selinux
systemctl stop firewalld
systemctl disable firewalld
vi /etc/selinux/config
1.2 安装依赖
yum install -y unzip compat-libcap1 compat-libstdc++-33 gcc-c++ ksh libaio-devel libstdc++-devel elfutils-libelf-devel fontconfig-devel libXrender-devel rlwrap
1.3创建用户和组
groupadd oinstall
groupadd dba
groupadd asmdba
groupadd backupdba
groupadd dgdba
groupadd kmdba
groupadd racdba
groupadd oper
useradd -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper -m oracle
1.4 修改内核参数
vi /etc/sysctl.conf
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.all.secure_redirects = 0
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.tcp_keepalive_time = 150
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_keepalive_intvl = 6
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 16451328
kernel.shmmax = 33692319744
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 = 1048576sysctl -p
vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
oracle soft memlock 262144000
oracle hard memlock 262144000
2.安装oracle19c数据库
2.1创建安装目录上传并解压安装包
mkdir -p /data/u01/app/oracle/product/19c/dbhome_1
mkdir -p /data/u01/app/oraInventory
chown -R oracle:oinstall /data/u01
上传安装包到/data并解压
unzip LINUX.X64_193000_db_home.zip -d /data/u01/app/oracle/product/19c/dbhome_1/
chown -R oracle:oinstall /data/u01/
2.2 设置环境变量
vi /home/oracle/.bash_profilesource /home/oracle/.bash_profile
2.3 安装Oracle数据库
sed -i 's/^#.*$//g' /data/u01/app/oracle/product/19c/dbhome_1/install/response/db_install.rsp
sed -i '/^$/d' /data/u01/app/oracle/product/19c/dbhome_1/install/response/db_install.rsp
vi /data/u01/app/oracle/product/19c/dbhome_1/install/response/db_install.rsp
su – oracle
/data/u01/app/oracle/product/19c/dbhome_1/runInstaller -silent -responseFile
/data/u01/app/oracle/product/19c/dbhome_1/install/response/db_install.rsp
2.4 创建监听
netca /silent /responseFile /data/u01/app/oracle/product/19c/dbhome_1/assistants/netca/netca.rsp
lsnrctl status
2.5 创建数据库
sed -i 's/^#.*$//g' /data/u01/app/oracle/product/19c/dbhome_1/assistants/dbca/dbca.rsp
sed -i '/^$/d' /data/u01/app/oracle/product/19c/dbhome_1/assistants/dbca/dbca.rsp
vi /data/u01/app/oracle/product/19c/dbhome_1/assistants/dbca/dbca.rsp
dbca -silent -createDatabase -responseFile /data/u01/app/oracle/product/19c/dbhome_1/assistants/dbca/dbca.rsp