centos7 安装oracle 11g(11.2.0.1)

一、安装前的准备工作

  1. 创建oracle用户属于oinstall、dba组
  2. 创建安装所需的安装目录、数据目录等文件及文件夹,授权oracle用户
     /oracle/oracle                     oracle安装目录
     /oracle/oraInventory            oracle配置文件目录
     /oracle/data                 oracle软件包解压目录   
     
     chown -R  oracle:oinstall  /oracle/* 
  1. 修改系统标识(oracle默认不支持centos系统)
     vi /etc/redhat-release
     before: CentOS Linux release 7.6.1810 (Core)
     after: redhat-7
  1. 修改内核参数
    vim /etc/sysctl.conf
    fs.aio-max-nr = 1048576
    fs.file-max = 6815744
    kernel.shmall = 31457280
    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
    
    sysctl -p 使其生效
  1. 对oracle用户设置限制,提高软件运行性能
    vim /etc/security/limits.conf
    oracle           soft    nproc           2047
    oracle           hard    nproc          16384
    oracle           soft    nofile           1024
    oracle           hard    nofile          65536
    
    使其生效:
    vim /etc/pam.d/login
    
    session required pam_limits.so
    
    vim /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
  1. 配置环境变量
    export ORACLE_BASE=/usr/local/oracle               #oracle安装目录
    export ORACLE_HOME=$ORACLE_BASE/database/dbhome_1
    export ORACLE_SID=orcl
    export ORACLE_TERM=xterm
    export TNS_ADMIN=$ORACLE_HOME/network/admin
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

    export LANG=C
    export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

    export PATH=$ORACLE_HOME/bin:$PATH
  1. 下载安装包,并使用oracle用户解压
    unzip linux.x64_11gR2_database_1of2.zip -d ./data/
    unzip linux.x64_11gR2_database_2of2.zip -d ./data/
  1. shell下选择静默安装,先编辑response/db_install.rsp
  2. 运行安装脚本
  ./runInstaller -silent -force -ignorePrereq -responseFile ./database/response/db_install.rsp
  
  prolems:
  1. Email Address Not Specified
     solution: DECLINE_SECURITY_UPDATES=true
  2. The operating system group specified for central inventory (oraInventory) ownership is invalid.
     solution:recreate user oracle
                 user del oracle
                 useradd  -g oinstall -G dba -d /home/oralce -r oracle
  3. User is not a member of the following chosen OS groups
    solution:  oracle.install.db.DBA_GROUP=dba
                 oracle.install.db.OPER_GROUP=oinstall
  4. [INS-10008]Session initialization failed
    solution:  touch file : /etc/oraInst.loc
                inventory_loc=/usr/local/oracle/oraInventory
                inst_group=oinstall
  1. root用户在$ORCALE_HOME下执行生成的root.sh脚本
  2. 配置监听
    netca /silent /responseFile ./database/response/netca.rsp 
  1. use command
    lsnrctl status               ##查看监听状态
    sqlplus / as sysdba       ##以管理员方式登录(需在oracle用户下操作)
    dbstart   dbshut

你可能感兴趣的:(Linux,oracle)