CentOS7 安装Oracle 19c r2
这里直接放上可复制内容,在最后有图片,便于阅读,有颜色标注
Oracle 19c r2安装
| |||
root权限
|
事务
|
命令
|
影响或注意
|
修改主机和ip
|
echo “*.*.*.* name” >> /etc/hosts
|
| |
新建用户和组
|
/usr/sbin/groupadd -g 65431 oinstall
/usr/sbin/groupadd -g 65432 dba
/usr/sbin/groupadd -g 65433 oper
useradd -u 61001 -g oinstall -G dba,oper -m oracle
passwd oracle
|
| |
创建文件夹授予权限
|
mkdir -p /u01/app/oracle/product/19.0.0/dbhome_1
mkdir -p /u02/oradata
chown -R oracle:oinstall /u01 /u02
chmod -R 775 /u01 /u02
|
| |
创建脚本
|
mkdir /home/oracle/scripts
cat > /home/oracle/scripts/start_all.sh <<EOF
#!/bin/bash
. /home/oracle/scripts/setEnv.sh
export ORAENV_ASK=NO
. oraenv
export ORAENV_ASK=YES
dbstart \$ORACLE_HOME
EOF
cat > /home/oracle/scripts/stop_all.sh <<EOF
#!/bin/bash
. /home/oracle/scripts/setEnv.sh
export ORAENV_ASK=NO
. oraenv
export ORAENV_ASK=YES
dbshut \$ORACLE_HOME
EOF
chown -R oracle:oinstall /home/oracle/scripts
chmod u+x /home/oracle/scripts/*.sh
|
| |
rpm包 |
yum -y install autoconf
yum -y install automake
yum -y install binutils
yum -y install binutils-devel
yum -y install bison
yum -y install cpp
yum -y install dos2unix
yum -y install ftp
yum -y install gcc
yum -y install gcc-c++
yum -y install lrzsz
yum -y install python-devel
yum -y install compat-libcap1
yum -y install compat-libstdc++-33
yum -y install compat-libstdc++-33.i686
yum -y install glibc-*
yum -y install glibc-*.i686
yum -y install libXpm-*.i686
yum -y install libXext
yum -y install libXext.i686
yum -y install libXtst
yum -y install libXtst.i686
yum -y install libX11
yum -y install libX11.i686
yum -y install libXau
yum -y install libXau.i686
yum -y install libxcb
yum -y install libxcb.i686
yum -y install libXi
yum -y install libXi.i686
yum -y install libstdc++.i686
yum -y install libstdc++-devel
yum -y install libstdc++-devel.i686
yum -y install libaio
yum -y install libaio.i686
yum -y install libaio-devel
yum -y install libaio-devel.i686
yum -y install ksh
yum -y install libXp
yum -y install libaio-devel
yum -y install numactl
yum -y install numactl-devel
yum -y install make -y
yum -y install sysstat -y
yum -y install unixODBC
yum -y install unixODBC-devel
yum -y install elfutils-libelf-devel
yum -y install redhat-lsb-core
yum -y install unzip
yum install -y libXrender
yum install -y libXrender-devel
yum install -y nfs-utils
yum install -y smartmontools
|
| |
资源限制
|
vim /etc/security/limits.conf
|
屏蔽内容
#* soft nofile 65535
#* hard nofile 65535
添加内容
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 16384
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
#oracle hard memlock 8192000 (Memory larger than 8GB)
#oracle soft memlock 8192000 (Memory larger than 8GB)
| |
shell限制
|
echo "session required pam_limits.so" >> /etc/pam.d/login
|
| |
内核参数(可能因为参数大小会出现问题)
(后面内容为32G内存推荐值)
生效
|
vim /etc/sysctl.conf
sysctl -p
|
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmni = 4096
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 = 1048586
kernel.panic_on_oops = 1
kernel.shmmax=21474836480
kernel.sem=610 86620 100 142
kernel.shmall=8388608
| |
防火墙关闭
|
systemctl status firewalld.service
systemctl stop firewalld.service
systemctl disable firewalld.service
|
| |
oracle用户
|
切换oracle用户
| su - oracle |
|
修改oracle用户环境变量
|
cat > /home/oracle/scripts/setEnv.sh <<EOF
# Oracle Settings
export TMP=/tmp
export TMPDIR=\$TMP
export ORACLE_HOSTNAME=enhe-svr-202
export ORACLE_UNQNAME=std
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=\$ORACLE_BASE/product/19.0.0/dbhome_1
export ORA_INVENTORY=/u01/app/oraInventory
export ORACLE_SID=std
export PDB_NAME=pdb
export DATA_DIR=/u02/oradata
export PATH=/usr/sbin:/usr/local/bin:\$PATH
export PATH=\$ORACLE_HOME/bin:\$PATH
export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib
EOF
echo ". /home/oracle/scripts/setEnv.sh" >> /home/oracle/.bash_profile
|
| |
解压压缩包
|
# Unzip software.
cd $ORACLE_HOME
unzip -oq /path/to/software/LINUX.X64_193000_db_home.zip
|
| |
远程图形 |
进入oracle安装目录
export DISPLAY=本机ip:0.0
./runInstaller
|
| |
进入root用户执行
|
/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/product/19.0.0/dbhome_1/root.sh
|
| |
安装完成后创建监听
启动监听
|
netca
lsnrctl start
|
| |
开放1521端口
|
Linux开放防火墙端口
|
| |
如果没有iptables
|
yum install iptables-services
|
| |
开启iptables
|
systemctl enable iptables
systemctl start iptables
|
| |
创建数据库实例,按照系统默认即可
|
dbca
|
| |
|
其他操作
|
|
Linux开放防火墙端口
| |
事务
|
命令
|
文件夹位置
|
/etc/sysconfig/iptables
|
修改防火墙文件
|
vim iptables
|
添加端口号
|
-A INPUT -p tcp -m state --state NEW -m tcp --dport 8082 -j ACCEPT
|
重启防火墙
|
systemctl restart iptables.service
或者
service iptables restart
|
查看端口使用情况
|
/sbin/iptables -L -n
|
CentOs远程桌面
| ||
事务
|
命令
|
影响或注意
|
安装tigervnc
|
yum install tigervnc-server tigervnc
|
|
开启vncserver监听端口
|
vncserver :3
|
使用端口为5903
|
给用户添加连接远程桌面密码
|
vncpasswd [用户]
|
密码
|
开启远程桌面
|
vncviewer
|
需要下载xManage
|
博客地址:
|
|