这应该是我最后一次更新这篇文章...
环境: Red Hat Enterprise Linux 5 (RHEL5), Oracle9i (9.2.0.4.0)
RHEL5 安装可参考
Red Hat Enterprise Linux 5 (RHEL5) 安装说明 下面以 $ 开头的命令都是由oracle执行的
# 开头的命令都是由root执行的
1. 创建用户和组
-------------------------
添加安装过程中需要用到的用户和组
$ su -
# groupadd oinstall
# groupadd dba
# useradd -g oinstall -G dba oracle
# passwd oracle
2. 创建目录
--------------------------
我们将把所有东西都安装到在 /opt/oracle 目录下:
# mkdir -p /opt/app/oracle/9.2.0
# chown -R oracle.oinstall /opt/app/oracle
3. 系统配置
--------------------------
a) 设置内核参数
编辑/etc/sysctl.conf
kernel.shmmax = 536870912 这里设置为物理内存的一半 1G内存的话为:512×1024×1024
kernel.shmmni = 4096 2G 内存的话为:1024×1024×1024
kernel.shmall = 2097152
kernel.sem = 250 32000 100 128 其他的值都不用动
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
sem 4个参数依次为 SEMMSL(每个用户拥有信号量最大数);
SEMMNS(系统信号量最大数);
SEMOPM(每次semopm系统调用操作数);
SEMMNI(系统辛苦量集数最大数).
Shmmax 最大共享内存2GB 物理内存如果小的话可以设置成 536870912.
Shmmni 最小共享内存 4096KB.
Shmall 所有内存大小.
执行sysctl以反映修改 使内核参数立刻生效,重启也可以
# sysctl –p
也可以在运行时通过执行下列命令更改内核参数:
#echo 250 32000 100 128 > /proc/sys/kernel/sem
#echo 268435456 > /proc/sys/kernel/shmmax # 1/2 * mem_size(M) * 1024 *1024
#echo 4096 > /proc/sys/kernel/shmmni
#echo 524288 > /proc/sys/kernel/shmall # mem_size(M) * 1024
#echo 65536 > /proc/sys/fs/file-max
#echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range
b) 设置oracle对文件的要求
修改文件:/etc/security/limits.conf
#echo oracle soft nofile 65536 >> /etc/security/limits.conf
#echo oracle hard nofile 65536 >> /etc/security/limits.conf
#echo oracle soft nproc 16384 >> /etc/security/limits.conf
#echo oracle hard nproc 16384 >> /etc/security/limits.conf
c) 设置环境变量
在/home/oracle/.bash_profile 中添加如下行:
export ORACLE_SID=zhang
export ORACLE_BASE=/opt/app/oracle
export ORACLE_HOME=/opt/app/oracle/9.2.0
export LD_LIBRARY_PATH=/opt/app/oracle/9.2.0/lib:/lib:/usr/lib:/usr/local/lib:/usr/X11R6/lib
export TNS_ADMIN=/opt/app/oracle/9.2.0/network/admin
export ORA_NLS33=/opt/app/oracle/9.2.0/ocommon/nls/admin/data
export ORACLE_OWNER=oracle
export ORACLE_TERM=xterm
export PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/app/oracle/9.2.0/bin
4. 打补丁、安装需要的包, 至于为什么要做这些工作,后面有个Tips,给出了安装中出现的错误及其Solution
--------------------------------------------------------------------------------------------------
a) 补丁说明:
p3006854_9204_LINUX.zip 安装前就要打好的补丁
p2617419_210_GENERIC.zip 安装后要打的(这只是一个伴随补丁,只要设置它的
环境变量)
p3238244_9204_LINUX.zip 安装后要打的9204的补丁,修复agent错误的补丁.
http://www.opennet.ru/soft/ora_inst/ compat-libcwait-2.0-2.i386.rpm LINUX AS 4 的补丁在安装前就要打
compat-oracle-rhel4-1.0-5.i386.rpm LINUX AS 4 的补丁在安装前就要打,但我没安装它
http://oss.oracle.com/projects/compat-oracle/files/RedHat/ b) 打p3006854_9204_LINUX.zip
# unzip p3006854_9204_LINUX.zip
# chmod +x 3006854/rhel3_pre_install.sh
# 3006854/rhel3_pre_install.sh
c) 安装 compat-libcwait-2.1-1.i386.rpm
# rpm -ivh compat-libcwait-2.1-1.i386.rpm
d) 一些需要的包,这些包可以从系统盘中找到
# rpm -ivh compat-db-4.2.52-5.1.i386.rpm
# rpm -ivh libXp-1.0.0-8.i386.rpm
# rpm -ivh libXp-devel-1.0.0-8.i386.rpm
# rpm -ivh openmotif-2.3.0-0.3.el5.i386.rpm
# rpm -ivh openmotif-devel-2.3.0-0.3.el5.i386.rpm
d) gnome-libs-1.4.2-7.rhel5.i386.rpm 和 一些依赖包
这些包网上都可以找到
# rpm -ivh giflib-4.1.3-8.i386.rpm
# rpm -ivh glib-1.2.10-26.fc7.i386.rpm
# rpm -ivh libpng10-1.0.18-2.i386.rpm
# rpm -ivh ORBit-0.5.17-22.rhel5.i386.rpm
# rpm -ivh gtk+-1.2.10-57.fc7.i386.rpm
# rpm -ivh imlib-1.9.15-2.fc7.i386.rpm
# rpm -ivh gnome-libs-1.4.2-7.rhel5.i386.rpm
e) 创建链接
# ln -s /usr/lib/libstdc++-libc6.2-2.so.3 /usr/lib/libstdc++-libc6.1-1.so.2
到这你可以能会说前面的两个补丁还没打,请别着急,后面会用到它们的
好,我们继续...
5. 开始安装oracle
----------------------------------------------------------------------------------
1) 准备工作
download oracle 9i
http://www.oracle.com/technology/software/products/oracle9i/htdocs/linuxsoft.html 解压
$ zcat ship_9204_linux_disk1.cpio.gz | cpio -idmv
$ zcat ship_9204_linux_disk2.cpio.gz | cpio -idmv
$ zcat ship_9204_linux_disk3.cpio.gz | cpio -idmv
2) 请重启X然后用oracle登陆系统, 否则会出现一些列的错误,如:xhost +、环境变量、etc
$ Disk1/runInstaller
没有特别说明的均按默认设置,根据界面提示,然后点 Next 或 OK即可.
Oracle install group : oinstall
Global Database Name : ox0spy.org (可根据你的情况填写)
这个过程中还会出现两次提示,让你运行指定目录下的脚本,根据提示做就可以了
3) 现在应该安装到Configuration Tools了,如果在这出现错误,提示Configuration Tools安装失败,
不要着急,我们还有两个补丁没打呢. 其实准确的说是一个补丁, p2617419_210_GENERIC.zip只是
一个伴随补丁, 我这不需要,手动完成就好
解决Agent Configuration Assistant安装失败
$ unzip p3238244_9204_LINUX.zip
$ cp 3238244/files/lib/stubs/* $ORACLE_HOME/lib/stubs/
$ cd $ORACLE_HOME/network/lib/
$ make -f ins_oemagent.mk install
解决 Oracle Net Configuration Assistant, Oracle Database Configuration Assistant 安装失败
$ rm $ORACLE_HOME/JRE
$ ln -s $ORACLE_BASE/jre/1.3.1/ $ORACLE_HOME/JRE
$ ln -s $ORACLE_HOME/JRE/bin/java $ORACLE_HOME/JRE/bin/jre
$ ln -s $ORACLE_HOME/JRE/bin/i386/native_threads/java $ORACLE_HOME/JRE/bin/i386/native_threads/jre
OK,现在Retry,你就可以成功安装Configuration Tools了,安装也就结束了...
==================================================
* Tips: (这是我安装过程中出现的问题及其解决方法)
==================================================
1. error while loading shared libraries: libstdc++-libc6.1-1.so.2:
cannot open shared object file: No such file or directory - after
./runInstaller execution.
===================================================
Solution:
su -
# cd /usr/lib
# ln -s libstdc++-3-libc6.2-2-2.10.0.so libstdc++-libc6.1-1.so.2
2. Oracle 9i Patch
==========================
p2617419_220_GENERIC.zip
p3006854_9204_LINUX.zip
p3238244_9204_LINUX.zip
http://www.opennet.ru/soft/ora_inst/ compat-libcwait-2.0-2.i386.rpm
compat-oracle-rhel4-1.0-5.i386.rpm
http://oss.oracle.com/projects/compat-oracle/files/RedHat/ 3. 几个需要的包所在的路径
===========================
compat-db -- AS5 disk 3
compat-gcc-34 -- 2
compat-gcc-34-c++ -- 2
compat-libgcc -- 3
openmotif -- 3
4. Exception in thread "main" java.lang.UnsatisfiedLinkError:
/tmp/OraInstall2007-12-06_07-00-08PM/jre/lib/i386/libawt.so: libXp.so.6:
cannot open shared object file: No such file or directory
====================================================
Solution: install the follow RPMs
libXpm -- 1
libXpm-devel -- 2
libXp -- 2
libXp-devel -- 2
5. Exception in thread "main" java.lang.InternalError: Can't connect to
X11 window server using ':0.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at
sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:59)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:58)
at java.awt.Window.<init>(Window.java:188)
at java.awt.Frame.<init>(Frame.java:315)
at java.awt.Frame.<init>(Frame.java:262)
at oracle.sysman.oii.oiic.OiicInstaller.main(OiicInstaller.java:593)
================================================================
Solution: (xhost +的问题 )
1. 用oracle用户登录x-window
或者
2.用root用户运行
# xhost +
6. Fatal: Stack size too small. Use 'ulimit -s' to increase default
stack size.
==========================
第二次运行就正常了
7. $ dbca // 无法启动dbca,提示错误如下:
/opt/oracle/jre/1.1.8/bin/../lib/i686/green_threads/libzip.so: symbol
errno, version GLIBC_2.0 not defined in file libc.so.6 with link time
reference (libzip.so)
Unable to initialize threads: cannot find class java/lang/Thread
Could not create Java VM
==========================
Solution: (参考 冷风的Fedora 7最新安装Oracle9204手记)
$ cd /opt/app/oracle/product/9.2.0
$ ls -l JRE
lrwxrwxrwx 1 oracle oinstall 25 Dec 7 10:11 JRE -> /opt/app/oracle/jre/1.1.8
$ rm JRE
$ ln -s /opt/app/oracle/jre/1.3.1 JRE
$ su -
# cd /opt/app/oracle/product/9.2.0/JRE/bin/
# ln -s java jre
# cd i386/native_threads/
# ln -s java jre
8. 快装完的时候有:
parameter "orahome"=/home/oracle/product/9.2.0
parameter "nodeinfo"=NO_value
提示失败。
=======================================================
Solution:
打上安装补丁p3238244_9204_LINUX.zip
unzip p3238244_9204_LINUX.zip
cd 3238244
手工将3238244/files/lib/stubs目录下的所有文件复制到
/oracle/product/9.2.0/lib/stubs/目录下也可以,如下:
cp files/lib/stubs/* $ORACLE_HOME/lib/stubs/
重新连接编译"Agent"相关程序
cd $ORACLE_HOME/network/lib/
make -f ins_oemagent.mk install
耐心等待成功编译。
再点击前面oracle安装程序中的"Agent Configuration Assistant",并点击
"Retry"重新运行配置工具程序,过一会应该会成功,退出安装
9. /opt/app/oracle/9.2.0/Apache/Apache/bin/apachectl startssl: httpd
could not be started
/opt/app/oracle/9.2.0/Apache/Apache/bin/httpd: error while loading
shared libraries: libdb.so.2: cannot open shared object file: No such
file or directory
=======================================================
Solution:
安装 gnome-libs-1.4.2-7.rhel5.i386.rpm 及其依赖的包
giflib-4.1.3-8.i386.rpm
libpng10-1.0.18-2.i386.rpm
glib-1.2.10-26.fc7.i386.rpm
ORBit-0.5.17-22.rhel5.i386.rpm
gnome-libs-1.4.2-7.rhel5.i386.rpm
rpmdb-redhat-4-0.20071031.src.rpm
imlib-1.9.15-2.fc7.i386.rpm
gtk+-1.2.10-57.fc7.i386.rpm
写在最后,为了更加容易安装,我写了三个简单的脚本
+++++++++++++++++++++++++++++++++++++++++++
+ 为了使安装更加容易,我写了3个简单的脚本:
+
beforeInstallOracle.sh,
+
patch_before_install.sh,
+
patch_configuration_tools.sh +++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++
+ patch目录结构如下:
++++++++++++++++++++
C:\>tree /f D:\patch
卷 PROGRAM 的文件夹 PATH 列表
卷序列号码为 0006EE50 D662:9A5F
D:\PATCH
│ beforeInstallOracle.sh
│ p3006854_9204_LINUX.zip
│ p3238244_9204_LINUX.zip
│ patch_configuration_tools.sh
│ compat-libcwait-2.1-1.i386.rpm
│ patch_before_install.sh
│
└─rpm
│ libXp-1.0.0-8.i386.rpm
│ openmotif-2.3.0-0.3.el5.i386.rpm
│ compat-db-4.2.52-5.1.i386.rpm
│ libXp-devel-1.0.0-8.i386.rpm
│ compat-gcc-34-c++-3.4.6-4.i386.rpm
│ openmotif-devel-2.3.0-0.3.el5.i386.rpm
│ compat-gcc-34-3.4.6-4.i386.rpm
│ libXpm-3.5.5-3.i386.rpm
│ compat-libgcc-296-2.96-138.i386.rpm
│ libXpm-devel-3.5.5-3.i386.rpm
│
└─download
gnome-libs-1.4.2-7.rhel5.i386.rpm
ORBit-0.5.17-22.rhel5.i386.rpm
libpng10-1.0.18-2.i386.rpm
gtk+-1.2.10-57.fc7.i386.rpm
gnome-libs-devel-1.4.2-7.rhel5.i386.rpm
glib-1.2.10-26.fc7.i386.rpm
imlib-1.9.15-2.fc7.i386.rpm
giflib-4.1.3-8.i386.rpm
rpmdb-redhat-4-0.20071031.src.rpm
注:由于补丁和包太大、网上也有,就不上传