`

ubuntu11.10 安装oracle

 
阅读更多
安装过程
(—)安装配置文件
1.1参考资料
1.参考的是网上ubuntu 官方的一些解决方案
http://www.oracle-base.com/articles/10g ... HatAS3.php
2.在ubuntu上安装oracle10.2.0.1的方法,参考网页是:
viewtopic.php?f=44&t=214988
3、其他参考http://libin0019.iteye.com/blog/1207282
4、其他参考http://libin0019.iteye.com/blog/1207282
1.2安装准备
1.2.1准备Red Hat Enterprise Linux 3的安装文件和rpm包
因为oracle官方支持在Red Hat Enterprise Linux 3上安装,所以我是先在Red Hat Enterprise Linux 3上安装oracle10.2.0.1成功的,按参考资料1的步骤,安装比较顺利。因此,ubuntu11.10 desktop上需要Red Hat Enterprise Linux 3上的一些包。由于有Red Hat Enterprise Linux 3的安装盘,就直接用Red Hat Enterprise Linux 3的安装盘上的包就可以了,这些包应该也可以在网上找到。

在redhat的网站下载Red Hat Enterprise Linux 3的iso软件包。先在www.redhat.com上以个人或企业名义注册,如果已企业名义注册就可以直接到下载页面下载;如果以个人名义注册,登录后,可以在下面的网址下载:
https://rhn.redhat.com/rhn/software/dow ... AllISOs.do

我下载的是Red Hat Enterprise Linux ES (v. 3 for x86) 版本。
AS(Advanced Server) 是高端的产品;
ES (Entry Server) 是入门级的产品,是AS的精简版本;
WS (Workstation) 是ES的进一步简化版,主要针对企业内部的桌面环境;

因此,下载ES版本就可以了。
需要下载四个iso文件:
rhel-3-u9-i386-es-disc1.iso
rhel-3-u9-i386-es-disc2.iso
rhel-3-u9-i386-es-disc3.iso
rhel-3-u9-i386-es-disc4.iso

然后用winiso程序,将编号为2和3的两个iso文件依次打开,把以下文件提取出来:
setarch-1*
openmotif-2*
compat-libstdc++-7*
compat-libstdc++-devel-7*
compat-db-4*
compat-gcc-7*
compat-gcc-c++-7*
libaio-0*

1.2.2实际上就是以下8个文件:
setarch-1.3-1.i386.rpm
openmotif-2.2.3-5.RHEL3.7.i386.rpm
compat-db-4.0.14-5.3.i386.rpm
compat-gcc-7.3-2.96.128.i386.rpm
compat-gcc-c++-7.3-2.96.128.i386.rpm
compat-libstdc++-7.3-2.96.128.i386.rpm
compat-libstdc++-devel-7.3-2.96.128.i386.rpm
libaio-0.3.96-7.i386.rpm





1.2.3 oracle需要的rpm包和更新:
安装oracle10g需要gcc-3.2.3-59.i386.rpm
共9个rpm包
gcc-3.2.3-59.i386.rpm版本低的话,可以在下面url找最新gcc
ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/snapshots/

网上提供的包下载地址
ftp://ftp.pbone.net/mirror/www.whitebox ... 7.i386.rpm
ftp://ftp.pbone.net/mirror/www.whitebox ... 8.i386.rpm
ftp://ftp.pbone.net/mirror/www.whitebox ... 8.i386.rpm
ftp://ftp.pbone.net/mirror/www.whitebox ... 8.i386.rpm
ftp://ftp.pbone.net/mirror/www.whitebox ... 8.i386.rpm
ftp://ftp.pbone.net/mirror/www.whitebox ... 3.i386.rpm
ftp://ftp.pbone.net/mirror/www.whitebox ... 1.i386.rpm
ftp://ftp.pbone.net/mirror/www.whitebox ... 9.i386.rpm
ftp://ftp.pbone.net/mirror/www.whitebox ... 7.i386.rpm


rpm更新包的网址: http://rpm.pbone.net 可以找到所有包最新版本
1.2.4下载oracle10.2.0.1安装文件:
下载路径:http://www.oracle.com/technetwork/datab ... 97986.html
下载的文件是:10201_database_linux32.zip


1.2.5winiso做成iso文件(也可以不打入ios文件)
最好是用winiso做成iso文件,我是解包后做成iso文件,同时将上面准备的rpm文件也打包在这个iso文件里,文件包括:
setarch-1.3-1.i386.rpm
openmotif-2.2.3-5.RHEL3.7.i386.rpm
compat-db-4.0.14-5.3.i386.rpm
compat-gcc-7.3-2.96.128.i386.rpm
compat-gcc-c++-7.3-2.96.128.i386.rpm
compat-libstdc++-7.3-2.96.128.i386.rpm
compat-libstdc++-devel-7.3-2.96.128.i386.rpm
libaio-0.3.96-7.i386.rpm
gcc-3.2.3-59.i386.rpm

注意:rpm文件可直接打包在install-lib目录下,也可以用其他方式拷贝到安装好的ubuntu操作系统中。

到此,文件就准备好了。

1.3正式安装
此处假设你的ubuntu-11.10-desktop-i386已安装好。


1.3.1界面设置
如果觉得ubuntu-11.10的花哨的界面不习惯,可以将界面恢复为经典模式:
sudo apt-get install gnome-panel
然后logout重新登录,选择“GNOME Classic”方式登录。

1.3.2安装必要的软件包
首先必须:apt-get install update    apt-get install upgrade
sudo apt-get install gcc make binutils lesstif2 libc6 libc6-dev rpm libstdc++5 gawk alien ksh libstdc++5

sudo apt-get install build-essential libaio1 gawk ksh libmotif3 alien libtool lsb-rpm

各种参考资料要求安装的软件包不大一样,暂且就安装这些

1.3.3配置/etc/sysctl.conf
将下面几行加入文件"/etc/sysctl.conf"的尾部,每行开头不要有空格
命令:root@ubuntu:~# vi /etc/sysctl.conf
添加:
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144

在root用户下执行
/sbin/sysctl –p
1.3.4配置/etc/security/limits.conf"
将下面几行加入文件"/etc/security/limits.conf"的尾部,每行开头不要有空格
命令:root@ubuntu:~# vi /etc/security/limits.conf
添加:
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536

1.3.5配置/etc/pam.d/login
将下面一行加入文件"/etc/pam.d/login"的尾部,每行开头不要有空格
session required pam_limits.so
1.3.6增加组和用户
创建相应目录,在root用户下执行
groupadd oinstall
groupadd dba
groupadd oper

useradd -g oinstall -G dba oracle
passwd oracle
mkdir -p /u01/app/oracle/product/10.2.0/db_1
chown -R oracle.oinstall /u01

mkdir -p /home/oracle
chown -R oracle.oinstall /home/oracle

1.3.7建立文件的符号链接
在root用户下执行

ln -s /usr/bin/awk /bin/awk;
ln -s /usr/bin/rpm /bin/rpm;
ln -s /usr/bin/basename /bin/basename;

mkdir /etc/rc.d;
ln -s /etc/rc0.d /etc/rc.d/rc0.d;
ln -s /etc/rc1.d /etc/rc.d/rc1.d;
ln -s /etc/rc1.d /etc/rc.d/rc2.d;
ln -s /etc/rc1.d /etc/rc.d/rc3.d;
ln -s /etc/rc1.d /etc/rc.d/rc4.d;
ln -s /etc/rc1.d /etc/rc.d/rc5.d;
ln -s /etc/rc1.d /etc/rc.d/rc6.d;
ln -s /etc/init.d /etc/rc.d/init.d;

1.3.8冒充rad Hat Linux
由于oracle10g2在ubuntu上得不到oracle的官方支持,只得将ubuntu假冒为"Red Hat Linux release 4",在root用户下执行
echo "Red Hat Linux release 4" > /etc/redhat-release

1.3.9安装rpm包
假设rpm包已经被复制到/home/oracle/oracle-setup/install-lib,/home/oracle/oracle-setup是我个人建的安装文件目录,oracle和rpm包都在这个目录下

在root用户下执行一下:
cd /home/oracle/oracle-setup/install-lib
alien -i compat-db-4.0.14-5.3.i386.rpm
alien -i compat-gcc-7.3-2.96.128.i386.rpm
alien -i compat-gcc-c++-7.3-2.96.128.i386.rpm
alien -i compat-libstdc++-7.3-2.96.128.i386.rpm
alien -i compat-libstdc++-devel-7.3-2.96.128.i386.rpm
alien -i libaio-0.3.96-7.i386.rpm
alien -i openmotif-2.2.3-5.RHEL3.7.i386.rpm
alien -i setarch-1.3-1.i386.rpm
alien -i gcc-3.2.3-59.i386.rpm

dpkg -l gcc
显示一下gcc包信息,gcc的3.2.3-60版本正式oracle10g需要的版本。
ii gcc 3.2.3-60 Various compilers (C, C++, Objective-C, Java, ...)

1.3.10配置/home/oracle/.bashrc文件
将以下信息加入/home/oracle/.bashrc文件

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
#LD_ASSUME_KERNEL=2.4.1; export LD_ASSUME_KERNEL

if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi


1.3.11退出当前用户,以oracle用户登录

如果是ubuntu安装在虚拟机上,在登录前,最好将内存调整到不小于1G。再看交换分区,最好调整为内存的2倍,调整方法可参考其他网页。
假设oracle10g的安装文件已经被复制到/home/oracle/oracle-setup/database目录,以oracle用户执行
cd /home/oracle/oracle-setup/database
./runInstaller

在需要填写oracle的实例名时,填第10)步设置的“ORACLE_SID=orcl”的orcl,其他按默认选项一步步执行就可以了

1.3.12安装结束前(可根据图片安装)
安装程序提示,用root用户执行下面两个脚本:
1) /u01/app/oracle/oraInventory/orainstRoot.sh
2) /u01/app/oracle/product/10.2.0/db_1/root.sh
执行第二时,提示下面信息,直接按回车键就可以了
Enter the full pathname of the local bin directory: [/usr/local/bin]:
1.4安装中的错误解决
安装过程中还会出现以下错误,以下错误问题的解决才是关键:

1.4.1错误1
错误信息为:
Error in invoking target 'ntcontab.o' of makefile '/u01/app/oracle/product/10.2.0/db_1/network/lib/ins_net_client.mk'. See '/u01/app/oracle/oraInventory/logs/installActions2012-01-27_06-31-17AM.log' for details

INFO: ntcontab.c:7:23:
INFO:
INFO: sys/types.h: No such file or directory

错误信息表示“sys/types.h”文件找不到,实际是编译程序找的位置不对,实际位置在/usr/include/i386-linux-gnu/sys/types.h,修改编译脚本:
打开/u01/app/oracle/product/10.2.0/db_1/network/lib/ins_net_client.mk文件
gedit /u01/app/oracle/product/10.2.0/db_1/network/lib/ins_net_client.mk

解决方案:
在"INSTALL_TARGS=clean $(INSTALL_NET_CLIENT_TARGS)"这行下面添加下面一行:
MY_INCLUDE=-I /usr/include/i386-linux-gnu

将“$(CC) $(CFLAGS_SHIP) -c ntcontab.c ; \”这行,改为下面这一行:
$(CC) $(CFLAGS_SHIP) -c ntcontab.c $(MY_INCLUDE); \

然后按"retry"按钮。

1.4.2错误2
错误信息为:
Error in invoking target 'nnfgt.o' of makefile '/u01/app/oracle/product/10.2.0/db_1/network/lib/ins_net_client.mk'. See '/u01/app/oracle/oraInventory/logs/installActions2012-01-27_06-31-17AM.log' for details.

INFO: ntcontab.c:7:23:
INFO:
INFO: sys/types.h: No such file or directory

解决方案:
这个错误信息与1)中的相同,解决方法类似:
打开/u01/app/oracle/product/10.2.0/db_1/network/lib/ins_net_client.mk文件
gedit /u01/app/oracle/product/10.2.0/db_1/network/lib/ins_net_client.mk

将“$(CC) $(CFLAGS_SHIP) -c nnfgt.c ;\”这行,改为下面这一行:
$(CC) $(CFLAGS_SHIP) -c nnfgt.c $(MY_INCLUDE) ;\

然后按"retry"按钮。

1.4.3错误3
错误信息为:
Error in invoking target 'client_sharedlib' of makefile '/u01/app/oracle/product/10.2.0/db_1/network/lib/ins_net_client.mk'. See '/u01/app/oracle/oraInventory/logs/installActions2012-01-27_06-31-17AM.log' for details.

INFO: /usr/bin/ld: cannot find crti.o: No such file or directory
collect2: ld returned 1 exit status
INFO: genclntsh: Failed to link libclntsh.so.10.1
make: *** [client_sharedlib] Error 1
解决方案:
这是由于链接器在链接时需要/lib/crti.o文件,但位置不对,用root用户执行:
ln -s /usr/lib/i386-linux-gnu/crti.o /lib/crti.o

然后按"retry"按钮。

1.4.4错误4

错误信息为:
Error in invoking target 'client_sharedlib' of makefile '/u01/app/oracle/product/10.2.0/db_1/network/lib/ins_net_client.mk'. See '/u01/app/oracle/oraInventory/logs/installActions2012-01-27_06-31-17AM.log' for details.
INFO: /usr/bin/ld: cannot find crt1.o: No such file or directory
collect2: ld returned 1 exit status

INFO: genclntsh: Failed to link libclntsh.so.10.1
make: *** [client_sharedlib] Error 1
解决方案:
与3)错误类似,这是由于链接器在链接时需要/lib/crt1.o文件,但位置不对,用root用户执行:
解决方案:ln -s /usr/lib/i386-linux-gnu/crt1.o /lib/crt1.o
然后按"retry"按钮。


1.4.5错误5
错误信息为:
Error in invoking target 'client_sharedlib' of makefile '/u01/app/oracle/product/10.2.0/db_1/network/lib/ins_net_client.mk'. See '/u01/app/oracle/oraInventory/logs/installActions2012-01-27_06-31-17AM.log' for details.
Exception Severity: 1
INFO: /usr/bin/ld: cannot find crtn.o: No such file or directory
collect2: ld returned 1 exit status

INFO: genclntsh: Failed to link libclntsh.so.10.1
make: *** [client_sharedlib] Error 1
解决方案:
与3)错误类似,这是由于链接器在链接时需要/lib/crtn.o文件,但位置不对,用root用户执行:
ln -s /usr/lib/i386-linux-gnu/crtn.o /lib/crtn.o

然后按"retry"按钮。
---------------------------------------------------------------------------------

1.4.6错误6
错误信息为:
Error in invoking target 'client_sharedlib' of makefile '/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/ins_rdbms.mk'. See '/u01/app/oraInventory/logs/installActions2012-04-12_07-07-44PM.log' for details.
INFO: /u01/app/oracle/product/11.2.0/db_1/bin/genclntsh
INFO: /usr/bin/ld: cannot find /usr/lib/libpthread_nonshared.a  collect2: ld returned 1 exit status
INFO: genclntsh: Failed to link libclntsh.so.11.1

解决方案:
ln -s /usr/lib/i386-linux-gnu/libpthread_nonshared.a /usr/lib/libpthread_nonshared.a
然后按"retry"按钮。



1.4.7错误7
错误信息为:
Error in invoking target 'client_sharedlib' of makefile '/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/ins_rdbms.mk'. See '/u01/app/oraInventory/logs/installActions2012-04-12_07-07-44PM.log' for details.
INFO: cannot
INFO: find
INFO: /
INFO: usr
INFO: /lib/libc_nonshared.a
collect2: ld returned 1 exit status
INFO: genclntsh: Failed to link libclntsh.so.11.1

解决方案:
ln -s /usr/lib/i386-linux-gnu/libc_nonshared.a /usr/lib/libc_nonshared.a
然后按"retry"按钮。

错误6,7问题 解决网址:http://www.debian-administration.org/articles/656


1.4.8错误8
错误信息为:
Error in invoking target 'agent nmhs' of makefile '/u01/app/oracle/product/11.2.0/db_1/sysman/lib/ins_emagent.mk'. See '/u01/app/oraInventory/logs/installActions2012-04-12_07-07-44PM.log' for details.

INFO: make[1]: Leaving directory `/u01/app/oracle/product/11.2.0/db_1/sysman/lib'
INFO: make[1]: *** [/u01/app/oracle/product/11.2.0/db_1/sysman/lib/emdctl] Error 1
make: *** [emdctl] Error 2
INFO: End output from spawned process.
INFO: Exception thrown from action: make

