[重发]RedHat Enterprise Linux 5(RHEL5)安装Oracle 11.1.0.6(11gR1)简要
原文刊载于2007年8月18日晚
新鲜出炉的Oracle 11.1.0.6的文档中对以下Linux发行版提供了
Asianux 2.0
Asianux 3.0
Oracle Enterprise Linux 4.0
Oracle Enterprise Linux 5.0
Red Hat Enterprise Linux 4.0
Red Hat Enterprise Linux 5.0
SUSE Enterprise Linux 10.0
估计现在用得最多就是RHEL4和5了。关于在RHEL5上安装Oracle11g,在ITPUB和fenng的Blog上已经有所说明,前者有具体截图,后者有简洁说明。我还是简单写个流程吧:
一、 安装RHEL5的时候要注意对硬盘空间的规划,根据Oracle的推荐,Oracle11g要求1G内存(如果达不到那就调小各种参数,反正自己测试用, 问题也不大),对应的swap就需要1.5G(如果小于512MB,那么swap=2*RAM,如果大于2G,那么swap=RAM,如果大于8G,那么 swap=0.75*RAM,512-2G之间的,1.5*RAM就OK了),/tmp需要400MB,安装企业版的Oracle需要3.47GB,默认 库又需要1.6GB。可以用grep MemTotal /proc/meminfo检查。如下可以临时转移/tmp到有空闲资源的地方:
su – root
mkdir /<AnotherFilesystem>/tmp
chown root.root /<AnotherFilesystem>/tmp
chmod 1777 /<AnotherFilesystem>/tmp
export TEMP=/<AnotherFilesystem> # used by Oracle
export TMPDIR=/<AnotherFilesystem> # used by Linux programs like the linker “ld”
结束后恢复:
su – root
rmdir /<AnotherFilesystem>/tmp
unset TEMP
unset TMPDIR
二、在正常安装完成RHEL5之后,首先建议停掉SELinux和防火墙,然后检查如下的包是否装全了(rpm -qa | grep 包名)
binutils-2.17.50.0.6-2.el5
compat-libstdc++-33-3.2.3-61
elfutils-libelf-0.125-3.el5
elfutils-libelf-devel-0.125
glibc-2.5-12
glibc-common-2.5-12
glibc-devel-2.5-12
gcc-4.1.1-52
gcc-c++-4.1.1-52
libaio-0.3.106
libaio-devel-0.3.106
libgcc-4.1.1-52
libstdc++-4.1.1
libstdc++-devel-4.1.1-52.e15
make-3.81-1.1
sysstat-7.0.0
unixODBC-2.2.11
unixODBC-devel-2.2.11
三、增加用户:
su – root
groupadd dba
groupadd oinstall
useradd -c “Oracle Owner” -g oinstall -G dba oracle
passwd oracle
之后安装路径的路径,比如:
su – root
mkdir -p /u01/app/oracle
chown -R oracle.oinstall /u01/app
chmod -R 775 /u01/app
四、对各类参数,fenng提供了一个简洁的说明,修改 /etc/sysctl.conf,追加如下内容:
# First line:SEMMSL SEMMNS SEMOPM SEMMNI
kernel.sem=1055 32000 100 128
kernel.shmmax=2147483648
kernel.shmall = 2097152
net.ipv4.tcp_sack = 0
net.ipv4.tcp_timestamps = 0
net.ipv4.conf.default.rp_filter = 0
net.core.optmem_max = 65535
net.core.rmem_default = 4194304
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 262144
fs.file-max = 6553600
net.ipv4.ip_local_port_range = 1024 65000
上述值中fs.file-max一项,Oracle的建议是512 * PROCESSES。
然后执行/sbin/sysctl -p激活(root用户)。
五、修改Shell限制。
在/etc/security/limits.conf中增加:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
在/etc/pam.d/login增加或创建:
session required /lib/security/pam_limits.so //对64位系统这条不需要
session required pam_limits.so
对Bourne、Bash或Korn shell,编辑/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
对C shell,编辑/etc/csh.login增加:
if ( $USER == “oracle” ) then
limit maxproc 16384
limit descriptors 65536
endif
六、修改环境变量。选择好你的安装目录后,直接编辑上面提到的shell环境文件,增加类似如下,就可以了:
export ORACLE_BASE=/u01/app/oracle //安装路径
export ORACLE_SID=orcl11
export DISPLAY=你的IP:0.0(如果是在本地安装,不要加IP,直接DISPLAY=:0.0就可以了)
完成安装以后还要加上:
export ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1 //HOME路径
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
七、执行./runInstaller,大功告成。