在Fedora上安装Oracle 9i
系统环境:Fedora Core 2,3,4,5,6
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环境变量
对于Fedora Core 2,3,4:编辑 /home/oracle/.bash_profile 并添加下列行:
1 2 3 4 5 6 7 8 9 10 | ORACLE_BASE=/opt/oracle ORACLE_HOME=$ORACLE_BASE/920 ORACLE_SID=MY_ORACLE LD_LIBRARY_PATH=$ORACLE_HOME/lib LD_ASSUME_KERNEL=2.4.1 THREADS_FLAG=native ORACLE_OEM_JAVARUNTIME=/opt/jre1.3.1_15 PATH=$PATH:$ORACLE_HOME/bin export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH LD_ASSUME_KERNEL THREADS_FLAG ORACLE_OEM_JAVARUNTIME PATH |
对于Fedora Core 5,6:编辑 /home/oracle/.bash_profile 并添加下列行:
1 2 3 4 5 6 7 8 | ORACLE_BASE=/opt/oracle ORACLE_HOME=$ORACLE_BASE/920 ORACLE_SID=MY_ORACLE LD_LIBRARY_PATH=$ORACLE_HOME/lib ORACLE_OEM_JAVARUNTIME=/opt/jre1.3.1_15 PATH=$PATH:$ORACLE_HOME/bin export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH ORACLE_OEM_JAVARUNTIME PATH |
保存后通过下面命令是配置生效
1 2 3 | su - oracle cd /home/oracle . .bash_profile |
二,下载安装
1,下载并安装需要的rpm软件包
检查软件包安装情况:
1 | rpm -q gcc glibc-headers glibc-kernheaders glibc-devel compat-libstdc++ cpp compat-gcc |
注意:在FC 6中并不需要安装软件包 glibc-kernheaders
软件包下载地址:http://fedora.redhat.com/
对于FC 3,4 需要安装特定compat-gcc
1 2 | rpm -e compat-gcc 下载compat-gcc-7.3-2.96.126.i386.rpm 下载地址:http://download.fedora.redhat.com/pub/fedora/linux/core/2/i386/os/Fedora/RPMS/ |
软件包安装:
1 2 3 4 5 6 7 | # rpm -ivh gcc-3.4.2-6.fc3.i386.rpm \ glibc-headers-2.3.3-74.i386.rpm \ glibc-kernheaders-2.4-9.1.87.i386.rpm \ glibc-devel-2.3.3-74.i386.rpm \ compat-libstdc++-3.4.2-6.fc3.i386.rpm \ cpp-3.4.2-6.fc3.i386.rpm \ compat-gcc-7.3-2.96.126.i386.rpm |
对于FC4,5,6
1 2 3 | # rpm -ivh compat-libgcc-296-2.96-___.rpm \ compat-libstdc++-33-3.2.3-___.rpm \ compat-libstdc++-296-2.96-___.rpm |
另外需要以root用户执行下面命令:
1 2 3 4 | su - # cd /usr/bin # mv ./gcc ./gcc34 # mv ./gcc32 ./gcc |
2,安装java环境
下载j2re-1_3_1_15-linux-i586.bin或更高版本,之后安装
1 2 3 | # chmod +x j2re-1_3_1_15-linux-i586.bin # ./j2re-1_3_1_15-linux-i586.bin # mv jre1.3.1_15 /opt/ |
3,下载oracle
下载地址:
1 | Oracle Database 32bit :http://www.oracle.com/technology/software/products/oracle9i/htdocs/linuxsoft.html |
解压文件:
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 |
并设置install/linux/oraparam.ini 中 JRE_LOCATION=/opt/jre1.3.1_15
4,开始安装
1 2 | cd database ./runInstaller |
如果网络配置和数据库配置出差,执行以下步骤
1 2 3 4 5 6 7 8 | cd /opt/oracle/920 rm JRE ln -s /opt/jre1.3.1_15 JRE su - # cd /opt/oracle/920/JRE/bin # ln -s java jre # cd i386/native_threads # ln -s java jre |
三、相关配置
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
安装软件包 compat-gcc-7.3-2.96.126.i386.rpm 并改变gcc配置
7,错误:/tmp/OraInstall2005-06-14_03-46-25PM/jre/bin/i386/native_threads/java: error while loading shared libraries: /tmp/OraInstall2005-06-14_03-46-25PM/jre/lib/i386/native_threads/libhpi.so: cannot restore segment prot after reloc: Permission denied
修改/etc/selinux/config 改变SELINUX值为“disabled”并重启系统
8,错误:sed: -e expression #1, char 7: unterminated `s’ command error in $ORACLE_HOME/install/make.log
这个错误会在FC5中出现,通过安装FC4版本对于bash可解决,下载bash-3.0-31.i386.rpm 并强制安装
9,错误:Initializing Java Virtual Machine from /tmp/OraInstall2006-10-25_01-43-30PM/jre/bin/java. Please wait… /tmp/OraInstall2006-10-25_01-43-30PM/jre/bin/i386/native_threads/java: error while loading shared libraries: libstdc++-libc6.1-1.so.2: cannot open shared object file: No such file or directory –
以root用户执行
su –
# cd /usr/lib
# ln -s libstdc++-3-libc6.2-2-2.10.0.so libstdc++-libc6.1-1.so.2
之后再次启动(./runInstaller)安装进程