解决方案:
vi /u01/app/oracle/product/11.2.0/db_1/sysman/lib/sysman/lib/ins_emagent.mk
replace:
$(SYSMANBIN)emdctl:
        $(MK_EMAGENT_NMECTL)
with:
$(SYSMANBIN)emdctl:
        $(MK_EMAGENT_NMECTL) -lnnz11
查询的错误问题的网址
http://blog.arkzoyd.com/2011/11/oracle-database-11g-and-ubuntu-1110.html

然后按"retry"按钮。


1.4.9错误9
错误信息为:
Error in invoking target 'all_no_orcl' of makefile '/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/ins_rdbms.mk'. See '/u01/app/oraInventory/logs/installActions2012-04-12_07-07-44PM.log' for details.
INFO: Creating /u01/app/oracle/product/11.2.0/db_1/lib/liborasdkbase.so.11.1

INFO: gcc: error: /lib/libgcc_s.so.1: No such file or directory
gcc: error: /usr/lib/libstdc++.so.6: No such file or directory
/u01/app/oracle/product/11.2.0/db_1/bin/genorasdksh: Failed to link liborasdkbase.so.11.1

解决方案:
可以通过以下方式找到libgcc_s.so.1文件:
cd /usr/lib
find ./ -name libgcc_s.so.1
./ure/lib/libgcc_s.so.1

可以用/usr/lib/ure/lib/libgcc_s.so.1代替,用root用户执行:
ln -s /usr/lib/ure/lib/libgcc_s.so.1 /lib/libgcc_s.so.1
(和上link 路径不同,不知是哪个,我都使用了,呵呵,需要测试)
ln -s /usr/lib/ure/lib/libgcc_s.so.1 /usr/lib/libgcc_s.so.1
可以通过以下方式找到libstdc++.so.6的替代文件
oracle@ubuntu:/usr/lib$ find ./ -name "libstdc++*"
./ure/lib/libstdc++.so.6

可以用/usr/lib/ure/lib/libstdc++.so.6代替,用root用户执行:
ln -s /usr/lib/ure/lib/libstdc++.so.6 /usr/lib/libstdc++.so.6

然后按"retry"按钮。


后面就没有再报其他错误,可以顺利执行。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics