环境介绍
操作系统:centos7.9
使用yum:公网yum源
内核版本:3.10.0-1160.el7.x86_64
运行内存:4G
swap交换内存:8G
ssh软件:
![]()
软件包:LINUX.X64_193000_db_home.zip
下载链接:
前置配置
安装所需系统环境
yum -y install deltarpm python-deltarpm bc compat-libcap1* compat-libcap* binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc-2.5 glibc-common glibc-devel glibc-headers ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel binutils* compat-libstdc* elfutils-libelf* gcc* glibc* ksh* libaio* libgcc* libstdc* make* sysstat* libXp* glibc-kernheaders net-tools-*
如果没有图形化则安装,有则跳过这一步
yum -y groupinstall gnome-desktop
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
reboot
#重启后就有图形化
关闭防火墙和seLinux
systemctl stop firewalld
setenforce 0
修改Linux内核
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.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
sysctl -p
限制占用
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
修改信息
vim /etc/pam.d/login 插入 session required /lib/security/pam_limits.so session required pam_limits.so
修改环境变量
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
source /etc/profile
创建用户和组以及目录
groupadd oinstall groupadd dba groupadd oper useradd -g oinstall -G dba,oper oracle mkdir -p /u01/app/oracle 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 chown -R oracle:oinstall /u01/app/oracle/product/
passwd oracle
设置oracle变量
su - oracle
vim .bash_profile 插入 export EDITOR=vi export TMP=/tmp export TMPDIR=$TMP export ORACLE_SID=orcl export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/19c/db_1 export INVENTORY_LOCATION=/u01/oraInventory export TNS_ADMIN=$ORACLE_HOME/network/admin export LD_LIBRARY_PATH=$ORACLE_HOME/lib export NLS_LANG="AMERICAN_AMERICA.AL32UTF8" 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
source .bash_profile
补一个文件
cp /root/.Xauthority /home/oracle/.Xauthority
开始安装
cd /u01/app/oracle/product/19c/db_1
在/u01/app/oracle/product/19c/db_1放入LINUX.X64_193000_db_home.zip包
unzip LINUX.X64_193000_db_home.zip
export DISPLAY=192.168.6.254:0.0
你真机连接你虚拟机网卡的ip
./runInstaller
如果报错了就 export DISPLAY=localhost:10.0 再 ./runInstaller
复制这两句话到Linux中以root执行
监听配置
netca
一直下一步
又回到这里之后点击完成
lsnrctl status
查看状态
开启成功
sqlplus / as sysdba
进入数据库
创建数据库
dbca
创建数据库
搭建成功