linux下安装oracle 10g 的艰难之旅(上)

来源:互联网 发布:下载高品质音乐的软件 编辑:程序博客网 时间:2024/05/21 10:14

很多学生,或者以就业人士还是对linux的安装,存有疑虑,现在我再次把我的一些文档整理出来,留给大家分享!

oracle 11g 数据库虽然提供了linux x86的版本,但是支持的linux版本只有Red Hat,Novell and Solaris 这几个,debian 和 ubuntu 不在支持之列,所以在ubuntu下安装就相对麻烦一些,请照着下文的方法一步一步的安装,不要急躁,每一步都要认真作(我开始装的时候就是有点急,用自 己的方法简化了其中几步,结果。。。。安装失败-_-b )。

我的系统:ubuntu 8.04 desktop (32位) 内存:896M (本来是1G, 分了128M给显卡)
本文是"Installing Oracle 11g on Ubuntu 8.04 LTS (Hardy Heron)"文章翻译和注解,是一个外国牛人写的,原文:
http://www.pythian.com/blogs/968/installing-oracle-11g-on-ubuntu-804-lts-hardy-heron
如果不愿意看E文的可以看我下面的翻译:黑字是原文翻译, 红字是我的注解蓝色为终端输入输出
(转载注明出处: )
共9步:
Step 1
下载和安装 Ubuntu 8.04 Hardy Heron (x86-32位) 版。略。
Step 2
下载Oracle 11g: Download Oracle 11g for Linux (x86, 32-bit).
现不要急着解压,一会我会告诉你解压在哪的。
Step 3
修改X server 的默认设置,点菜单的System -> Administration -> Login Window(系统->管理->登录窗口),选择“Security(安全)”选项卡,取消“Deny TCP connections to the Xserver(拒绝TCP连接到X服务器)”的勾,重启Xserver(或者重启系统)。然后在终端输入:

user@hardy:~$ xhost +127.0.0.1

127.0.0.1 being added to access control listStep 4
打开终端,转换为超级用户:(注意,这里用sudo su -而不是sudo -s是有原因的:sudo su - 将用户转换为超级用户,并新起一个会话(空的会话),而不是像sudo -s那样将当前会话传递个新的超级用户,减少环境变量可能造成的影响和危害。

user@hardy:~$ sudo su -

[sudo] password for user:

root@hardy:~# apt-get update

...

root@hardy:~# apt-get dist-upgrade

...

root@hardy:~# reboot

Step 5
用apt安装一些必要的工具:

user@hardy:~$ sudo su -

[sudo] password for user:

root@hardy:~# apt-get install build-essential libaio1 gawk ksh libmotif3 alien libtool lsb-rpm

...

root@hardy:~#

Step 6
在装完那些工具以后,我们需要做的就是修改一些Ubuntu的/bin/sh的默认连接,千万不要略过这一步,否则安装的时候会出现很多错误。

root@hardy:~# cd /bin
root@hardy:/bin# ls -l /bin/sh
lrwxrwxrwx 1 root root 4 2008-04-28 19:59 /bin/sh -> dash
root@hardy:/bin# ln -sf bash /bin/sh
root@hardy:/bin# ls -l /bin/sh
lrwxrwxrwx 1 root root 4 2008-05-01 22:51 /bin/sh -> bash

如果你想知道为什么Ubuntu用dash作为默认的shell,看这个:a detailed explanation of why dash is the default system shell

Step 7
增加用户和组,并修改一些配置。这一步很重要!如果不是很有把握,不要随便改。(为了便于解释,增加了行号):

01 root@hardy:/bin# cd

02 root@hardy:~# pwd

   /root

04 root@hardy:~# addgroup oinstall

   Adding group `oinstall' (GID 1001) ...

   Done.

07 root@hardy:~# addgroup dba

   Adding group `dba' (GID 1002) ...

   Done.

10 root@hardy:~# addgroup nobody

   Adding group `nobody' (GID 1003) ...

   Done.

13 root@hardy:~# usermod -g nobody nobody

14 root@hardy:~# useradd -g oinstall -G dba -p password -d /home/oracle -s /bin/bash oracle

15 root@hardy:~# passwd -l oracle

   Password changed.

17 root@hardy:~# mkdir /home/oracle

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

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

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

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

22 root@hardy:~# mkdir /etc/rc.d

23 root@hardy:~# for i in 0 1 2 3 4 5 6 S ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done

24 root@hardy:~# mkdir -p /u01/app/oracle

25 root@hardy:~# chown -R oracle:dba /u01

26 root@hardy:~#

· Lines 04-12: 增加我们需要的用户和组

· Line 13: 让nobody用户的组变为nobody,这样Oracle的安装程序不会出问题。Ubuntu默认nobody的组是nogroup。

· Lines 14-18: 创建一个oracle用户,并锁定用户,以阻止别人通过oracle用户登录系统。注意,oracle用户的HOME目录不要与ORACLE_HOME相同。

· Lines 19-23: 创建一些Oracle安装程序需要的工具的连接。因为Oracle安装程序是为Red Hat准备的,所以有些工具的位置和Ubuntu不一样。

· Finally, on lines 24-25 创建ORACLE_BASE目录。

Step 8
修改一些系统默认值。这些修改将会增加系统文件描述符的数量、增加共享内存大小和修改一些网络子系统参数。这些修改是否会对你的系统带来影响我就不得而知了。将下面这些增加到/etc/sysctl.conf文件的末尾:

fs.file-max = 65535

kernel.shmall = 2097152

kernel.shmmax = 2147483648

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.ipv4.ip_local_port_range = 1024 65535

net.core.rmem_default = 1048576

net.core.rmem_max = 1048576

net.core.wmem_default = 262144

net.core.wmem_max = 262144

再增加下面这些到/etc/security/limits.conf文件末尾:

oracle soft nproc 2047

oracle hard nproc 16383

oracle soft nofile 1023

oracle hard nofile 65535