环境:centos5.5系统 64位
vmware平台 2G内存  静态固定ip一个
一、安装需要的环境包
1.更新yum源
   yum -y install yum-fastestmirror
2.安装环境包
   yum -yt groupinstall "Developement Tools" "Development Libraries"
   yum install compat-libstdc++ control-center compat-libstdc++ compat-libstdc gcc gcc-c++ glibc glibc-common libstdc++        libstdc++-devel libXp make ksh sysstat setarch compat-libstdc++-33.x86_64
 
二、修改配置文件
1.修改内核参数/etc/sysctl.conf,添加一下内容
    vim /etc/sysctl.conf
    kernel.shmall = 2097152  ##为共享内存一般为默认8G 公式:2097152*4/1024/1024/1024=8G
    sharemem limits to 8G
    kernel.shmmax = 1073741824  ##该参数数值为物理内存的一半,单位b  公式:1073741824/1024/1024/1024=1G
    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.wmem_default = 262144
    net.core.rmem_max = 262144
    net.core.wmem_max = 262144
    执行sysctl -p 让内核参数生效
2.设置调用shell限制vim /etc/security/limits.conf添加如下内容
    oracle soft nproc 2047
    oracle hard nproc 16384
    oracle soft nofile 1024
    oracle hard nofile 65536
3.修改pam配置文件
    vim /etc/pam.d/login
    session required /lib/security/pam_limits.so
 
三、准备安装路径与环境
1.创建用户与用户组
    groupadd oinstall
    groupadd dba
    useradd -g oinstall -G dba -d /home/oracle -m -r oracle
     passwd orcale --stdin
     123.com
2.修改orcale用户bash环境变量
    su - oracle
    vim .bash_profile在里面加入一下内容
    ##########  Add the following a few lines   ##########
    ORACLE_BASE=/jc1/oracle
    ORACLE_HOME=/jc1/oracle/product/10.2.0/db_1
    ORACLE_SID=test                           ##sid号自定义
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:.
    PATH=$PATH:$ORACLE_HOME/bin:.
    export NLS_LANG=American_america.ZHS16GBK
    export PATH
    export ORACLE_BASE ORACLE_SID ORACLE_HOME LD_LIBRARY_PATH
3.配置静态ip地址并修改host文件
    su - root
    vim /etc/hosts
     192.168.130.27  localhost.com   localhost   ##注意格式.com很重要,否则在安装的时候会报错   
4.修改linux的版本信息
    vim /etc/redhat-release修改为以下
    CentOS release 5.5 (Final) to redhat 4  ##因为orcale只支持到RH4为止
5.创建oracle数据库安装的路径并设置权限
    mkdir /jc1
    mkdir /jc2
    mkdir /jc2/software
    cd /jc2/software
    将下载下来的数据包放在software里并解压
    gunzip 10201_database_linux_x86_64.cpio.gz
    cpio -id <  10201_database_linux_x86_64.cpio
    给文件路径设置权限
    chmod -R 775 /jc{1,2}
    chown -R oracle:oinstall  /jc{1,2}
四、数据库的安装
1.注销root用户并用oracle登录并执行安装脚本
    cd /jc2/software/database
    ./runInstaller
2.跳出图形界面开始安装,一路按照需求安装数据库。从中有可能会遇到环境检测中的一些报错。可以总结为一下的几点
Checking Network Configuration requirements ...
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
这问题只要你设置了/etc/hosts基本就不会出现,注意格式
-------------------------------------------------------------------------------------------------------------
INFO: make: *** [extproc32] Error 2
Exception String: Error in invoking target 'all_no_orcl ipc_g' of makefile '/home1/oracle/product/10.2.0/db_1/rdbms/lib/ins_rdbms.mk'. See '/home1/oracle/oraInventory/logs/installActions2008-02-26_05-27-25PM.log' for details.
这问题说明你缺少了一个64位系统compat-libstdc++-33.x86_64包,yum -y install compat-libstdc++-33.x86_64
 
3.直到提示需要root权限执行两个脚本

图片

切换到到root身份执行一下命令

    su root

    /jc1/oracle/oralnventory/orainstrRoot.sh

    /jc1/oracle/product/10.2.0/root.sh