RHEL6服务器上安装Oracle 9i
环境配置:
·安装系统:Red Hat Enterprise Linux 6 (RHEL6), 亦rhas6,版本u1,32bit(i386)
·数据库:Oracle9i (9.2.0.4.0)
·主机参数:HP主机,2G内存,160G硬盘,CD/DVD可读写光驱(HP dvd1060),GF8400独立显卡,自带声卡,网卡,usb2.0(7个),
注:
·查看主机内存:
方法一:在/proc/meminfo里面写的很清楚,cat看看。
方法二:unix和linux中“free”和“total”都可以看内存多少。(用来设置环境变量)
·查看光驱名称:df -H(用来确定挂载光盘名)
RHEL6 安装
应该不是什么大问题。不过建议初次安装或者对linux系统不是很熟系的朋友使用简体中文图形化安装界面。
还可参考网上众多的安装指导。
此时建议自定义安装依赖包,安装一些老的软件支持程序。
如果安装完系统以后不想使用图形界面,可以在/etc/inittab文件中找到id:5:initdefault 这一行,把5改为3或者更低即可。
oracle9i 安装
注: 下面以 $ 开头的命令都是由用户oracle执行的
# 开头的命令都是由用户root执行的
安装oracle的主要步骤归纳如下:
> 创建安装用户和目录、组
> 进行安装前系统配置,包括内核参数配置、安装用户环境变量配置、oracle对linux系统的特殊配置。
> 安装补丁和依赖包:因为没有这步在安装过程中会频繁报错,这时在手工改正,比较麻烦。因此,借鉴前人经验和测试过程,提前安装。
> 安装oracle:正式安装(光盘安装或者镜像安装)
> 安装后的补丁:还是要打一些补丁,才能正确完成安装。
上面步骤中的系统配置以及创建用户不分先后,无论先执行哪一步均可。但是一定要保证在配置完成后,要重启一下,然后用创建的oracle用户登录,不然会出现莫名的问题。
a)安装之前的检测:
gcc-4.4.7-11.el6.i686
compat-db-4.2.52-5.1
compat-gcc-34-3.4.6-4.1
compat-gcc-34-c++-3.4.6-4.1
compat-libstdc++-33-3.2.3-61
compat-libstdc++-296-2.96-138
openmotif-2.3.0-0.3.el5
openmotif22-2.2.3-18
openmotif-devel-2.3.0-0.3.el5
tclx-8.4.0-5.fc6
tcl-8.4.13-3.fc6
libXp-1.0.0-8.i386.rpm
libXp-devel-1.0.0-8.i386.rpm
giflib-4.1.3-7.1.el5.1.i386.rpm
giflib-devel-4.1.3-7.1.el5.1.i386.rpm
glibc-2.12-1.149.el6.i686
glibc-devel-2.12-1.149.el6.i686
下面的包在rhel6在线yum源不存在,需要手动安装,或者切换到rhel4的yum源安装,可以不安装
setarch-2.0-1.1
gtk+-1.2.10-57.fc7.i386.rpm
gnome-libs-1.4.2-9.rhel5.i386.rpm
compat-libcwait-2.1-1
libpng10-1.0.18-2.i386.rpm
ORBit-0.5.17-22.rhel5.i386.rpm
ORBit-devel-0.5.17-22.rhel5.i386.rpm
imlib-1.9.15-6.rhel5.i386.rpm
compat-oracle-rhel4-1.0-5.i386.rpm 可以不安装
以下安装包通过切换到rhel4的yum源安装
Installing:
ORBit i386 1:0.5.17-14 base 318 k
ORBit-devel i386 1:0.5.17-14 base 363 k
Installing for dependencies:
glib i386 1:1.2.10-15 base 125 k
glib-devel i386 1:1.2.10-15 base 114 k
indent i386 2.2.9-6 base 90 k
Transaction Summary
Dependencies Resolved
============================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================
Installing:
libpng10 i386 1.0.16-3.el4_5.1 base 148 k
libpng10-devel i386 1.0.16-3.el4_5.1 base 116 k
Transaction Summary
============================================================================================================================================================
Install 2 Package(s)
Dependencies Resolved
============================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================
Installing:
make i386 1:3.80-7.EL4 base 336 k
Transaction Summary
============================================================================================================================================================
Install 1 Package(s)
Dependencies Resolved
============================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================
Installing:
compat-gcc-32 i386 3.2.3-47.3 base 3.0 M
compat-gcc-32-c++ i386 3.2.3-47.3 base 3.7 M
Transaction Summary
============================================================================================================================================================
Install 2 Package(s)
Dependencies Resolved
============================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================
Installing:
compat-libgcc-296 i386 2.96-132.7.2 base 50 k
Transaction Summary
============================================================================================================================================================
Install 1 Package(s)
b)解决Error occurred during initialization of VM Unable to load native library: /tmp/OraInstall2012-02-02_11-14-57PM/
jre/lib/i386/libjava.so:symbol __libc_wait, version GLIBC_2.0 not defined in file libc.so.6 with link time reference:安装之前补丁修复
p3006854_9204_LINUX.zip 安装前就要打好的补丁
# unzip p3006854_9204_LINUX.zip
# chmod +x 3006854/rhel3_pre_install.sh
# 3006854/rhel3_pre_install.sh
Applying patch...
Patch successfully applied
c)解决linux ERROR: ld.so: object '/lib/libcwait.so' from /etc/ld.so.preload cannot be preloaded: ignored.
解决方法:
[root@ora9i 3238244]# echo "" > /etc/ld.so.preload -- 解决方法
1. 创建用户和组
# groupadd oinstall
# groupadd dba
# useradd -g oinstall -G dba oracle
# passwd oracle
2. 创建目录
# mkdir -p /u01/app/oracle/product/9.2.0
# chown -R oracle.oinstall /u01/app/oracle
# mkdir /u01/app/data
# chown oracle.dba /u01/app/data
# chmod 755 /u01/app/data
3. 修改/etc/hosts(解决thrown when the ip address of a host cannot be determined)
把127.0.0.1改为具体的ip地址,注意最好去掉那些无用的,格式如下:
ip地址 主机名 localhost
虽然oracle支持动态ip,但是建议最好指定固定ip
1).查看/etc/hosts,检查是否添加
ipaddress servername
例如:192.168.100.2 db01
2).查看/etc/sysconfig/network,检查hostname
hostname=servername
例如:hostname=db01
3).查看/etc/sysconfig/network-scripts/ifcfg-eth0,检查是否添加
BOOTPROTO=static
4. 系统配置
a) 设置内核参数:
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
执行sysctl -p使内核参数设置生效
# sysctl -p
b) 设置oracle对文件的要求
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
#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) 设置环境变量
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/9.2.0; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=$PATH:$ORACLE_HOME/bin; export PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JREORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
执行source .bash_profile使环境变量设置生效
$ source .bash_profile
5. 开始安装oracle
a) 解压oracle9i安装文件:
$ 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
6. 开始安装oracle
a) 创建链接:这个链接很重要,不然后面会报错。会提示你无法找到libstdc++-libc6.1-1.so.2;
# ln -s /usr/lib/libstdc++-libc6.2-2.so.3 /usr/lib/libstdc++-libc6.1-1.so.2
b) 解决Error in invoking target ntcontab.o of makefile /u01/app/oracle/product/9.2.0/network/lib/ins_net_client.mk失败
安装gcc软件包
# yum install gcc
c)解决Error in invoking target install of makefile ins_plsql.mk
redhat6 下安装oracle9204安装到63%的时候报错:Error in invoking target install of makefile /u01/app/oracle/product/9.2.0/db_1/plsql/lib/ins_plsql.mk
在/u01/app/oracle/oraInventory/logs目录下找到安装日志
[root@prod logs]# ll
total 3140
-rw-rw-r– 1 oracle oinstall 222272 Jul 17 23:17 installActions2012-07-17_11-15-34PM.log
-rw-r–r– 1 oracle oinstall 2294 Jul 17 23:17 installActions2012-07-17_11-17-13PM.log
-rw-rw-r– 1 oracle oinstall 2969018 Jul 18 11:21 installActions2012-07-18_10-59-05AM.log
-rw-rw-r– 1 oracle oinstall 6859 Jul 17 23:17 oraInstall2012-07-17_11-17-13PM.err
-rw-rw-r– 1 oracle oinstall 0 Jul 17 23:17 oraInstall2012-07-17_11-17-13PM.out
-rw-rw-r– 1 oracle oinstall 0 Jul 18 10:59 oraInstall2012-07-18_10-59-05AM.err
-rw-rw-r– 1 oracle oinstall 0 Jul 18 10:59 oraInstall2012-07-18_10-59-05AM.out
部分安装日志信息:
Starting install link phase of component Enterprise Edition Options
Starting install link phase of component Oracle9i Database
Calling action unixActions2.2.0.18.0 make
installMakePath = /usr/bin/make
installMakeFileName = /u01/app/oracle/product/9.2.0/db_1/network/lib/ins_net_client.mk
installTarget = client_sharedlib
undoMakeFileName =
installArguments = ORACLE_HOME=/u01/app/oracle/product/9.2.0/db_1,
logFile = /u01/app/oracle/product/9.2.0/db_1/install/make.log
undoTarget =
Calling action unixActions2.2.0.18.0 make
installMakePath = /usr/bin/make
installMakeFileName = /u01/app/oracle/product/9.2.0/db_1/network/lib/ins_net_client.mk
installTarget = mkldflags
undoMakeFileName =
installArguments = ORACLE_HOME=/u01/app/oracle/product/9.2.0/db_1,
logFile = /u01/app/oracle/product/9.2.0/db_1/install/make.log
undoTarget =
Calling action unixActions2.2.0.18.0 make
installMakePath = /usr/bin/make
installMakeFileName = /u01/app/oracle/product/9.2.0/db_1/plsql/lib/ins_plsql.mk
installTarget = install
undoMakeFileName =
installArguments = ORACLE_HOME=/u01/app/oracle/product/9.2.0/db_1,
logFile = /u01/app/oracle/product/9.2.0/db_1/install/make.log
undoTarget =
Exception thrown from action: make
Exception Name: MakefileException
Exception String: Error in invoking target install of makefile /u01/app/oracle/product/9.2.0/db_1/plsql/lib/ins_plsql.mk
通过查询,可以通过对gcc进行手动改名的方式即可正常安装。
解决过程:
首先手动或者rhel4yum源安装compat-gcc-32-3.2.3-47.3.i386.rpm
[root@prod bin]# pwd
/usr/bin
[root@prod bin]# ls -ltr gcc
-rwxr-xr-x 2 root root 96328 May 24 2006 gcc
[root@prod bin]# mv /usr/bin/gcc /usr/bin/gcc.bak
[root@prod bin]# ls -ltr gcc32
-rwxr-xr-x 2 root root 86364 Dec 2 2004 gcc32
[root@prod bin]# mv /usr/bin/gcc32 /usr/bin/gcc
点重试,可正常安装,安装完毕后把gcc给改回来
[root@prod bin]# mv /usr/bin/gcc /usr/bin/gcc32
[root@prod bin]# mv /usr/bin/gcc.bak /usr/bin/gcc
d) 解决Oracle Net Configuration Assistant、 Oracle Database Configuration Assistant 安装失败
su oracle
$ 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
e) 解决Agent Configuration Assistant安装失败:
su oracle
$ 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
f)解决Configuration tool Starting HTTP Server failed
/u01/app/oracle/product/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
/u01/app/oracle/product/9.2.0/Apache/Apache/bin/apachectl startssl: httpd could not be started
解决方法,安装gdbm包并做两个符号链接:
[root@r12dev r12dev]# yum install gdbm
[root@r12dev r12dev]# ln -s /usr/lib64/libgdbm.so.2.0.0 /usr/lib64/libdb.so.2
[root@r12dev r12dev]# ln -s /usr/lib/libgdbm.so.2.0.0 /usr/lib/libdb.so.2
g)解决runtime process failed during startup with errors /u01/r12dev/apps/tech_st/10.1.2/bin/frmweb: error while loading shared libraries: libXm.so.2: cannot open shared object file: No such file or directory
解决方法,安装openmotif包并增加两个符号链接:
[root@r12dev ~]# yum install openmotif
[root@r12dev ~]# ln -s /usr/lib64/libXm.so.4 /usr/lib64/libXm.so.2
[root@r12dev ~]# ln -s /usr/lib/libXm.so.4 /usr/lib/libXm.so.2
参考链接:
http://803517.blog.51cto.com/793517/1354678