Red Hat Enterprise Linux x86-64 上安装 oracle 11gR2
一.以root用户登录
二.安装依赖包
#rpm -qa | grep 包名 ----查看包
binutils-2.20.51.0.2-5.11.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
compat-libstdc++-33-3.2.3-69.el6.i686
gcc-4.4.4-13.el6 (x86_64)
gcc-c++-4.4.4-13.el6 (x86_64)
glibc-2.12-1.7.el6 (i686)
glibc-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6.i686
ksh
libgcc-4.4.4-13.el6 (i686)
libgcc-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6.i686
libstdc++-devel-4.4.4-13.el6 (x86_64)
libstdc++-devel-4.4.4-13.el6.i686
libaio-0.3.107-10.el6 (x86_64)
libaio-0.3.107-10.el6.i686
libaio-devel-0.3.107-10.el6 (x86_64)
libaio-devel-0.3.107-10.el6.i686
make-3.81-19.el6
sysstat-9.0.4-11.el6 (x86_64)
#rpm -ivh ***.rpm ----安装包
#rpm -e package_name ----卸载包
三.配置网络
#vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static ----设为静态
BROADCAST=192.168.40.255
NETMASK=255.255.255.0
NETWORK=192.168.40.1 ----主机的VMnet1中的IP(按自己PC设置,下同)
IPADDR=192.168.40.11 ----linux上的IP
ONBOOT=yes
TYPE=Ethernet
#server network restart (重启服务)
#vi /etc/hosts
127.0.0.1 localhost.domain localhost
192.168.40.11 localhost.domain
四.建用户组
#groupadd oinstall
#groupadd dba
#useradd -g oinstall -G dba oracle
#passwd oracle
五.复制内核参数
#vi /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
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
解决错误:(error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key)
解决方法: modprobe bridge
lsmod|grep bridge
六.限制Oracle用户
#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
七.添加内容
#vi /etc/pam.d/login
session required pam_limits.so ----添加此项
#vi /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
八.建安装目录
#mkdir /u01/app/oracle -p
#chown -R oracle:oinstall /u01
#chmod -R 755 /u01
九.设置环境变量 su oracle
$vi .bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_home_1
export ORACLE_SID=orcl
export NLS_LANG=american_america.zhs16gbk
export PATH=$PATH:$ORACLE_HOME/bin
重启Oracle用户
十. 设置DISPLAY
$su root
#w
#xhost +
#export DISPLAY=localhost:0.0
或
#export DISPLAY=:0.0
切换为oracle用户,cd 切换到oracle database 所在目录执行下面的命令进行安装:
$./runInstaller
以下为可能出现的错误:
一.[oracle@localhost ~]$dbca
Oracle Net Services Configuration:
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# SIGSEGV (0xb) at pc=0xa44b13a8, pid=2973, tid=3086891216
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_17-b02 mixed mode)
# Problematic frame:
# C [libnnz11.so+0x3c3a8]
#
# An error report file with more information is saved as hs_err_pid2973.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
解决方法:安装补丁
1.确认是否配置了ORACLE_HOME
[oracle@localhost~]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1
2.检查perl的版本,需要5.00503以上的版本
[oracle@localhost~]$ perl -v
This is perl, v5.8.8 built for i386-linux-thread-multi
3.关闭数据库,执行以下命令
[oracle@localhost~]$cd /…/8670579 ----切换到8670579所在的目录,8670579是相应补丁的名称
[oracle@localhost 8670579]$ $ORACLE_HOME/OPatch/opatch apply
二.安装过程提示 pdksh conflicts with ksh-20100621-2.el6.i686
解决方法: 执行下面的命令,需要相应的包
#rpm -e ksh-20100621-2.el6.i686
#rpm -ivh pdksh-5.2.14-36.el5.i386.rpm
三. [oracle@localhost ~]$ sqlplus / as sysdba
sqlplus: error while loading shared libraries: /u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1:
cannot restore segment prot after reloc: Permission denied
Linux下共享库问题导致无法启动SQLPLUS的问题解决,这个问题是由于SELINUX引起的
解决方法:
1.编辑/etc/sysconfig/selinux配置文件, 把SELINUX=enforcing 改为 SELINUX=disabled
2.使用命令chcon改变文件或者目录的SELinux属性, 语法chcon -t texrel_shlib_t 库名字
[oracle@localhost~]$ chcon -t texrel_shlib_t /u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1