在Linux环境下安装Oracle Database 11g

(1)操作系统环境
Oracle Enterprise Linux 5, and Red Hat Enterprise Linux 5

(2)相关包检查,检查命令格式如下:rpm -qa | grep 名字
rpm -qa | grep binutils-2.17.50.0.6
rpm -qa | grep compat-libstdc++-33-3.2.3 
rpm -qa | grep elfutils-libelf-0.125
rpm -qa | grep elfutils-libelf-devel-0.125 
rpm -qa | grep elfutils-libelf-devel-static-0.125 
rpm -qa | grep gcc-4.1.2  
rpm -qa | grep gcc-c++-4.1.2
rpm -qa | grep glibc-2.5-24
rpm -qa | grep glibc-common-2.5        
rpm -qa | grep glibc-devel-2.5
rpm -qa | grep glibc-headers-2.5
rpm -qa | grep kernel-headers-2.6.18
rpm -qa | grep ksh-20060214 
rpm -qa | grep libaio-0.3.106
rpm -qa | grep libaio-devel-0.3.106 
rpm -qa | grep libgcc-4.1.2
rpm -qa | grep libgomp-4.1.2
rpm -qa | grep libstdc++-4.1.2        
rpm -qa | grep libstdc++-devel-4.1.2  
rpm -qa | grep make-3.81
rpm -qa | grep numactl-devel-0.9.8.i386  
rpm -qa | grep sysstat-7.0.2
rpm -qa | grep unixODBC-2.2.11 
rpm -qa | grep unixODBC-devel-2.2.11 

从 CentOS-5.5-i386-bin-DVD.iso\CentOS 文件找到缺少的包, 并且上传
ls *.rpm
rpm -ivh *.rpm

(3)安装前准备,设置,修改环境变量等
#增加组和用户 groupadd oinstall
groupadd dba
mkdir -p /u01/oracle  //创建用户跟目录
#添加一个oracle用户, 根目录是 /u01/oracle, 主的组是 oinstall 副的组是dba
useradd -g oinstall -G dba -d /u01/oracle oracle
#为oracle用户设置密码 123456
passwd oracle

##拷贝必要的文件
cp /etc/skel/.bash_profile /u01/oracle
cp /etc/skel/.bashrc /u01/oracle
cp /etc/skel/.bash_logout /u01/oracle

##把/u01划给oracle
chown -R oracle:oinstall /u01/oracle


#检查 nobody 是否存在
id nobody
#缺省存在的。如果不存在 
/usr/sbin/useradd -g nobody

#相关系统设定
vi /etc/sysctl.conf

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586


vi /etc/security/limits.conf

oracle           soft    nproc   2047
oracle           hard    nproc   16384
oracle           soft    nofile  1024
oracle           hard    nofile  65536


vi /etc/pam.d/login 

session    required     pam_limits.so
=================================================

#设置oracle 用户环境变量
su - oracle
#进入oracle主目录
cd /u01/oracle

vi .bash_profile
export ORACLE_BASE=/u01
export ORACLE_HOME=$ORACLE_BASE/oracle
export ORACLE_SID=orcl
export NLS_LANG="american_america.UTF8"
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin

#oracle网站下载oracle for linux 11g
unzip linux_11gR2_database_1of2.zip
mv database /u01/
cd /u01
su
chown -R oracle:oinstall database/

修改配置比较多东西, 重启一下系统。