一、安装环境介绍
操作系统: CentOS6.9-x86_64# lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.9 (Final)
Release: 6.9
Codename: Final
# uname -a
Linux orcl.server.what21.com 2.6.32-696.el6.x86_64 #1 SMP Tue Mar 21 19:29:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
# cat /proc/version
Linux version 2.6.32-696.el6.x86_64 (mockbuild@c1bm.rdu2.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC) ) #1 SMP Tue Mar 21 19:29:05 UTC 2017
# cat /etc/issue
CentOS release 6.9 (Final)
Kernel \r on an \m
参考文档:
https://www.what21.com/sys/view/oracle_oracle-summary_1456896318215.html
二、安装依赖包
安装:yum -y install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers glibc-static kernel-headers pdksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel libstdc++-static make numactl-devel sysstat unixODBC unixODBC-devel
补充:yum install libaio.i686
yum install libgcc.i686
yum install libstdc++.i686
yum install unixODBC.i686
yum install unixODBC-devel.i686
yum install glibc.i686
rpm -ivh pdksh-5.2.14-37.el5_8.1.i386.rpm
rpm -ivh pdksh-5.2.14-37.el5.x86_64.rpm
三、安装环境配置
1、创建用户和组(root用户)# groupadd -g 251 oinstall
# groupadd -g 252 dba
# useradd -u 256 -g oinstall -G dba -d /opt/oracle -s /bin/bash -m oracle
# passwd oracle
2、修改内核参数(root用户)
vi /etc/sysctl.conf,文件末尾添加fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
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=1048586
使生效: /sbin/sysctl -p
3、修改系统资源限制(root用户)
vi /etc/security/limits.conf,末尾添加oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
vi /etc/pam.d/login,添加内容session required pam_namespace.so
在此行下面添加一条pam_limits.so
session required pam_limits.so
vi /etc/profile,末尾添加ulimit -u 16384 -n 65536
四、创建安装目录及设置权限root用户登录设置
# mkdir -p /opt/oracle/app/
# mkdir -p /opt/oracle/oradata/
# chmod 755 /opt/oracle/
# chmod 775 /opt/oracle/app/
# chown oracle.oinstall -R /opt/oracle/
五、设置oracle环境变量
oracle用户登录设置vi ~/.bash_profile
export ORACLE_BASE=/opt/oracle/app
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=orcl
立即生效: source .bash_profile
六、 进入图形化界面安装
安装文件:linux.x64_11gR2_database_1of2.zip、linux.x64_11gR2_database_2of2.zip
Oracle用户登录:$ unzip linux.x64_11gR2_database_1of2.zip
$ unzip linux.x64_11gR2_database_2of2.zip
参考文档:http://www.what21.com/sys/view/oracle_1_1496048536542.html