oracle 单实例安装
[具体参考1](https://www.linuxidc.com/Linux/2017-08/146528.htm)
[具体参考2](https://www.cnblogs.com/kingle-study/p/10402130.html)
1.官网下载对应的安装包,并root身份安装依赖包:
yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*.i686 elfutils-libelf-devel gcc gcc-c++ glibc*.i686 glibc glibc-devel glibc-devel*.i686 ksh libgcc*.i686 libgcc libstdc++ libstdc++*.i686 libstdc++-devel libstdc++-devel*.i686 libaio libaio*.i686 libaio-devel libaio-devel*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686 libXp
2. 建立用户和组:
groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba,oper oracle
echo "123456" | passwd --stdin oracle
3.创建安装目录:
mkdir -p /orcl/app/oracle/product/12.1.0/db_1
chown -R oracle:oinstall /orcl/app
chmod -R 775 /orcl/app
4.修改内核参数vi /etc/sysctl.conf,添加:
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1200000000
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 = 1048576
改好后,使之生效
sysctl -p
另外 上面的kernel.shmmax = 1200000000可能会有问题,后面咱们再说。
或者你直接现在就写成4098955264
5.改文件限制: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
注意:修改此文件是即时生效的,但可能要重登录后再看
6.以及vi /etc/pam.d/login,添加:
session required pam_limits.so
7.修改ulimit:vi /etc/profile,添加:
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536a
else
ulimit -u 16384 -n 65536
fi
fi
8.修改环境变量。vi ~oracle/.bash_profile,添加:
ORACLE_BASE=/orcl/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1
ORACLE_SID=orcl
export ORACLE_BASE ORACLE_HOME ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH
export PATH
9.用yum remove *openjdk* 把系统自带的openjdk卸载
10.重启系统后以oracle用户登录(切勿使用su oracle切换),开始安装:
export LANG="en_US"
./runInstaller
注:下载好的Oracle要放到/orcl/app/oracle目录下,/orcl/app/oracle/下是2个目录:product和database。解压后的安装文件放在database下。然后就会出现安装界面,配置过程从略。需要注意的是字符集要选择unicode。如下