2007年9月27日星期四

Ubuntu安装oracle 9i

原文抄袭,本来是打算安装10G的,但是似乎因为机子本来就有9I所以暂时搁浅了,具体参照10的PDF

安装过程主要参考这篇文章,该文主要是基于kubuntu安装oracle10g的,参考这篇文章可以比较容易的安装10g,但是在安装oracle9204时遇到了很多的障碍,最终安装完成了。安装过程如下:

1.空间要求

/tmp > 512M boot 128M swap 1024M / 2G /home 2GB

2.安装所需要的软件:

gcc, libaio1, libc6, libstdc++5, make, rpm, lesstif2, lesstif2-dev

vufuture@ubuntu:~$ for i in gcc libaio1 libc6 libstic++5 make rpm lesstif2 lesstif2-dev

> do

> sudo apt-get install $i

> done

3.添加需要的用户和组:

root@ubuntu:~# groupadd dba

root@ubuntu:~# useradd -g dba -G dba -d /home/oracle -s /bin/bash oracle

root@ubuntu:~# passwd oracle

Enter new UNIX password:

Retype new UNIX password:

passwd: password updated successfully

4.创建安装目录并赋权限:

root@ubuntu:~# mkdir -p /home/oracle/product/9.2.0

root@ubuntu:~# chown -R oracle:dba /home/oracle

root@ubuntu:~# mkdir /var/opt/oracle

root@ubuntu:~# chown -R oracle:dba /var/opt/oracle

root@ubuntu:~# chmod 755 /var/opt/oracle

5.设置oracle环境变量:

vi /home/oracle/.bash_profile

添加:

export ORACLE_BASE=/home/oracle

export ORACLE_HOME=$ORACLE_BASE/product/9.2.0 export ORACLE_SID=ora9i

export PATH=$PATH:$ORACLE_HOME/bin

export DISPLAY=localhost:0.0

6.修改核心参数:

root@ubuntu:~# vi /etc/sysctl.conf

#kernel.shmall = 2097152

kernel.shmmax = 2147483648

#kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.core.rmem_default = 262144

net.core.rmem_max = 262144

net.core.wmem_default = 262144

net.core.wmem_max = 262144

#fs.file-max = 65536

net.ipv4.ip_local_port_range = 1024 65000 7.设置安全限制:

root@ubuntu:~# vi /etc/security/limits.conf 增加如下:

# Security Limits

soft nproc 2407

hard nproc 16384

soft nofile 1024

hard nofile 65536

8.建立符号连接

root@ubuntu:~# ln -s /usr/bin/awk /bin/awk

root@ubuntu:~# ln -s /usr/bin/rpm /bin/rpm

root@ubuntu:~# ln -s /lib/libgcc_s.so.1 /lib/libgcc_s.so

root@ubuntu:~# ln -s /usr/bin/basename /bin/basename


解压安装文件:

root@ubuntu:/home# for i in 1 2 3

> do

> zcat ship_9204_linux_disk$i.cpio.gz | cpio -idmv > done

root@ubuntu:/home# su – oracle

oracle@ubuntu:/home/Disk1$ ./runInstaller

DISPLAY not set!

Please set DISPLAY and try again.

Oracle@ubuntu:/home/Disk1$ export DISPLAY=localhost:0.0 oracle@ubuntu:/home/Disk1$ ./runInstaller

oracle@ubuntu:/home/Disk1$ Initializing Java Virtual Machine from/tmp/OraInstall2007-03-23_12-40-26AM/jre/bin/java.

Please wait.. /tmp/OraInstall2007-03-23_12-40-26AM/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@ubuntu:~# apt-get install libstdc++6-dev无效 安装rpm包:

首先安装Alien,Alien 是一个将rpm, dpkg, stampede slp slackware tgz文件相互转换的工具。

Vufuture@ubuntu$ sudo apt-get install alien

vufuture@ubuntu$ sudo alien -k compat-libstdc++-7.3-2.96.118.i386.rpm

vufuture@ubuntu$ sudo dpkg -i compat-libstdc++_7.3-2.96.118_i386.deb

安装完这个rpm包后执行runInstaller不再报上面的错误,但是安装到Configuration Tools时,报如下错误: /home/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) Unable to initialize threads: cannot find class java/lang/Thread Could not create Java VM

据网上好多文章说是由于内核版本问题,在/home/oracle/.bash_profile添加: export LD_ASSUME_KERNEL=2.4.1

继续安装,这样可以正常安装,

但是用dbca建库的时候提示: SIGSEGV 11* segmentation violation

stackbase=0xb2b4b000, stackpointer=0xb2b4ad5c ……Dump information ……

ome/oracle/product/9.2.0/bin/dbca: line 124: 27883 Killed $JRE_DIR/bin/jre -DORACLE_HOME=$OH -DJDBC_PROTOCOL=thin -mx64m -classpath $CLASSPATH oracle.sysman.assistants.dbca.Dbca $ARGUMENTS

.bash_profile增加环境变量:

THREADS_FLAG=native; export THREADS_FLAG

Explanation

The DBCA is looking for the location of the files it is to create and cannot

locate them and also may need to use native threads versus green threads.

From MetaLink

最终./bash_profile内容如下:

export ORACLE_BASE=/home/oracle

export ORACLE_HOME=/home/oracle/product/9.2.0

export ORACLE_SID=ora9i

export PATH=PATH:$ORACLE_HOME/bin:/opt/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/sbin

export DISPLAY=localhost:0.0

export LD_ASSUME_KERNEL=2.4.1

THREADS_FLAG=native; export THREADS_FLAG

在建库的时候仍然有bug2682156--"special operator does not exist"

同时,不知道为什么在安装是没有出来去掉xml DB, intermedia, text等选项的选项卡。

没有评论: