关闭

在CentOS7中安装Oracle 11g

标签: oraclecentos
123人阅读 评论(0) 收藏 举报
分类:

本教程适合进行汇文系统的准备

  1. 下载 Oracle 11g的安装文件备用(2个zip文件)
  2. 安装所必须的软件包
    binutils
    compat-libcap1
    compat-libstdc++-33.i686
    compat-libstdc++-33.x86_64
    gcc
    gcc-c++
    glibc.i686 
    glibc.x86_64 
    glibc-devel.i686 
    glibc-devel.x86_64 
    ksh
    libaio.i686 
    libaio.x86_64 
    libaio-devel.i686 
    libaio-devel.x86_64 
    libgcc.i686 
    libgcc.x86_64 
    libstdc++.i686 
    libstdc++.x86_64 
    libstdc++-devel.i686 
    libstdc++-devel.x86_64 
    libXi.i686 
    libXi.x86_64 
    libXtst.i686 
    libXtst.x86_64 
    pam
    make
    sysstat
    unixODBC
  3. 创建必须的组与用户
    # groupadd oinstall
    # groupadd dba
    # useradd -g oinstall -G dba oracle
  4. 修改系统配置文件,添加关于内核的参数
    # cat /usr/lib/sysctl.d/oradb.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 = 1048576
    
    # cat /etc/security/limits.d/oradb.conf
    oracle soft nproc 2047
    oracle hard nproc 16384
    oracle soft nofile 1024
    oracle hard nofile 65536
    oracle soft stack  10240
  5. 创建必须的目录
    # mkdir -p /u01/app/
    # chown -R oracle:oinstall /u01/app/
    # chmod -R 775 /u01/app/
  6. 创建oracle响应文件用于静默安装
    将oracle安装文件解压到 /home/oracle/database 下
    $ cat /home/oracle/database/response/libsys.rsp
    oracle.install.option=INSTALL_DB_AND_CONFIG
    UNIX_GROUP_NAME=oinstall
    INVENTORY_LOCATION=/u01/app/oraInventory
    SELECTED_LANGUAGES=en,fr,es,de,it,zh_CN,zh_TW
    ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
    ORACLE_BASE=/u01/app/oracle
    oracle.install.db.InstallEdition=EE
    oracle.install.db.DBA_GROUP=dba
    oracle.install.db.OPER_GROUP=oinstall
    oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
    oracle.install.db.config.starterdb.globalDBName=orcl
    oracle.install.db.config.starterdb.SID=orcl
    oracle.install.db.config.starterdb.characterSet=ZHS16GBK
    oracle.install.db.config.starterdb.memoryLimit=512
    oracle.install.db.config.starterdb.password.ALL=XXXXxxxx
    oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE
    oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/home/oracle/oradata
    SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
    DECLINE_SECURITY_UPDATES=true
  7. 静默安装oracle
    $ ./runInstaller -silent -responseFile /home/oracle/database/response/libsys.rsp
  8. 等待提示完成,运行指示的脚本
  9. 创建 systemd service 文件,并设置开机即启动

    $ cat /home/oracle/scripts/startup.sh
    ===== CUT HERE =====
    #!/bin/bash
    
    export TMP=/tmp
    export TMPDIR=$TMP
    export PATH=/usr/sbin:/usr/local/bin:$PATH
    
    export ORACLE_SID=orcl
    ORAENV_ASK=NO
    . oraenv
    ORAENV_ASK=YES
    
    # Start Listener
    lsnrctl start
    
    # Start Database
    sqlplus / as sysdba << EOF
    STARTUP;
    EXIT;
    EOF
    ===== CUT HERE =====
    
    $ cat /home/oracle/scripts/shutdown.sh
    ===== CUT HERE =====
    #!/bin/bash
    
    export TMP=/tmp
    export TMPDIR=$TMP
    export PATH=/usr/sbin:/usr/local/bin:$PATH
    
    export ORACLE_SID=orcl
    ORAENV_ASK=NO
    . oraenv
    ORAENV_ASK=YES
    
    # Stop Database
    sqlplus / as sysdba << EOF
    SHUTDOWN IMMEDIATE;
    EXIT;
    EOF
    
    # Stop Listener
    lsnrctl stop
    ===== CUT HERE =====
    
    
    # cat /usr/lib/systemd/system/dbora.service
    ===== CUT HERE =====
    [Unit]
    Description=The Oracle Database Service
    After=syslog.target network.target
    
    [Service]
    # systemd ignores PAM limits, so set any necessary limits in the service.
    # Not really a bug, but a feature.
    # https://bugzilla.redhat.com/show_bug.cgi?id=754285
    LimitMEMLOCK=infinity
    LimitNOFILE=65535
    
    #Type=simple
    # idle: similar to simple, the actual execution of the service binary is delayed
    #       until all jobs are finished, which avoids mixing the status output with shell output of services.
    RemainAfterExit=yes
    User=oracle
    Group=oinstall
    ExecStart=/home/oracle/scripts/startup.sh >> /home/oracle/scripts/startup_shutdown.log 2>&1 &
    ExecStop=/home/oracle/scripts/shutdown.sh >> /home/oracle/scripts/startup_shutdown.log 2>&1
    
    [Install]
    WantedBy=multi-user.target
    ===== CUT HERE =====
    
    # systemctl enable dbora
  10. 开放防火墙
    # firewall-cmd --zone=public --add-port=1521/tcp --permanent
  11. 修改账户的生命周期
    默认情况下,oracle用户密码的生命周期是180天,180天之后必须修改密码。将生命周期更改为无限制,可以避免以后产生的无法登录的问题
    # sqlplus / as sysdba
    SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

