Oracle Database 11g Release 2 (11.2) Installation On Oracle Linux 6
准备:
A )
* 物理内存至少1GB
* SWAP:物理<2GB,物理内存的1.5倍
2GB<物理<8GB, 与物理内存相同即可
8GB<物理, 物理内存的0.75倍
B )
RHEL6 ( CentOS6 ) 需要安装时需要安装以下包:
- Base System > Base
- Base System > Client management tools
- Base System > Compatibility libraries
- Base System > Hardware monitoring utilities
- Base System > Large Systems Performance
- Base System > Network file system client
- Base System > Performance Tools
- Base System > Perl Support
- Servers > Server Platform
- Servers > System administration tools
- Desktops > Desktop
- Desktops > Desktop Platform
- Desktops > Fonts
- Desktops > General Purpose Desktop
- Desktops > Graphical Administration Tools
- Desktops > Input Methods
- Desktops > X Window System
- Development > Additional Development
- Development > Development Tools
- Applications > Internet Browser
C )
下载Oracle安装程序。
- OTN: Oracle Database 11g Release 2 (11.2.0.1) Software (64-bit) - For unsupported installation.
- MOS: Oracle Database 11g Release 2 (11.2.0.3) Software (64-bit) - For supported installation.
安装:
A ) 解压
新建一个单独的目录存放下载好的压缩包,进行解压
# 11.2.0.1
unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip
B ) Hosts文件修改
修改Hosts文件,Host文件在“/etc/hosts”中。需要写本机的IP地址,这是为了配置监听的时候不会把127.0.0.1写进去。
格式:
<IP-address> <fully-qualified-machine-name> <machine-name>
For example:
127.0.0.1 localhost.localdomain localhost
192.168.0.181 ol6-112.localdomain ol6-112
C ) Oracle安装
自动安装
使用oracle-rdbms-server-11gR2-preinstall进行安装,根据http://public-yum.oracle.com安装yum repo。
# yum install oracle-rdbms-server-11gR2-preinstall
# yum update
手动安装
D ) 配置sysctl.conf
Oracle要求的最低设置:
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
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 -a | grep <param-name>
修改配置文件
# vi /etc/sysctl.conf
修改后,需要使变更后的配置生效。
# /sbin/sysctl -p
E ) 用户安全限制
添加以下条目到"/etc/security/limits.conf"中。
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 4096
oracle hard nofile 65536
oracle soft stack 10240
F ) 安装应用包
在RHEL6 ( CentOS6 )系统盘中安装以下包
# From Oracle Linux 6 DVD
cd /media/cdrom/Server/Packages
rpm -Uvh binutils-2*x86_64*
rpm -Uvh glibc-2*x86_64* nss-softokn-freebl-3*x86_64*
!rpm -Uvh glibc-2*i686* nss-softokn-freebl-3*i686*
rpm -Uvh compat-libstdc++-33*x86_64*
rpm -Uvh glibc-common-2*x86_64*
rpm -Uvh glibc-devel-2*x86_64*
!rpm -Uvh glibc-devel-2*i686*
rpm -Uvh glibc-headers-2*x86_64*
rpm -Uvh elfutils-libelf-0*x86_64*
rpm -Uvh elfutils-libelf-devel-0*x86_64*
rpm -Uvh gcc-4*x86_64*
rpm -Uvh gcc-c++-4*x86_64*
*rpm -Uvh ksh-*x86_64*
rpm -Uvh libaio-0*x86_64*
*rpm -Uvh libaio-devel-0*x86_64*
!rpm -Uvh libaio-0*i686*
rpm -Uvh libaio-devel-0*i686*
rpm -Uvh libgcc-4*x86_64*
rpm -Uvh libgcc-4*i686*
rpm -Uvh libstdc++-4*x86_64*
rpm -Uvh libstdc++-4*i686*
rpm -Uvh libstdc++-devel-4*x86_64*
rpm -Uvh make-3.81*x86_64*
*rpm -Uvh numactl-devel-2*x86_64*
rpm -Uvh sysstat-9*x86_64*
rpm -Uvh compat-libstdc++-33*i686*
rpm -Uvh compat-libcap*
cd /
eject
有一部分的包因为RHEL6版本较新的缘故,系统安装检查时会判定为faild,不过不会引起错误。
G ) 创建组和用户
groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 asmadmin
groupadd -g 506 asmdba
groupadd -g 505 asmoper
useradd -u 502 -g oinstall -G dba,asmdba,oper oracle
passwd oracle
H ) 其他配置
1、设置oracle用户的密码
#passwd oracle
2、修改"/etc/security/limits.d/90-nproc.conf" 文件
# 把原文件以下内容
* soft nproc 1024
# 修改成
* - nproc 16384
3、修改SELINUX
# vi /etc/selinux/config
写入 SELINUX=permissive
4、关闭防火墙,或者进行修改
# service iptables stop
5、创建Oracle目录
# mkdir -p /u01/app/oracle/product/11.2.0/db_1
# chown -R oracle:oinstall /u01
# chmod -R 775 /u01
6、环境变量设置
用创建好的oracle帐号登录,修改.bash_profile文件
# vi /home/oracle/.bash_profile
加入以下内容:
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=ol6-112.localdomain; export ORACLE_HOSTNAME
ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=DB11G; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
安装:
进入图形界面,远程登录使用VNC或是X manager。使用用创建好的oracle帐号登录,进入安装包解压后的安装目录下,运行runInstaller。开始安装。
常见错误
"error code 35" : The machine name in the "/etc/hosts" file is not correct. It needs an entry for the loopback adapter (localhost) and the machine name. If you are using DNS for name resolution, you still need the loopback adapter reference in this file.
"error code 37" : The DNS not working properly. You may also get this error is the "/etc/hosts" file is not configured correctly.
"sqlplus: error while loading shared libraries: libclntsh.so.11.1" : The prerequisites have not been met. Work through them again. Specifically, make sure the "gcc" package has been installed.
Listener fails to start - Typically this is due to incorrect name resolution. Make sure the "/etc/hosts" and/or DNS is configured correctly.
Linking errors - Almost always due to missing prerequisites. Review the setup sections.
本文档详述了如何在RHEL6或CentOS6上安装Oracle 11g Release 2 (11.2)。首先,你需要从OTN获取11.2.0.1的64位软件进行不受支持的安装,或者从MOS获取11.2.0.3的64位软件进行受支持的安装。
1125





