---
title: "linux 安装oracle10g"
author: "zhouxingfu520"
date: "2013-02-27T16:43:03Z"
tags: []
categories: ["操作系统"]
slug: "linux-oracle10g"
draft: false
lastmod: "2013-06-17T17:20:04Z"
id: 1816752
url: "https://zhoualine.iteye.com/blog/1816752"
---

**一.基本配置**  

（1）硬盘剩余空间：10G以上  
    虽然Oracle 10g的安装文件只有800多MB，但安装后的oracle+oraInventory目录会用差不多4G空间，再加上安装时Oracle生成的临时文件（/tmp目录需要至少400MB）。  
（2）内存1.5G以上  
    官方文档说512M内存也可以安装。为了避免不必要的麻烦，请把内存加多一些。  
（3）Swap交换区2G

**二.CenOS6 上安装Oracle 10g**

1.安装Oracle 10g

【1】准备安装  
在安装Oracle之前执行以下命令：  
yum install yum-fastestmirror -y  
yum install compat-db*  
yum install compat-libc*  
yum install compat-gcc*  
yum install libXp.so.6  
yum install libc-*  
yum install libaio*  
yum install openmotif  
yum install glibc-devel*  
yum install libgcc*  
yum install gnome-lib*

【2】安装包解压

**\[root@localhost ~]# cpio -idmv** **&gt;** **10201\_database\_linux\_x86\_64.cpio**

【3】创建 Oracle 组和用户帐户  
创建用于安装和维护Oracle 10g 软件的账户。用户帐户将称为oracle，而组将称为oracleinstall和oracle。以root用户身份执行以下命令:

**\[root@localhost ~]# groupadd oracleinstall**

**\[root@localhost ~]#** **groupadd oracle**

**\[root@localhost ~]#** **useradd -m -g oracleinstall-G oracle oracle**

**\[root@localhost ~]#** **id oracle**

uid=501(oracle) gid=501(oracleinstall) groups=501(oracleinstall),502(oracle)

设置oracle帐户的口令

**\[root@localhost ~]# passwd** **oracle**

Changing password for user oracle.  
New password:  
Retype new password:passwd:all authentication tokens updated successfully.

【4】创建目录  
创建Oracle 10g及其数据库文件的目录，以root用户身份执行以下命令：

**\[root@localhost ~]#** **mkdir -p /oracledata/oracle**

**\[root@localhost ~]# mkdir -p /oracledata/oradata**

**\[root@localhost ~]# chown -R oracle:oracleinstall /oracledata/oracle  /oracledata/oradata**

**\[root@localhost ~]# chmod -R 775 /oracledata/oracle  /oracledata/oradata**

 

【5】修改内核参数  
安装Oracle 10g需修改内核参数，否则安装检测时会报Failed，甚至导致安装时出现Error。以root身份执行以下命令：

cat &gt;&gt; /etc/sysctl.conf &lt;&lt;EOF  
kernel.shmall = 2097152  
kernel.shmmax = 2147483648  
kernel.shmmni = 4096  
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  
EOF

如果检查没有问题后，即可以开始装Oralce 10g。

【6】安装Oracle 10g  
（1）先以oracle用户身份登陆XWindow。因为oracle安装会弹出界面让你配置，如果使用putty登陆安装的话，你是没有办法操作弹出框的，所以一定要登录XWindow，然后在Terminal里启动安装程序。

（2）如果你的系统语言为中文，请把他设置为英文，否则安装的时候会出现乱码。

（3）Terminal中启动Oracle 10g安装程序：

\[oracle@www/]$ **./Oracle/database/runInstaller**

 

如果一切正常，界面会弹出如下对话框：

 

如果在Terminal启动runInstaller时遇到“Checking operating system version: must be redhat-2.1, redhat-3, SuSE-9, SuSE-8 or UnitedLinux-1.0 Failed ”这种问题，表明oracle不能识别你的系统内核，这个问题可以通过修改内核配置文件解决，如下：

cat &gt; /etc/redhat-release &lt;&lt; EOF  
Red Hat Enterprise Linux AS release 3 (Taroon)  
EOF

（4）Oracle 10g安装配置  
修改Oralce Home Localtion，填写database password后，按“Next”。如图：

![](http://dl.iteye.com/upload/picture/pic/123599/ab6efc2b-b91c-39d7-b532-bc81a77c133f.jpg)

 

 

（5）数据库配置  
修改Inventory directory，Specify Operating System group name选：oracleinstall，然后“Next”，如图：

![](http://dl.iteye.com/upload/picture/pic/123601/a72da68f-fdbb-3ad5-8e96-e1af58fabbc7.jpg)

 

（6）Oracle安装前检查  
检查一下有什么不符合安装要求，看是否需要修改配置，如果按照上面步骤下来，这里的warning应该为0，然后“Next”。如果有警告可以搜下是什么问题。

![](http://dl.iteye.com/upload/picture/pic/123603/c6855ced-6566-3ed3-b90a-19dc40b27068.jpg)

 

（7）Install Oracle 10g  
直接按“Install”。![](http://dl.iteye.com/upload/picture/pic/123605/f2f5e1c6-de0c-3a10-9853-22d3b2db6da2.jpg)

 

 

（8）Installing...

![](http://dl.iteye.com/upload/picture/pic/123607/16b1cce8-3c40-39d3-9ced-6b9bccd32447.jpg)

 

（9）Configuration Assistant

 

在软件安装完成之后，会自动进行Configuration Assistant的配置。

![](http://dl.iteye.com/upload/picture/pic/123609/970191e5-0c92-3c28-bed9-466cc81d148b.jpg)

 

（10）以root权限运行脚本  
当iSQL\*Plus Configuration Assistant配置完成时，会弹出一下框，里面有两个Srcipt需要你用root权限运行。

在Terminel中以root权限执行以上两个脚本:

\[root@www oradata]# **./orainstRoot.sh**  
Changing permissions of /oracledata/oradata to 770.  
Changing groupname of /oracledata/oradata to oracleinstall.  
The execution of the script is complete  
\[root@www oracle]# **./root.sh**  
Running Oracle10 root.sh script...

The following environment variables are set as:  
    ORACLE\_OWNER= oracle  
    ORACLE\_HOME=  /oracledata/oracle

Enter the full pathname of the local bin directory: \[/usr/local/bin]:  
   Copying dbhome to /usr/local/bin ...  
   Copying oraenv to /usr/local/bin ...  
   Copying coraenv to /usr/local/bin ...

Creating /etc/oratab file...  
Entries will be added to the /etc/oratab file as needed by  
Database Configuration Assistant when a database is created  
Finished running generic part of root.sh script.  
Now product-specific root actions will be performed.

 

 

然后按界面中的“OK”。

 

（11）Oracle 10g安装完成

      按“Exit”退出安装。

 

 

![](http://dl.iteye.com/upload/picture/pic/123611/be98585e-3d92-31c2-a679-7e70d16c4a3a.jpg)

 

 

**三.总结**

    安装Oracle 10g可能会报出各种各样的Warnning/Error，这多数是系统缺少某些包导致的，如果把“准备安装”中的提到的包都装了，这类的问题应该基本上解决了。然后就是硬盘空间问题，每次Oracle安装都会在/tmp下生成400MB左右的临时文件，我以前第一次安装也弄了几天。