0
0
查看评论

Centos7安装oracle 11g r2教程

Centos7安装oracle 11g r2教程以下[root]#是root用户,$是普通用户oracle. 一.安装桌面环境 安装oracle需要桌面环境. 这里推荐xfce,需要先安装epel. [如果在vmware虚拟机,使用gnome桌面,会出现错误窗口无法显示完全,导致无法成功安装...
  • shile
  • shile
  • 2016-12-18 22:47
  • 2560

Centos7 安装Oracle11gR2全过程详解

安装Oracle需要Oracle用户及Oracle,oinstall,dba组。Oracle用户同时属于三个组。 虚拟机安装时会遇到nakefileexception,详细解决办法见另外笔记Error in invoking target ‘agent nmhs’ of makefile ‘/u0...
  • u012667643
  • u012667643
  • 2017-01-17 11:55
  • 6049

第一章 在Centos7.1上安装oracle11gR2-静默安装

# 后跟命令表示以操作系统下root用户操作;  $ 后跟命令表示以操作系统下oracle用户操作;    1.1 上传软件   假如放在/wangnc/oracle/11g/目录下.   # m...
  • isaiah282485068
  • isaiah282485068
  • 2015-12-16 16:23
  • 3910

基于centos7的oracle11g单点安装及配置

如果您在使用本文档安装oracle过程中存在问题,请留言 0.配置yum源 #参开地址 http://blog.csdn.net/JW_xueZhiXia/article/details/78709810 1.配置主机名 cat >> /etc/sysconfig/network ...
  • JW_xueZhiXia
  • JW_xueZhiXia
  • 2017-12-29 18:44
  • 97

在Centos7.1上安装oracle11gR2-静默安装

# 后跟命令表示以操作系统下root用户操作;  $ 后跟命令表示以操作系统下Oracle用户操作;    1.1 上传软件   假如放在/wangnc/oracle/11g/目录下.   # m...
  • u010884123
  • u010884123
  • 2017-02-16 13:21
  • 1935

Centos7 安装Oracle 11g R2完整手册及问题解决方法

linux Centos7 Oracle 11g R2 安装问题总结
  • errinyikeke
  • errinyikeke
  • 2016-07-12 16:15
  • 4410

CentOS7 Oracle11g安装+图示

安装 jdk 1.下载 jdk-7u65-linux-x64.rpm 2. su 切换到 root 权限 3. rpm -ivh jdk-7u65-linux-x64.rpm,默认安装路径为 /usr/java/jdk1.7.0_65 4....
  • jinchaoh
  • jinchaoh
  • 2015-11-03 16:46
  • 1142

centos7下安装oracle11gR2

centos7下安装oracle11gR2
  • whatlookingfor
  • whatlookingfor
  • 2016-08-31 10:30
  • 17535

centos7下静默安装oracle11g

1、yum install vim -y 2、yum install unzip -y 3、yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*i686 compat-libst...
  • TetaiSon
  • TetaiSon
  • 2017-09-29 11:42
  • 407

CentOS7安装Oracle 11gR2 图文详解

一、环境准备 安装包: 1.VMware-workstation-full-11.1.0-2496824.exe 2.CentOS-7-x86_64-DVD-1511.iso 3.linux.x64_11gR2_database_1of2.zip linux.x64_11gR2_databas...
  • Eason_oracle
  • Eason_oracle
  • 2016-06-21 15:44
  • 11796
    个人资料
    • 访问:254次
    • 积分:43
    • 等级:
    • 排名:千里之外
    • 原创:4篇
    • 转载:0篇
    • 译文:0篇
    • 评论:0条