出家如初,成佛有余

Oracle 10.2.0.1 在x86-64 的Redhat AS4 Update 2安装杂记

Posted in Uncategorized by chuanliang on 2009/06/13

   需要在一台Dell 1950 的Redhat AS4 Update 2上安装Oracle,原本打算重装操作系统升级到AS5,安装到分区时候,无法识别硬盘,没有Dell openManage Assistant光盘,也没有软驱,只好在原有的AS4 Update 2上安装Oracle。

   以前在电信项目中使用Oracle都是64位的Solaris及HP-Unix,因此很少考虑CPU兼容性问题。做互联网后很少再使用Oracle了,被AMD、INTEL们宣扬的x86_64与i386向下的兼容性所迷惑,因此也没细看服务器的系统配置,习惯性地上传了以前下载的Oracle 10.1.0.2 for Linux,按照Oracle安装的标准步骤配置好相关环境变量及内核参数后,启动安装界面运行到安装数据库(Installing Oracle Database )阶段,进度条始终停在2%就停止不动了。百思不得其解,找了半天原因,后来查看了一下机器配置(uname -a),发现Dell 1950的CPU是Intel XEON x86_64位的服务器,因此怀疑是x86_64机器的问题。

   只好又花了半天下载了一个Oracle 10201 linux x86_64版本 的安装包,下载完成后,解压后(gunzip 10201_database_linux_x86_64.cpio.gz;cpio -idmv < 10201_database_linux_x86_64.cpio),重新开始过程,在安装数据库阶段倒是顺利过了,但是到编译链接阶段(Linking ‘Oracle Database’),报错:

Error in invoking target ‘install’ of makefile ‘/opt/oracle/product/10.2/ctx/lib/ins_ctx.mk’

忽略错误继续安装,仍然报一堆类似的错误,看来继续安装已经没有价值了。

Screenshot1

从现象来看,应该是libstdc、gcc的问题,按照这篇文章,检查了Linux的rpm包

rpm -q –qf ‘%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})n’ binutils compat-db control-center gcc gcc-c++ glibc glibc-common  gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio libaio-devel

结果如下:
compat-db-4.1.25-9 (i386)
compat-db-4.1.25-9 (x86_64)
control-center-2.8.0-12.rhel4.2 (x86_64)
gcc-3.4.4-2 (x86_64)
gcc-c++-3.4.4-2 (x86_64)
glibc-2.3.4-2.13 (x86_64)
glibc-2.3.4-2.13 (i686)
glibc-common-2.3.4-2.13 (x86_64)
gnome-libs-1.4.1.2.90-44.1 (x86_64)
libstdc++-3.4.4-2 (x86_64)
libstdc++-3.4.4-2 (i386)
libstdc++-devel-3.4.4-2 (x86_64)
libstdc++-devel-3.4.4-2 (i386)
make-3.80-5 (x86_64)
pdksh-5.2.14-30.3 (x86_64)
sysstat-5.0.5-1 (x86_64)
xscreensaver-4.18-5.rhel4.9 (x86_64)
发现缺少了binutils、libstdc++-devel 、libaio、libaio-devel几个重要的包,下载了这几个包安装

wget ftp://ftp.pbone.net/mirror/www.whiteboxlinux.org/whitebox/4/en/os/x86_64/WhiteBox/RPMS/libaio-0.3.103-3.x86_64.rpm

wget ftp://ftp.pbone.net/mirror/www.whiteboxlinux.org/whitebox/4/en/os/i386/WhiteBox/RPMS/libaio-0.3.103-3.i386.rpm

wget http://oss.oracle.com/projects/compat-oracle/dist/files/RedHat/binutils-2.15.92.0.2-15.0.0.0.2.x86_64.rpm

rpm –Uvh –force libaio-0.3.103-3.x86_64.rpm libaio-0.3.103-3.i386.rpm binutils-2.15.92.0.2-15.0.0.0.2.x86_64.rpm

下载binutils时候有binutils-2.15.92.0.2-13.0.0.0.2.x86_64.rpmbinutils-2.15.92.0.2-15.0.0.0.2.x86_64.rpm两个包可供选择,按照Oracle的说明,在AS4 Update2上应当安装binutils-2.15.92.0.2-15.0.0.0.2.x86_64.rpm

安装完上述包,重新Oracle安装过程,进行到Linking Stage仍然报类似的错误。

按照这篇文章的说法,在x86_64上安装10G R2应当使用binutils-2.15.92.0.2-13.0.0.0.2.x86_64.rpm包,而不应当使用binutils-2.15.92.0.2-15.0.0.0.2.x86_64.rpm

卸载binutils-2.15.92.0.2-15.0.0.0.2.x86_64.rpm重新安装binutils-2.15.92.0.2-13.0.0.0.2.x86_64.rpm

