在RedHat及其衍生系统上安装Oracle 9i
系统环境:RedHat (Oracle) Enterprise 4 x86 and x86_64
oracle版本:9i(R2)
安装过程分以下四个步骤
一,安装准备
二,下载安装
三,相关设置
四,常见错误
一,安装准备
1,创建oracle用户
以root用户登录,并创建oracle用户以及所属的dba组
1 2 3 4 5 | su - # groupadd dba # useradd -g dba oracle # mkdir /home/oracle # chown oracle:dba /home/oracle |
2,配置系统参数
编辑 /etc/sysctl.conf 文件并添加下列参数:
1 2 3 4 5 6 7 8 | kernel.sem = 250 32000 100 128 kernel.shmmax = 2147483648 kernel.shmmni = 128 kernel.shmall = 2097152 kernel.msgmnb = 65536 kernel.msgmni = 2878 fs.file-max = 65536 net.ipv4.ip_local_port_range = 1024 65000 |
编辑后可以运行“sysctl -p” 生效,或者重启系统
编辑 /etc/security/limits.conf 并添加下行参数:
1 2 | * - nproc 16384 * - nofile 16384 |
3,创建oracle目录
1 2 3 | # mkdir /opt/oracle # mkdir /opt/oracle/920 # chown -R oracle:dba /opt/oracle |
4,设置oracle环境变量
对于32位系统:编辑 /home/oracle/.bash_profile 并添加下列行:
1 2 3 4 5 6 7 8 | ORACLE_BASE=/opt/oracle ORACLE_HOME=$ORACLE_BASE/920 ORACLE_SID=MYORACLE LD_LIBRARY_PATH=$ORACLE_HOME/lib LD_ASSUME_KERNEL=2.4.19 PATH=$PATH:$ORACLE_HOME/bin export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH LD_ASSUME_KERNEL PATH |
对于64位系统:编辑 /home/oracle/.bash_profile 并添加下列行:
1 2 3 4 5 6 7 | ORACLE_BASE=/opt/oracle ORACLE_HOME=$ORACLE_BASE/920 ORACLE_SID=MYORACLE LD_LIBRARY_PATH=$ORACLE_HOME/lib32 PATH=$PATH:$ORACLE_HOME/bin export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH LD_ASSUME_KERNEL PATH |
保存后通过下面命令是配置生效
1 2 3 | su - oracle cd /home/oracle . .bash_profile |
二,下载安装
1,下载并安装需要的rpm软件包
检查软件包安装情况:
1 | rpm -q compat-db compat-gcc-32 compat-gcc-32-c++ compat-libcom_err compat-libcwait compat-libgcc-296 compat-libstdc++-296 compat-libstdc++-33 gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers glibc-kernheaders libgcc make |
32位系统对应软件包:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | binutils-2.15.92.0.2-21 compat-db-4.1.25-9 compat-gcc-32-3.2.3-47.3 compat-gcc-32-c++-3.2.3-47.3 compat-libcom_err-1.0-5 compat-libcwait-2.1-1 compat-libgcc-296-2.96-132.7.2 compat-libstdc++-296-2.96-132.7.2 compat-libstdc++-33-3.2.3-47.3 gcc-3.4.6-3.1 gcc-c++-3.4.6-3.1 glibc-2.3.4-2.25 glibc-common-2.3.4-2.25 glibc-devel-2.3.4-2.25 glibc-headers-2.3.4-2.25 glibc-kernheaders-2.4-9.1.98.EL libgcc-3.4.6-3.1 make-3.80-6.EL4.i386 |
其中 compat-libcwait-2.1-1.i386.rpm 需要另外下载,地址为:http://oss.oracle.com/projects/compat-oracle/files/RedHat/
64位系统对于软件包:
binutils-2.15.92.0.2-21.x86_64
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | compat-db-4.1.25-9.i386 compat-db-4.1.25-9.x86_64 compat-gcc-32-3.2.3-47.3.x86_64 compat-gcc-32-c++-3.2.3-47.3.x86_64 compat-libcom_err-1.0-5.i386 compat-libcom_err-1.0-5.x86_64 compat-libgcc-296-2.96-132.7.2.i386 compat-libstdc++-296-2.96-132.7.2.i386 compat-libstdc++-33-3.2.3-47.3.i386 compat-libstdc++-33-3.2.3-47.3.x86_64 gcc-3.4.6-3.1.x86_64 gcc-c++-3.4.6-3.1.x86_64 glibc-2.3.4-2.25.i686 glibc-2.3.4-2.25.x86_64 glibc-common-2.3.4-2.25.x86_64 glibc-devel-2.3.4-2.25.i386 glibc-devel-2.3.4-2.25.x86_64 glibc-headers-2.3.4-2.25.x86_64 glibc-kernheaders-2.4-9.1.98.EL.x86_64 libgcc-3.4.6-3.1.i386 libgcc-3.4.6-3.1.x86_64 make-3.80-6.EL4.x86_64 |
之后使用rpm -ivh进行软件包安装,另外需要以root用户执行下面命令:
1 2 3 4 | su - # cd /usr/bin # mv ./gcc ./gcc34 # mv ./gcc32 ./gcc |
2,下载oracle
下载地址:
1 2 | Oracle Database 32bit :http://www.oracle.com/technology/software/products/oracle9i/htdocs/linuxsoft.html Oracle Database 64bit :http://www.oracle.com/technology/software/products/oracle9i/htdocs/linuxx8664soft.html |
解压文件:
32位:
1 2 3 4 5 6 7 | gunzip ship_9204_linux_disk1.cpio.gz gunzip ship_9204_linux_disk2.cpio.gz gunzip ship_9204_linux_disk3.cpio.gz cpio -idmv < ship_9204_linux_disk1.cpio cpio -idmv < ship_9204_linux_disk2.cpio cpio -idmv < ship_9204_linux_disk3.cpio |
64位:
1 2 3 4 5 6 7 | gunzip amd64_db_9204_Disk1.cpio.gz gunzip amd64_db_9204_Disk2.cpio.gz gunzip amd64_db_9204_Disk3.cpio.gz cpio -idmv < amd64_db_9204_Disk1.cpio cpio -idmv < amd64_db_9204_Disk2.cpio cpio -idmv < amd64_db_9204_Disk3.cpio |
3,开始安装
1 2 | cd database ./runInstaller |
三、相关配置
1,还原GCC设置
1 2 3 4 | su - # cd /usr/bin # mv ./gcc ./gcc32 # mv ./gcc34 ./gcc |
四,常见错误
1,错误:Unable to load native library: /tmp/OraInstall2006-12-20_11-11-34AM/jre/lib/i386/libjava.so: symbol __libc_wait, version GLIBC_2.0 not defined in file libc.so.6 with link time reference
通过下载新的JRE 1.3.1版本解决,并在Disk1/install/linux/oraparam.ini 文件中设置JRE和JRE_LOCATION参数
2,错误:/opt/oracle/jre/1.1.8/bin/../lib/i686/native_threads/libzip.so: symbol errno, version GLIBC_2.0 not defined in file libc.so.6 with link time reference (libzip.so)
在环境变量中添加:Set the LD_ASSUME_KERNEL=2.4.19
3,错误:/tmp/OraInstall2006-12-20_11-38-19AM/jre/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory
安装xorg-x11-deprecated-libs 软件包
4,错误:Starting Oracle Intelligent Agent…/opt/oracle/920/bin/dbsnmpwd: line 156: 10736 Segmentation fault nohup $ORACLE_HOME/bin/dbsnmp $* >>$DBSNMP_WDLOGFILE 2>&1
下载补丁3238244 地址: http://metalink.oracle.com
5,错误:Exception in thread “main” java.lang.InternalError: Can’t connect to X11 window server using ‘localhost:0.0’ as the value of the DISPLAY variable.
以root用户打开终端或者ssh登录,通过下面命令均可可解决
命令一: export DISPLAY=:0.0
命令二: xhost +
6,错误:Error in invoking target install of makefile /opt/oracle/920/ctx/lib/ins_ctx.mk
Error in invoking target install of makefile /opt/oracle/920/precomp/lib/ins_precomp.mk
Error in invoking target install of makefile /opt/oracle/920/plsql/lib/ins_plsql.mk
Error in invoking ntcontab.o of makfile /opt/oracle/920/network/lib/ins_net_client.mk
软件包缺失,或者gcc未配置