一、确认以下组件和程序安装成功。

[root@localhost ~]# rpm -q make
make-3.81-3.el5
[root@localhost ~]# rpm -q binutils
binutils-2.17.50.0.6-9.el5
[root@localhost ~]# rpm -qv openmotif
openmotif-2.3.1-2.el5
[root@localhost ~]# rpm -q setarch
setarch-2.0-1.1
[root@localhost ~]# rpm -qa | grep compat
compat-libstdc++-296-2.96-138
compat-gcc-34-c++-3.4.6-4
java-1.4.2-gcj-compat-src-1.4.2.0-40jpp.115
avahi-compat-libdns_sd-0.6.16-1.el5
compat-libgcc-296-2.96-138
compat-libf2c-34-3.4.6-4
geronimo-specs-compat-1.0-0.M2.2jpp.12
compat-glibc-headers-2.3.4-2.26
compat-libstdc++-33-3.2.3-61
compat-glibc-2.3.4-2.26
compat-libcom_err-1.0-7
java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
java-1.4.2-gcj-compat-devel-1.4.2.0-40jpp.115
compat-gcc-34-3.4.6-4
compat-gcc-34-g77-3.4.6-4
以上组件都安装上以后,后面的就可以继续了。

二、修改oracle的内核参数。
[root@localhost ~]# vim /etc/sysctl.conf
添加或修改原值成以下6行:
kernel.core_uses_pid = 1
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65535
net.ipv4.ip_local_port_range = 1024 65000

[root@localhost ~]# sysctl -p 输出显示当前设置。
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65535
net.ipv4.ip_local_port_range = 1024 65000

三、增加操作系统用户的 nofile、nproc 参数

[root@localhost ~]# vim /etc/security/limits.conf
# /etc/security/limits.conf
(添加以下几条限制)
# nofile:操作系统用户可以同时打开的最大文件数
# 单个用户同时可以打开的进程数

*       soft    nproc   65536
*       hard    nproc   65536
*       soft    nofile  65536
*       hard    nofile  65536

# End of file

[root@localhost ~]# vim /etc/pam.d/login
#在最后添加一下一条规则
session    required     pam_limits.so

四、创建用户、用户组
oracle用户、dba组、oinstall组

[root@localhost ~]# groupadd oinstall
[root@localhost ~]# groupadd dba
[root@localhost ~]# useradd -g oinstall -G dba oracle
[root@localhost ~]# passwd oracle
Changing password for user oracle.
New UNIX password: 
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password: 
passwd: all authentication tokens updated successfully.
[root@localhost ~]# 

五、设置oracle用户的环境变量

[root@localhost ~]# su - oracle
[oracle@localhost ~]$ vim .bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=ora10g
export PATH=$PATH:$HOME/BIN:$ORACLE_HOME/bin

六、建立需要的目录、设置正确的权限

[root@localhost ~]# cd /
[root@localhost /]# mkdir -p /u01/app/oracle
[root@localhost /]# chown -R oracle:oinstall /u01
[root@localhost /]# ll /u01
total 4
drwxr-xr-x 3 oracle oinstall 4096 Nov 23 23:02 app
[root@localhost /]# 

七、在linux的图形界面下,开一个terminal窗口,运行以下命令。

[root@localhost ~]# export DISPLAY=:0.0
[root@localhost ~]# xhost+
bash: xhost+: command not found
[root@localhost ~]# xhost +
access control disabled, clients can connect from any host

八、安装软件

[root@localhost ~]# su - oracle
[oracle@localhost ~]$ cd /u01/database/
[oracle@localhost database]$ ls
doc  install  response  runInstaller  stage  welcome.html

[oracle@localhost database]$ vim install/oraparam.ini 
#在下面这个栏目添加RHEL5的支持,因为10g只支持到RHEL4,只要添加一条redhat-5 就行了
[Certified Versions]
Linux=redhat-3,SuSE-9,redhat-4,redhat-5,UnitedLinux-1.0,asianux-1,asianux-2

[oracle@localhost database]$ ls
doc  install  response  runInstaller  stage  welcome.html
[oracle@localhost database]$ ./runInstaller 
Starting Oracle Universal Installer...

Checking installer requirements...

Checking operating system version: must be redhat-3, SuSE-9, redhat-4, redhat-5, UnitedLinux-1.0, asianux-1 or asianux-2
                                      Passed


All installer requirements met.

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2009-11-23_11-41-42PM. Please wait ...[oracle@localhost database]$ 



这里会报错是应为前边的设置有问题,是因为oracle对内存等会自动检查,然后告诉我们哪里设置的不合理。不正确,只要把下边的提示信息看一遍,找到warning的,再修改配置文件就可以了。下面就是我按照提示修改配置的情况。
=============================
根据错误提示将内核参数调整到指定的值
=============================
1  checking kernel parameters Automatic Warning
2  Checking physical memory requirements ... Automatic Warning
3  Checking Network Configuration requirements ... Automatic Not executed
=============================
1  checking kernel parameters Automatic Warning
Checking for file-max=65536; found file-max=65535.      Failed <<<<
Checking for rmem_default=262144; found rmem_default=109568.    Failed <<<<
Checking for rmem_max=262144; found rmem_max=131071.    Failed <<<<
Checking for wmem_default=262144; found wmem_default=109568.    Failed <<<<
Checking for wmem_max=262144; found wmem_max=131071.    Failed <<<<
=============================
2  Checking physical memory requirements ... Automatic Warning
Checking for file-max=65536; found file-max=65535.      Failed <<<<
Checking for rmem_default=262144; found rmem_default=109568.    Failed <<<<
Checking for rmem_max=262144; found rmem_max=131071.    Failed <<<<
Checking for wmem_default=262144; found wmem_default=109568.    Failed <<<<
Checking for wmem_max=262144; found wmem_max=131071.    Failed <<<<
=============================
3  Checking Network Configuration requirements ... Automatic Not executed
Check complete. The overall result of this check is: Not executed <<<<
Recommendation: Oracle supports installations on systems with DHCP-assigned public IP addresses.  However, the primary network interface on the system should be configured with a static IP address in order for the Oracle Software to function properly.  See the Installation Guide for more details on installing the software on systems configured with DHCP.
=============================
按照上边的提醒调整内核参数
[root@localhost ~]# vim /etc/sysctl.conf
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
kernel.sysrq = 0
kernel.core_uses_pid = 1

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
==============================








[root@localhost oracle]# /u01/app/oracle/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oracle/oraInventory to 770.
Changing groupname of /u01/app/oracle/oraInventory to oinstall.
The execution of the script is complete
[root@localhost oracle]# /u01/app/oracle/product/10.2.0/db_1/root.sh
Running Oracle10 root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/10.2.0/db_1

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.
[root@localhost oracle]#