centos7安装oracle12c
安装前环境配置
解压文件到/home/oracle/database/
创建用户组,root用户执行
groupadd oracle
useradd -g oracle oracle
chown -R oracle:oracle /home/oracle/database/
chmod -R 777 /home/oracle/database
修改配置文件
vi /etc/security/limits.conf
添加以下内容
# Oracle配置要求
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 10240
# Oracle配置要求
然后
vi /etc/pam.d/login
添加
csession required /lib/security/pam_limits.so
内核参数配置
vi /etc/sysctl.conf
添加以下内容
# Oracle内核要求
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
fs.file-max = 6815744
fs.aio-max-nr=1048576
# Oracle内核要求
生效
systemctl -p
二、安装依赖
复制以下内容,在联网环境下
yum install binutils -y
yum install compat-libcap1 -y
yum install compat-libstdc++-33 -y
yum install compat-libstdc++-33.i686 -y
yum install glibc -y
yum install glibc.i686 -y
yum install glibc-devel -y
yum install glibc-devel.i686 -y
yum install ksh -y
yum install libaio -y
yum install libaio.i686 -y
yum install libaio-devel -y
yum install libaio-devel.i686 -y
yum install libX11 -y
yum install libX11.i686 -y
yum install libXau -y
yum install libXau.i686 -y
yum install libXi -y
yum install libXi.i686 -y
yum install libXtst -y
yum install libXtst.i686 -y
yum install libgcc -y
yum install libgcc.i686 -y
yum install libstdc++ -y
yum install libstdc++.i686 -y
yum install libstdc++-devel -y
yum install libstdc++-devel.i686 -y
yum install libxcb -y
yum install libxcb.i686 -y
yum install make -y
yum install nfs-utils -y
yum install net-tools -y
yum install smartmontools -y
yum install sysstat -y
yum install unixODBC -y
yum install unixODBC-devel -y
三、配置环境变量
oracle用户下
cd
vi .bashrc
添加以下内容
#e for oracle
export ORACLE_BASE=/home/oracle/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1
export ORACLE_SID=orcl
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export TNS_ADMIN=/home/oracle/app/oracle/product/12.1.0/dbhome_2/network/admin
#下面一行将语言设置为英文,防中文系统导致安装程序乱码,可不添加
export LANG=en_US
#语言设置为英文
if [ $USER = "oracle" ];then
if [ $SHELL = "/bin/ksh" ];then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
四、安装
此步骤网上图片很多,自行百度,需要注意安装过程中会让你跑两个脚本,直接复制,一定要在在root用户下执行
五、安装rlwrap
该插件可在sqlplus中按上下箭头切换曾经输入过的命令,可不安装。
安装readline,root下执行
yum install readline*
下载rlwrap压缩包,解压
cd命令切换到解压后的目录下
autoreconf -ivf
./configure
make install
若安装失败,换一个版本的rlwrap安装包
然后切换到oracle用户
cd
vi .bashrc
追加以下内容
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
alias asmcmd='rlwrap asmcmd'