rpm -e –force binutils-2.15.92.0.2-15.0.0.0.2 ;rpm -Uvh –force binutils-2.15.92.0.2-13.0.0.0.2.x86_64.rpm

安装进行到Linking Stage仍然报类似错误。

按照这篇文章的说法,还应当安装gcc、gcc-c++-、glibc-devel、glibc-headers、glibc-kernheaders的32位及64位的相关开发包

wget http://linuxsoft.cern.ch/cern/slc4X/x86_64/yum/updates/glibc-devel-2.3.4-2.13.i386.rpm

wget http://linuxsoft.cern.ch/cern/slc4X/x86_64/yum/updates/glibc-devel-2.3.4-2.13.x86_64.rpm

wget http://linuxsoft.cern.ch/cern/slc4X/x86_64/yum/updates/glibc-headers-2.3.4-2.13.x86_64.rpm

wget http://linuxsoft.cern.ch/cern/slc44/x86_64/yum/os/glibc-kernheaders-2.4-9.1.98.EL.x86_64.rpm

rpm –Uvh glibc-devel-2.3.4-2.13.i386.rpm glibc-devel-2.3.4-2.13.x86_64.rpm  glibc-headers-2.3.4-2.13.x86_64.rpm glibc-kernheaders-2.4-9.1.98.EL.x86_64.rpm

安装进行到Linking Stage仍然报错,查看日志oracle/oraInventory/logs/installActions2009-06-08_12-12-04PM.log,报/usr/lib64/libstdc++.so.5: No such file or directory 错误:

INFO:

INFO:  – Linking liborasdkbase

INFO: /coias/oracle/product/10.2/bin/genorasdksh -base

INFO: $Id: genorasdksh.sh 02-mar-2005.16:22:46 mchengjr Exp $

INFO: Generating BASE ORASDK library…

INFO: Creating /coias/oracle/product/10.2/lib/liborasdkbase.so.10.2

INFO: gcc:

INFO: /usr/lib64/libstdc++.so.5: No such file or directory

INFO: /coias/oracle/product/10.2/bin/genorasdksh: Failed to link liborasdkbase.so.10.2

INFO: make: *** [liborasdkbase] Error 1

INFO: End output from spawned process.

INFO: ———————————-

INFO: Exception thrown from action: make

Exception Name: MakefileException

Exception String: Error in invoking target ‘all_no_orcl’ of makefile ‘/coias/oracle/product/10.2/rdbms/lib/ins_rdbms.mk’. See ‘/coias/oracle/oraInventory/logs/installActions2009-06-08_12-12-04PM.log’ for details.

Exception Severity: 1

INFO: The output of this make operation is also available at: ‘/coias/oracle/product/10.2/install/make.log’

下载glibc-devel-2.3.4-2.13.i386.rpm、compat-gcc-32-c++-3.2.3-47.3.i386.rpm 、compat-gcc-32-3.2.3-47.3.i386.rpm

wget http://whiteboxlinux.osmirror.nl/4/en/obsolete-updates/glibc-devel-2.3.4-2.13.i386.rpm

wget ftp://ftp.chg.ru/pub/Linux/CentOS/4.7/os/i386/CentOS/RPMS/compat-gcc-32-c++-3.2.3-47.3.i386.rpm

wget ftp://ftp.chg.ru/pub/Linux/CentOS/4.7/os/i386/CentOS/RPMS/compat-gcc-32-3.2.3-47.3.i386.rpm

安装这几个包后,重新安装Oracle,在邻近崩溃边缘终于顺利完成Oracle安装。

真不容易,整整浪费了一天多的时间。

总结如下:

  1、x86_64并没有想CPU厂商宣扬的那样对32位CPU应用向下的兼容性,尤其是Intel的

  2、Oracle 10.2.0.1在AS4 Update2上安装,需要依赖libaio、libaio-devel、binutils、libstdc、glibc-devel、compat-gcc-32-c++、compat-gcc-32等几个重要的包,尤其是32位(i386或i686)、64位(X86_64)对应的包

rpm -q –qf ‘%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})n’ binutils compat-db control-center gcc gcc-c++ glibc glibc-common  gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio libaio-devel glibc-devel glibc-headers glibc-kernheaders compat-gcc-32-c++ compat-gcc-32


binutils-2.15.92.0.2-13.0.0.0.2 (x86_64)

compat-db-4.1.25-9 (i386)

compat-db-4.1.25-9 (x86_64)

control-center-2.8.0-12.rhel4.2 (x86_64)

gcc-3.4.4-2 (x86_64)

gcc-c++-3.4.4-2 (x86_64)

gcc-c++-3.4.4-2 (i386)

glibc-2.3.4-2.13 (i686)

glibc-2.3.4-2.13 (x86_64)

glibc-common-2.3.4-2.13 (x86_64)

gnome-libs-1.4.1.2.90-44.1 (x86_64)

