Linux下安装Oracle

一、环境配置

  1. 创建Oracle用户(命令直接输路径后面的即可,出错在带上路径)

    [root@redhat5 Server]# /usr/sbin/groupadd oinstall

    [root@redhat5 Server]# /usr/sbin/groupadd dba

    [root@redhat5 Server]# /usr/sbin/useradd -g oinstall -G dba oracle

    [root@redhat5 Server]# passwd oracle

  

  2.修改 /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

 

  3.应用配置

     [root@redhat5 Server]# /sbin/sysctl -p

 

   4.修改用户限制,修改 /etc/security/limits.conf 文件,加上下面的参数

    oracle           soft    nproc   2047

    oracle           hard    nproc   16384

    oracle           soft    nofile  1024

    oracle           hard    nofile  65536

 

  5.修改用户验证选项,修改/etc/pam.d/login文件加上如下参数

    32位:session    required     pam_limits.so

    64位:session    required     /lib64/security/pam_limits.so

 

  6.修改用户配置文件,修改/etc/profile文件加入如下参数

    if  [ $USER = "oracle" ];  then

      if  [ $SHELL = "/bin/ksh" ];  then

         ulimit -p 16384

         ulimit -n 65536

      else

         ulimit -u 16384 -n 65536

      fi

    fi

 

  7.安装目录配置

    [root@redhat5 Server]# mkdir -p /u01/

    [root@redhat5 Server]# chown -R oracle:oinstall /u01/

    [root@redhat5 Server]# chmod -R 775 /u01/

 

  8.修改用户.bash_profie,增加以下内容(这一步不做会导致找不到sqlplus,lsnrctl等常用命令),注意:orcl为oracle数据库的实例名。

    export ORACLE_BASE=/u01/app

    export ORACLE_HOME=$ORACLE_BASE/oracle

    export ORACLE_SID=orcl

    export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin

 

  9.启动图形界面安装。

    [root@redhat5 Server]# /tmp/database/runInstaller

    ※如果不能安装,尝试将root用户注销后用oracle用户登录安装。

 

二、安装图解

  1.安全更新取消,下一步

    

 

  2.选择创建和配置数据库

    

 

  3.选择服务器类

    

 

  4.设置全局数据库名和密码

    

 

  5.安装检查,这里一般会缺少一些rpm包,将REDHAT5安装光盘加载到系统,CD到光盘下Server目录,安装Oracle所提示缺少的RPM包。

    

 

  6.安装检查结束后,按照提示下一步就可以进行安装。根据提示以root用户输入二个命令,结束安装。

    [root@redhat5 Server]# cd /u01/app/oracle

    [root@redhat5 Server]# sh  root.sh

    [root@redhat5 Server]# cd /u01/oraInventory

    [root@redhat5 Server]# sh  orainstRoot.sh

 

三.启动oracle

  1.编辑/etc/selinux/config

    注释掉:#SELINUX=enforcing

    追加:SELINUX=disabled

  2.执行

    chcon -t texrel_shlib_t /u01/app/oracle/lib/libclntsh.so.11.1

 

安装可能用到的命令

  修改文件属性:chmod a+r+w filename

  解压文件:unzip zipfile toPath

  切换root用户:su - root

安装可能用到的软件

  传送文件到linux系统:SSH Secure Shell

其它参考:http://www.cnblogs.com/gaojun/archive/2012/11/22/2783257.html

posted @ 2014-04-16 17:11  南丁格尔  阅读(365)  评论(0编辑  收藏  举报