日期:2014-05-16  浏览次数:20349 次

Ubuntu 下安装 oracle

Oracle 11 的下载地址:http://www.oracle.com/technology/software/products/database/oracle11g/111060_linuxsoft.html

在Ubuntu 8.04 LTS上顺利安装Oracle 11G.下面说说大概的步骤.

(
?first , let root login , to do this:
sudo passwd root
System->Adminstrator->Login Window -> Security -> allow local system administrator login? Checked!

newsea.
)
?

1.确保安装了以下程序:

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

(mybe return a error code ,but can continu ; newsea. )

2.

cd /bin
ln -sf bash /bin/sh

3.增加用户和组

addgroup oinstall
addgroup dba
addgroup nobody
useradd -g oinstall -G dba -p passwd -d /home/oracle -s /bin/bash oracle
usermod -g nobody nobody

4.
mkdir /home/oracle
chown -R oracle:dba /home/oracle

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

5.
mkdir /etc/rc.d
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

mkdir -p /opt/ora11
chown -R oracle:dba /opt

6.编辑/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

7.编辑/etc/security/limits.conf,增加以下内容:

oracle soft nproc 2047
oracle hard nproc 16383
oracle soft nofile 1023
oracle hard nofile 65535

8.编辑/etc/pam.d/login,增加以下内容:

session required /lib/security/pam_limits.so
session required pam_limits.so

9.执行:

sysctl -p

10.

su - oracle

以上命令需以root用户执行,接下来切换至oracle用户.

11.切换至安装目录,开始安装.我选择了英语作为安装时显示的语言.

export LANG=en_CN
./runInstaller

(
出错:Exception in thread "main" java.lang.InternalError:can't connect to x11 window server using "localhost:0.0" at
解决 : sudo xhost +
如果显示值不正确,把 系统 ->系统管理 ->登录窗口->远程->样式: 与本地相同。export DISPLAY = 127.0.0.1:0.0 (觉着这一步最管事。) 即可 。
newsea.

)
(
选 高级,路径用默认:/home/oracle/oraInventory ,指定组名 dba , 企业版? , 自定义, OracleBase:/home/oracle/app/oracle, Oracle Name : OraDb11g_home1 , Oracle Path : /home/oracle/app/oracle/product/11.1.0/db_1 ,全选, 全选,默认选中 OSDBA Group : dba , osoper group : oinstall , osasm group :oinstall , 选中 create database ,。net configuration assistant : default check, LISTENER ,TCP ,1521 。 Database configureation assistant :
customer, golbal database name : orcl ,SID: orcl , password: 选同样的密码: newsea . 以后默认选: file system , 内存自定义: 160 + 30 .
)
12.安装过程中提示运行以下两个脚本:

orainstRoot.sh
root.sh

12.安装过程中检测到系统未装有GLIBC环境,忽略后,未发现对安装和运行有多大影响.

13.切记,安装时选择自定义,并且选择数据库的字符集为 ZHS16GBK!

因为忘记了这个选项,我只好删掉数据库,重新建了一个,浪费了半个小时的时间.

PS.ORACLE 11g好像不支持更改数据库的字符集了...或是我没有找到正确的方法

14.安装完成后,数据库的连接和查询异常之慢,GOOGLE之,然后尝试着把网络的DNS服务器全给删了,解决.

15.两个常用的工具:dbca和netca.

原文:http://www.linuxidc.com/Linux/2008-06/13855.htm

?

?

------------------------------

后记

Oracle 11.2 安装界面与 11.1 不同, 但步骤大同小异.

可以在普通用户下安装 . 而不 一定非要建 oracle? 帐号.http://meteoren.iteye.com/blog/640894 , 我建了oracle 帐号, 把我的帐号添加到了 oinstall ,dba 组 (用 Kuser ),但是在普通帐号上安装的数据库软件(