libstdc++-3.4.4-2 (i386)

libstdc++-3.4.4-2 (x86_64)

libstdc++-devel-3.4.4-2 (x86_64)

make-3.80-5 (x86_64)

pdksh-5.2.14-30.3 (x86_64)

sysstat-5.0.5-11.rhel4 (i386)

xscreensaver-4.18-5.rhel4.9 (x86_64)

libaio-0.3.103-3 (x86_64)

libaio-0.3.103-3 (i386)

libaio-devel-0.3.103-3 (x86_64)

glibc-devel-2.3.4-2.13 (x86_64)

glibc-devel-2.3.4-2.13 (i386)

glibc-headers-2.3.4-2.13 (x86_64)

glibc-kernheaders-2.4-9.1.98.EL (x86_64)

compat-gcc-32-c++-3.2.3-47.3 (i386)

compat-gcc-32-3.2.3-47.3 (i386)

  3、这篇文档这个帖子对于Oracle 10R2在x86_64下安装过程总结得很不错,只不过刚开始时候没有耐心看完,怀着侥幸的心理看了前面一部分就开始安装,白白浪费了很多时间。

参考资料:

http://www.puschitz.com/InstallingOracle10g.shtml 

http://oss.oracle.com/projects/compat-oracle/files/RedHat/ 

http://forums.oracle.com/forums/thread.jspa?threadID=336440

http://www.freelists.org/post/oracle-l/Oracle-92-on-RH-ES-4-x86-64,5

http://forums.oracle.com/forums/thread.jspa?threadID=336440

http://space.itpub.net/4227/viewspace-69540

http://www.xxlinux.com/linux/article/development/database/20060709/2611.html

 

 

记录一下Oracle 自启动脚本配置方法,免得每一次都要写一遍

1)、vi /etc/rc.d/init.d/oracle 内容如下:

#!/bin/bash

#

#################FUNCTION#############

#

# AutoStart Oracle and listener

# AutoStop Oracle and listener

#

#

case "$1" in

start)

echo "Starting Oracle Databases … "

echo "————————————————-" >> /var/log/oracle

date +" %T %a %D : Starting Oracle Databasee as part of system up." >> /var/log/oracle

echo "————————————————-" >> /var/log/oracle

su – oracle -c "dbstart" >> /var/log/oracle

echo "Done."

echo "Starting Oracle Listeners … "

echo "————————————————-" >> /var/log/oracle

date +" %T %a %D : Starting Oracle Listeners as part of system up." >> /var/log/oracle

echo "————————————————-" >> /var/log/oracle

su – oracle -c "lsnrctl start" >> /var/log/oracle

echo "Done."

echo ""

echo "————————————————-" >> /var/log/oracle

date +" %T %a %D : Finished." >> /var/log/oracle

echo "————————————————-" >> /var/log/oracle

touch /var/lock/subsys/oracle

;;

stop)

echo "Stoping Oracle Listeners … "

echo "————————————————-" >> /var/log/oracle

date +" %T %a %D : Stoping Oracle Listener as part of system down." >> /var/log/oracle

echo "————————————————-" >> /var/log/oracle

su – oracle -c "lsnrctl stop" >> /var/log/oracle

echo "Done."

rm -f /var/lock/subsys/oracle

echo "Stoping Oracle Databases … "

echo "————————————————-" >> /var/log/oracle

date +" %T %a %D : Stoping Oracle Databases as part of system down." >> /var/log/oracle

echo "————————————————-" >> /var/log/oracle

su – oracle -c "dbshut" >>/var/log/oracle

echo "Done."

echo ""

echo "————————————————-" >> /var/log/oracle

date +" %T %a %D : Finished." >> /var/log/oracle

echo "————————————————-" >> /var/log/oracle

;;

restart)

$0 stop

$0 start

;;

*)

echo "Usage: oracle {start|stop|restart}"

exit 1

esac

——————————————————————————–

2)、chmod 755 /etc/rc.d/init.d/oracle

3)、vi /etc/oratab

  demo:/coias/oracle/product/10.2:Y

确认$ORACLE_HOME/bin/dbstart及$ORACLE_HOME/bin/dbshut中的ORATAB=/etc/oratab,如果不是,修改为

ORATAB=/etc/oratab

4)、chown oracle:dba /etc/oratab;chmod 755 /etc/oratab

5)、增加rc2.d、rc3.d、rc5.d启动、关闭脚本

  ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc2.d/S99oracle

  ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc3.d/S99oracle

  ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc5.d/S99oracle

  ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc0.d/K01oracle

  ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc6.d/K01oracle

Technorati 标签: ,,,,,,

No Responses Yet

Subscribe to comments with RSS.

  1. yueguxinxi said, on 2009/06/13 at 09:58

    呵呵,安装linux 安装oracle的时候,把开发包都打上就可以了.


发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: