在centos 6.7 Linux上安装Oracle12cR2,创建非容器数据库实例
1.检查主机名和网络并且配置/etc/hosts文件
例 以你真实情况请填写 IP地址 主机名
如
192.168.16.201 oracle
2.配置YUM源解决程序依赖的问题
a 挂载光盘镜像
b 进入到光盘镜像中的Package目录中将所有的软件包复制到我们预设的目录下
cp -R /media/CentOS_6.7_Final/Packages /yums
cd /yums
rpm -ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
rpm -ivh createrepo-0.9.9-22.el6.noarch.rpm
createrepo .
cd /etc/yum.repos.d/
mkdir old
cp C* old
vi yum.local.repo
[local]
name=yum local repo
baseurl=file:///yums
gpgcheck=0
enable=1
yum clean all
3.安装ORACLE先决条件的软件包
yum install -y bc
yum install -y compat-libcap1*
yum install -y compat-libcap*
yum install -y binutils
yum install -y compat-libstdc+±33
yum install -y elfutils-libelf
yum install -y elfutils-libelf-devel
yum install -y gcc
yum install -y gcc-c++
yum install -y glibc-2.5
yum install -y glibc-common
yum install -y glibc-devel
yum install -y glibc-headers
yum install -y ksh libaio
yum install -y libaio-devel
yum install -y libgcc
yum install -y libstdc++
yum install -y libstdc+±devel
yum install -y make
yum install -y sysstat
yum install -y unixODBC
yum install -y unixODBC-devel
yum install -y binutils*
yum install -y compat-libstdc*
yum install -y elfutils-libelf*
yum install -y gcc*
yum install -y glibc*
yum install -y ksh*
yum install -y libaio*
yum install -y libgcc*
yum install -y libstdc*
yum install -y make*
yum install -y sysstat*
yum install -y libXp*
yum install -y glibc-kernheaders
yum install -y net-tools-*
4.修改LINUX的内核文件
vi /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 = 4294967296
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.somaxconn = 262144
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 生成系统参数
5.添加下列参数到/etc/security/limits.conf
vi /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
6.添加下列条目到/etc/pam.d/login
vim /etc/pam.d/login
session required /lib64/security/pam_limits.so
session required pam_limits.so
7.环境变量中添加下列语句
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
cd /etc/yum.repos.d/
cp old/* .
yum clean all
yum -y install lrzsz
8.创建文件目录和相应的用户
groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba,oper oracle
mkdir -p /u01/app/oracle
mkdir -p /u01/app/oraInventory
chown -R oracle.oinstall /u01
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle
passwd oracle
9.配置ORACLE用户的环境变量
su - oracle
vim .bash_profile
alias cp='cp -R'
alias sqlplus='rlwrap sqlplus'
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/12.2.0/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.zhs16gbk"
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