在CentOS 7上安装 Oracle 12C(踩坑向)

首次尝试在 CentOS 7.9 上静默安装 Oracle 11G 失败,卡在监听启动一直没反应;最后一次尝试 12C 成功了。。。


先给出成功记录

参考:

Debian 9安装ORACLE 12C详细教程和初始化

CentOS 7下Oracle 12C 无图形界面静默安装

注意

在安装中没有选择图形安装,因为VNC配置很麻烦,尝试使用MOBAXTERM,结果不知道是网络延迟的原因,操作需要1-2分钟才能反馈回来,不能忍受的折磨,于是选择静默安装。其实道理是一样的,就是参数设置。

备份一下 db_install.rsp:

# vim /data/oracle/db_install.resp
# 关键修改内容如下:
ORACLE_HOSTNAME=oracle12c  # 注意这里要跟你的hostname一致,如果不存在,请手动添加 host
oracle.install.option=INSTALL_DB_SWONLY # 只安装数据库软件,之后我们会手动创库
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/data/oracle/oraInventory
ORACLE_HOME=/data/oracle/app/product/12.2.0/dbhome_1
ORACLE_BASE=/data/oracle/app
oracle.install.db.InstallEdition=EE # 安装Enterprise Edition
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=dba
oracle.install.db.OSBACKUPDBA_GROUP=dba
oracle.install.db.OSDGDBA_GROUP=dba
oracle.install.db.OSKMDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba
DECLINE_SECURITY_UPDATES=true
oracle.install.db.config.starterdb.characterSet=AL32UTF8  # 字符编码设置
oracle.install.db.config.starterdb.memoryLimit=16384   # 内存使用设置,这里你需要根据实际情况,oracle一般是 40%的整个内存
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.password.ALL=oracle # 设置所有用户的密码都为oracle
oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/data/oracle/oradata  # 设置文件存储位置

oracle.install.db.config.starterdb.enableRecovery=true   # 是否开启恢复分区,根据情况设置
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=/data/oracle/app/ecovery_area

安装语句有小小变动,一直说未达到预设置标准:

screen -S oracle  # 这里使用screen 避免安装到一半网络中断等异常情况导致安装中断

/data/oracle/installer/database/runInstaller -ignorePrereqs -waitforcompletion -silent -responseFile /data/oracle/db_install.rsp

初始化建库也一样,没啥还说的。 可以愉快的学习 Oracle 啦,开心。

同时也感谢其他博主的资料:

CentOS 7 命令行静默安装部署oracle11g数据库

CentOS 7 安装Oracle 11G

Linux安装oracle11g


以下为失败尝试记录,感谢互联网的踩坑资料

1. 环境准备

CentOS 7.9

Oracle 11G R2安装包

SSH:Alacritty

2. 初始化参数

  • 下载 Oracle 安装包

    • 本地的 11G 安装包上传到 /usr/local/src 目录下。下载地址(推荐使用pikpak下载,上传可使用 Cyberduck)
  • 检查硬件需求

    • grep MemTotal /proc/meminfo 查看系统物理内存

    • grep SwapTotal /proc/meminfo 查看交换空间大小

      • 11G 要求最小内存 1GB RAM

      • 虚拟内存容量:Reference

        • Between 1GB and 2GB:1.5 times the size of RAM
        • Between 2GB and 16GB:Equal to the size of RAM
        • More than 16GB: 16GB
      • 糟糕,我的swapspace就是0,重新设置吧:

        sudo swapoff -a # 关闭swap
        sudo dd if=/dev/zero of=/swapfile bs=1M count=2048
        # bs指的是Block Size,就是每一块的大小。这里的例子是1M,意思就是count的数字,是以1M为单位的。count是告诉程序,新的swapfile要多少个block。这里是1024,就是说,新的swap文件是5G大小。
        sudo mkswap /swapfile #把增大后的文件变为 swapfile
        sudo swapon /swapfile #重新打开
        cd and vi /etc/fstab #swap启动时自动生效,加上这行命令
        /swapfile swap swap default 0 0
        # 保存退出,可以再检查swap大小
    • 检查当前发行版本,安装依赖包

      cat /etc/redhat-release

      改成 redhat-7

      需要如下安装包:

      # binutils-2.23.52.0.1-12.el7.x86_64
      # compat-libcap1-1.10-3.el7.x86_64
      # gcc-4.8.2-3.el7.x86_64
      # gcc-c++-4.8.2-3.el7.x86_64
      # glibc-2.17-36.el7.i686
      # glibc-2.17-36.el7.x86_64
      # glibc-devel-2.17-36.el7.i686
      # glibc-devel-2.17-36.el7.x86_64
      # ksh
      # libaio-0.3.109-9.el7.i686
      # libaio-0.3.109-9.el7.x86_64
      # libaio-devel-0.3.109-9.el7.i686
      # libaio-devel-0.3.109-9.el7.x86_64
      # libgcc-4.8.2-3.el7.i686
      # libgcc-4.8.2-3.el7.x86_64
      # libstdc++-4.8.2-3.el7.i686
      # libstdc++-4.8.2-3.el7.x86_64
      # libstdc++-devel-4.8.2-3.el7.i686
      # libstdc++-devel-4.8.2-3.el7.x86_64
      # libXi-1.7.2-1.el7.i686
      # libXi-1.7.2-1.el7.x86_64 libXtst-1.2.2-1.el7.i686
      # libXtst-1.2.2-1.el7.x86_64
      # make-3.82-19.el7.x86_64
      # sysstat-10.1.5-1.el7.x86_64

      对照一个一个包检查吧:

      rpm -q install binutils compat-libcap1 gcc gcc-c++ glibc glibc glibc-devel glibc-deve

      rpm -q package or yum install -y package

      一起安装:

      sudo yum install -y binutils compat-libcap1 gcc gcc-c++ glibc glibc glibc-devel glibc-devel ksh libaio libaio libaio-devel libaio-devel libgcc libstdc++ libstdc++ libstdc++-devel libstdc++-devel libXi libXi libXtst libXtst sysstat

  • 创建文件夹

    • 整体思路: Oracle的安装目录以及数据存储目录

      # 安装 Oracle 数据库的目录
      sudo mkdir -p /data/oracle/product/11.2.0
      # Oracle 数据库配置文件目录  ;oracle会将数据库的版本、注册等信息写入到此文件中
      sudo mkdir -p /data/oracle/oraInventory
      # Oracle 安装包的目录
      sudo mkdir -p /data/oracle/oradata
      
      sudo mkdir -p /data/oracle/fast_recovery_area
      
      #检查是否创建成功
      ll /data/oracle/
  • 创建用户组

    • 整体思路:为啥要创建三个用户组呢?参考

      # 创建用户组 oraclesys dba ;可执行关键的数据库管理任务,如创建数据库、启动和关闭实例。
      sudo groupadd osysdba
      # 创建用户组 oraclesys oinstall ;拥有对 Oracle 中央清单 (oraInventory) 的写入权限。
      sudo groupadd oinstall
      # 创建用户组 oraclesys oper ; 成员拥有一组有限的数据库管理权限,如管理和运行备份
      sudo groupadd osysoper
      # 创建oracle用户,并加入到oraclesysoinstall用户组
      sudo useradd -g oinstall -G osysdba,osysoper oracle
      # 设置oracle用户的登陆密码,需要确认一次,注意两次密码要一样(注意:此处的密码是linux端oracle用户登录密码)
      sudo passwd oracle
      # 查看创建用户的组权限
      id oracle
      # uid=1000(oracle) gid=1001(oraclesysoinstall) groups=1001(oraclesysoinstall),1000(oraclesysdba),1002(oraclesysoper)
      chown -R oracle:oinstall /data/oracle
      chmod -R 755 /data/oracle
    • 进入 data 目录授权给刚刚创建的 oracle 用户

      #sudo chown -R oracle:oinstall /data/oracle/product/11.2.0
      #sudo chown -R oracle:oinstall /data/oracle/oraInventory
      #sudo chown -R oracle:oinstall /data/oracle/database
  • 修改 OS 系统标识

    # CentOS --> Redhat
    vi /etc/redhat-release
    # 加入 redhat-7
  • 开放 Firewalld 端口和禁用selinux

    • 检查防火墙状态

      systemctl status firewalld.service

    • 永久开放1521端口

      firewall-cmd --permanent --zone=public --add-port=1521/tcp

    • 重启firewalld及禁用selinux

      systemctl restart firewalld

      setenforce 0

    • 提示:如需保持selinux禁止状态:

      vim /etc/selinux/config
      # This file controls the state of SELinux on the system.
      # SELINUX= can take one of these three values:
      # enforcing - SELinux security policy is enforced.
      # permissive - SELinux prints warnings instead of enforcing.
      # disabled - No SELinux policy is loaded.
      SELINUX=disabled # change it here! 表示禁用selinux策略
      # SELINUXTYPE= can take one of three two values:
      # targeted - Targeted processes are protected,
      # minimum - Modification of targeted policy. Only selected processes are protected.
      # mls - Multi Level Security protection.
      SELINUXTYPE=targeted
  • 配置内核参数

    vim /etc/sysctl.conf
    net.ipv4.icmp_echo_ignore_broadcasts = 1
    net.ipv4.conf.all.rp_filter = 1
    fs.file-max = 65536 # fs.file-max 最大打开文件数
    fs.aio-max-nr = 1048576
    kernel.shmall = 2097152 # kernel.shmall 共享内存的总量,8G内存设置:2097152*4k/1024/1024
    kernel.shmmax = 1677721 # kernel.shmmax 最大共享内存的段大小,一般设置为服务器的80%内存总大小
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    net.ipv4.ip_local_port_range = 1024 65000 # net.ipv4.ip_local_port_range 可使用的ipv4端口范围
    net.core.rmem_default = 262144
    net.core.rmem_max= 262144
    net.core.wmem_default= 262144
    net.core.wmem_max= 262144
    #更改生效
    sudo /sbin/sysctl -p
  • 修改用户使用资源限制

    sudo vi /etc/security/limits.conf
    # 加上参数
    oracle soft nproc 2047   #oracle soft nproc 单个用户可用进程数软限制
    oracle hard nproc 16384  #oracle hard nproc 单个用户可用进程数硬限制
    oracle soft nofile 1024  #oracle soft nofile 打开文件描述符软限制
    oracle hard nofile 65536  #oracle hard nofile 打开文件描述符硬限制
    oracle soft stack 10240
    
    # 接着在文件/etc/pam.d/login中修改
    sudo vi /etc/pam.d/login
    # 加上参数
    session required /lib/security/pam_limits.so
    session required pam_limits.so
    
    #最后在/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
    
    #使命令生效
    source /etc/profile
  • 配置用户环境变量

    vim /home/oracle/.bash_profile #其实跟切到oracle用户再改 ~/.bash_profile 道理一样
    # 加上参数
    # oracle数据库安装目录
    export ORACLE_BASE=/data/oracle
    # oracle数据库路径
    export ORACLE_HOME=/data/oracle/product/11.2.0
    # oracle启动数据库实例名
    export ORACLE_SID=orcl
    export ORACLE_TERM=xterm
    # 添加系统环境变量
    export PATH=$PATH:$ORACLE_HOME/bin
    # 添加系统环境变量
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    # 防止安装过程出现乱码
    export LANG=C
    # 设置Oracle客户端字符集,必须与Oracle安装时设置的字符集保持一致
    export NLS_LANG="AL32UTF8"
    export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'
    
    # 重加载环境变量
    source /home/oracle/.bash_profile
  • 解压安装包并授权

    sudo yum install -y unzip zip
    
    cd /usr/local/src
    
    unzip linux.x64_11gR2_database_1of2.zip -d /data/oracle
    unzip linux.x64_11gR2_database_2of2.zip -d /data/oracle
    
    chown -R oracle:oinstall /data/oracle
  • 修改响应模版(静默安装的答题册)

    # 复制响应文件模板
    mkdir /data/oracle/res
    cp /data/oracle/database/response/* /data/oracle/res
    chown -R oracle:oinstall /data/oracle
    
    # 设置响应文件权限
    sudo chmod 700 /data/oracle/res/*.rsp
  • 一步一步设置响应文件

    vim /data/oracle/res/db_install.rsp
    
    # 安装类型
    oracle.install.option=INSTALL_DB_SWONLY
    # 主机名称(hostname查询)
    ORACLE_HOSTNAME=fond
    # 安装组
    UNIX_GROUP_NAME=oinstall
    # INVENTORY中央库存目录(不填就是默认值)
    INVENTORY_LOCATION=/data/oracle/oraInventory
    # 选择语言
    SELECTED_LANGUAGES=en,zh_CN,zh_TW
    # oracle_home
    ORACLE_HOME=/data/oracle/product/11.2.0
    # oracle_base
    ORACLE_BASE=/data/oracle
    # oracle版本
    oracle.install.db.InstallEdition=EE
    # 自定义安装,否,使用默认组件
    oracle.install.db.isCustomInstall=false
    # dba用户组
    oracle.install.db.DBA_GROUP=osysdba
    # oper用户组
    oracle.install.db.OPER_GROUP=osysoper
    # 数据库类型
    oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
    # globalDBName
    oracle.install.db.config.starterdb.globalDBName=orcl
    # SID
    oracle.install.db.config.starterdb.SID=orcl
    # 自动管理内存的内存(M)
    oracle.install.db.config.starterdb.memoryLimit=81920
    # 设定所有数据库用户使用同一个密码
    oracle.install.db.config.starterdb.password.ALL=123456
    #(手动写了false)
    SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
    # 设置安全更新(貌似是有bug,这个一定要选true,否则会无限提醒邮件地址有问题,终止安装。)
    DECLINE_SECURITY_UPDATES=true
    
    
    #完全版
    ####################################################################
    ## Copyright(c) Oracle Corporation 1998,2008. All rights reserved.##
    ##                                                                ##
    ## Specify values for the variables listed below to customize     ##
    ## your installation.                                             ##
    ##                                                                ##
    ## Each variable is associated with a comment. The comment        ##
    ## can help to populate the variables with the appropriate        ##
    ## values.  ##
    ##                                                                ##
    ## IMPORTANT NOTE: This file contains plain text passwords and    ##
    ## should be secured to have read permission only by oracle user  ##
    ## or db administrator who owns this installation.                ##
    ##                                                                ##
    ####################################################################
    
    #------------------------------------------------------------------------------
    # Do not change the following system generated value.
    #------------------------------------------------------------------------------
    oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
    
    #------------------------------------------------------------------------------
    # Specify the installation option.
    # It can be one of the following:
    # 1. INSTALL_DB_SWONLY
    # 2. INSTALL_DB_AND_CONFIG
    # 3. UPGRADE_DB
    #-------------------------------------------------------------------------------
    oracle.install.option=INSTALL_DB_SWONLY
    
    #-------------------------------------------------------------------------------
    # Specify the hostname of the system as set during the install. It can be used
    # to force the installation to use an alternative hostname rather than using the
    # first hostname found on the system. (e.g., for systems with multiple hostnames
    # and network interfaces)
    #-------------------------------------------------------------------------------
    ORACLE_HOSTNAME=crunchagain
    
    #-------------------------------------------------------------------------------
    # Specify the Unix group to be set for the inventory directory.
    #-------------------------------------------------------------------------------
    UNIX_GROUP_NAME=oraclesysoinstall
    
    #-------------------------------------------------------------------------------
    # Specify the location which holds the inventory files.
    #-------------------------------------------------------------------------------
    INVENTORY_LOCATION=/home/oracle/oraInventory
    
    #-------------------------------------------------------------------------------
    # Specify the languages in which the components will be installed.
    #
    # en   : English                  ja   : Japanese
    # fr   : French                   ko   : Korean
    # ar   : Arabic                   es   : Latin American Spanish
    # bn   : Bengali                  lv   : Latvian
    # pt_BR: Brazilian Portuguese     lt   : Lithuanian
    # bg   : Bulgarian                ms   : Malay
    # fr_CA: Canadian French          es_MX: Mexican Spanish
    # ca   : Catalan                  no   : Norwegian
    # hr   : Croatian                 pl   : Polish
    # cs   : Czech                    pt   : Portuguese
    # da   : Danish                   ro   : Romanian
    # nl   : Dutch                    ru   : Russian
    # ar_EG: Egyptian                 zh_CN: Simplified Chinese
    # en_GB: English (Great Britain)  sk   : Slovak
    # et   : Estonian                 sl   : Slovenian
    # fi   : Finnish                  es_ES: Spanish
    # de   : German                   sv   : Swedish
    # el   : Greek                    th   : Thai
    # iw   : Hebrew                   zh_TW: Traditional Chinese
    # hu   : Hungarian                tr   : Turkish
    # is   : Icelandic                uk   : Ukrainian
    # in   : Indonesian               vi   : Vietnamese
    # it   : Italian
    #
    # Example : SELECTED_LANGUAGES=en,fr,ja
    #------------------------------------------------------------------------------
    SELECTED_LANGUAGES=en,zh_CN,zh_TW
    
    #------------------------------------------------------------------------------
    # Specify the complete path of the Oracle Home.
    #------------------------------------------------------------------------------
    ORACLE_HOME=/oracledata/data/oracle/product/11.2.0.1
    
    #------------------------------------------------------------------------------
    # Specify the complete path of the Oracle Base.
    #------------------------------------------------------------------------------
    ORACLE_BASE=/oracledata/data/oracle
    
    #------------------------------------------------------------------------------
    # Specify the installation edition of the component.
    #
    # The value should contain only one of these choices.
    # EE     : Enterprise Edition
    # SE     : Standard Edition
    # SEONE  : Standard Edition One
    # PE     : Personal Edition (WINDOWS ONLY)
    #------------------------------------------------------------------------------
    oracle.install.db.InstallEdition=EE
    
    #------------------------------------------------------------------------------
    # This variable is used to enable or disable custom install.
    #
    # true  : Components mentioned as part of 'customComponents' property
    #         are considered for install.
    # false : Value for 'customComponents' is not considered.
    #------------------------------------------------------------------------------
    oracle.install.db.isCustomInstall=false
    
    #------------------------------------------------------------------------------
    # This variable is considered only if 'IsCustomInstall' is set to true.
    #
    # Description: List of Enterprise Edition Options you would like to install.
    #
    #              The following choices are available. You may specify any
    #              combination of these choices.  The components you choose should
    #              be specified in the form "internal-component-name:version"
    #              Below is a list of components you may specify to install.
    #
    #              oracle.rdbms.partitioning:11.2.0.1.0 - Oracle Partitioning
    #              oracle.rdbms.dm:11.2.0.1.0 - Oracle Data Mining
    #              oracle.rdbms.dv:11.2.0.1.0 - Oracle Database Vault
    #              oracle.rdbms.lbac:11.2.0.1.0 - Oracle Label Security
    #              oracle.rdbms.rat:11.2.0.1.0 - Oracle Real Application Testing
    #              oracle.oraolap:11.2.0.1.0 - Oracle OLAP
    #------------------------------------------------------------------------------
    oracle.install.db.customComponents=oracle.server:11.2.0.1.0,oracle.sysman.ccr:10.2.7.0.0,oracle.xdk:11.2.0.1.0,oracle.rdbms.oci:11.2.0.1.0,oracle.network:11.2.0.1.0,oracle.network.listener:11.2.0.1.0,oracle.rdbms:11.2.0.1.0,oracle.options:11.2.0.1.0,oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,orcle.rdbms.lbac:11.2.0.1.0,oracle.rdbms.rat:11.2.0.1.0
    
    ###############################################################################
    #                                                                             #
    # PRIVILEGED OPERATING SYSTEM GROUPS                                        #
    # ------------------------------------------                                  #
    # Provide values for the OS groups to which OSDBA and OSOPER privileges       #
    # needs to be granted. If the install is being performed as a member of the   #
    # group "dba", then that will be used unless specified otherwise below.      #
    #                                                                             #
    ###############################################################################
    
    #------------------------------------------------------------------------------
    # The DBA_GROUP is the OS group which is to be granted OSDBA privileges.
    #------------------------------------------------------------------------------
    oracle.install.db.DBA_GROUP=oraclesysdba
    
    #------------------------------------------------------------------------------
    # The OPER_GROUP is the OS group which is to be granted OSOPER privileges.
    #------------------------------------------------------------------------------
    oracle.install.db.OPER_GROUP=oraclesysoper
    
    #------------------------------------------------------------------------------
    # Specify the cluster node names selected during the installation.
    #------------------------------------------------------------------------------
    oracle.install.db.CLUSTER_NODES=
    
    #------------------------------------------------------------------------------
    # Specify the type of database to create.
    # It can be one of the following:
    # - GENERAL_PURPOSE/TRANSACTION_PROCESSING
    # - DATA_WAREHOUSE
    #------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
    
    #------------------------------------------------------------------------------
    # Specify the Starter Database Global Database Name.
    #------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.globalDBName=orcl
    
    #------------------------------------------------------------------------------
    # Specify the Starter Database SID.
    #------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.SID=dbsrv2
    
    #------------------------------------------------------------------------------
    # Specify the Starter Database character set.
    #
    # It can be one of the following:
    # AL32UTF8, WE8ISO8859P15, WE8MSWIN1252, EE8ISO8859P2,
    # EE8MSWIN1250, NE8ISO8859P10, NEE8ISO8859P4, BLT8MSWIN1257,
    # BLT8ISO8859P13, CL8ISO8859P5, CL8MSWIN1251, AR8ISO8859P6,
    # AR8MSWIN1256, EL8ISO8859P7, EL8MSWIN1253, IW8ISO8859P8,
    # IW8MSWIN1255, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE,
    # KO16MSWIN949, ZHS16GBK, TH8TISASCII, ZHT32EUC, ZHT16MSWIN950,
    # ZHT16HKSCS, WE8ISO8859P9, TR8MSWIN1254, VN8MSWIN1258
    #------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.characterSet=AL32UTF8
    
    #------------------------------------------------------------------------------
    # This variable should be set to true if Automatic Memory Management
    # in Database is desired.
    # If Automatic Memory Management is not desired, and memory allocation
    # is to be done manually, then set it to false.
    #------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.memoryOption=true
    
    #------------------------------------------------------------------------------
    # Specify the total memory allocation for the database. Value(in MB) should be
    # at least 256 MB, and should not exceed the total physical memory available
    # on the system.
    # Example: oracle.install.db.config.starterdb.memoryLimit=512
    #------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.memoryLimit=61440
    
    #------------------------------------------------------------------------------
    # This variable controls whether to load Example Schemas onto the starter
    # database or not.
    #------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.installExampleSchemas=false
    
    #------------------------------------------------------------------------------
    # This variable includes enabling audit settings, configuring password profiles
    # and revoking some grants to public. These settings are provided by default.
    # These settings may also be disabled.
    #------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.enableSecuritySettings=true
    
    ###############################################################################
    #                                                                             #
    # Passwords can be supplied for the following four schemas in the      #
    # starter database:            #
    #   SYS                                                                       #
    #   SYSTEM                                                                    #
    #   SYSMAN (used by Enterprise Manager)                                       #
    #   DBSNMP (used by Enterprise Manager)                                       #
    #                                                                             #
    # Same password can be used for all accounts (not recommended)       #
    # or different passwords for each account can be provided (recommended)       #
    #                                                                             #
    ###############################################################################
    
    #------------------------------------------------------------------------------
    # This variable holds the password that is to be used for all schemas in the
    # starter database.
    #-------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.password.ALL=xxzx0124
    
    #-------------------------------------------------------------------------------
    # Specify the SYS password for the starter database.
    #-------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.password.SYS=
    
    #-------------------------------------------------------------------------------
    # Specify the SYSTEM password for the starter database.
    #-------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.password.SYSTEM=
    
    #-------------------------------------------------------------------------------
    # Specify the SYSMAN password for the starter database.
    #-------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.password.SYSMAN=
    
    #-------------------------------------------------------------------------------
    # Specify the DBSNMP password for the starter database.
    #-------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.password.DBSNMP=
    
    #-------------------------------------------------------------------------------
    # Specify the management option to be selected for the starter database.
    # It can be one of the following:
    # 1. GRID_CONTROL
    # 2. DB_CONTROL
    #-------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.control=DB_CONTROL
    
    #-------------------------------------------------------------------------------
    # Specify the Management Service to use if Grid Control is selected to manage
    # the database.
    #-------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
    
    #-------------------------------------------------------------------------------
    # This variable indicates whether to receive email notification for critical
    # alerts when using DB control.
    #-------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false
    
    #-------------------------------------------------------------------------------
    # Specify the email address to which the notifications are to be sent.
    #-------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.dbcontrol.emailAddress=elios.space@gmail.com
    
    #-------------------------------------------------------------------------------
    # Specify the SMTP server used for email notifications.
    #-------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.dbcontrol.SMTPServer=
    
    
    ###############################################################################
    #                                                                             #
    # SPECIFY BACKUP AND RECOVERY OPTIONS                                       #
    # ------------------------------------                              #
    # Out-of-box backup and recovery options for the database can be mentioned    #
    # using the entries below.      #
    #                                                                             #
    ###############################################################################
    
    #------------------------------------------------------------------------------
    # This variable is to be set to false if automated backup is not required. Else
    # this can be set to true.
    #------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.automatedBackup.enable=false
    
    #------------------------------------------------------------------------------
    # Regardless of the type of storage that is chosen for backup and recovery, if
    # automated backups are enabled, a job will be scheduled to run daily at
    # 2:00 AM to backup the database. This job will run as the operating system
    # user that is specified in this variable.
    #------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.automatedBackup.osuid=
    
    #-------------------------------------------------------------------------------
    # Regardless of the type of storage that is chosen for backup and recovery, if
    # automated backups are enabled, a job will be scheduled to run daily at
    # 2:00 AM to backup the database. This job will run as the operating system user
    # specified by the above entry. The following entry stores the password for the
    # above operating system user.
    #-------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.automatedBackup.ospwd=
    
    #-------------------------------------------------------------------------------
    # Specify the type of storage to use for the database.
    # It can be one of the following:
    # - FILE_SYSTEM_STORAGE
    # - ASM_STORAGE
    #------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.storageType=
    
    #-------------------------------------------------------------------------------
    # Specify the database file location which is a directory for datafiles, control
    # files, redo logs.
    #
    # Applicable only when oracle.install.db.config.starterdb.storage=FILE_SYSTEM
    #-------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
    
    #-------------------------------------------------------------------------------
    # Specify the backup and recovery location.
    #
    # Applicable only when oracle.install.db.config.starterdb.storage=FILE_SYSTEM
    #-------------------------------------------------------------------------------
    oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
    
    #-------------------------------------------------------------------------------
    # Specify the existing ASM disk groups to be used for storage.
    #
    # Applicable only when oracle.install.db.config.starterdb.storage=ASM
    #-------------------------------------------------------------------------------
    oracle.install.db.config.asm.diskGroup=
    
    #-------------------------------------------------------------------------------
    # Specify the password for ASMSNMP user of the ASM instance.
    #
    # Applicable only when oracle.install.db.config.starterdb.storage=ASM_SYSTEM
    #-------------------------------------------------------------------------------
    oracle.install.db.config.asm.ASMSNMPPassword=
    
    #------------------------------------------------------------------------------
    # Specify the My Oracle Support Account Username.
    #
    #  Example   : MYORACLESUPPORT_USERNAME=metalink
    #------------------------------------------------------------------------------
    MYORACLESUPPORT_USERNAME=
    
    #------------------------------------------------------------------------------
    # Specify the My Oracle Support Account Username password.
    #
    # Example    : MYORACLESUPPORT_PASSWORD=password
    #------------------------------------------------------------------------------
    MYORACLESUPPORT_PASSWORD=
    
    #------------------------------------------------------------------------------
    # Specify whether to enable the user to set the password for
    # My Oracle Support credentials. The value can be either true or false.
    # If left blank it will be assumed to be false.
    #
    # Example    : SECURITY_UPDATES_VIA_MYORACLESUPPORT=true
    #------------------------------------------------------------------------------
    SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
    
    #------------------------------------------------------------------------------
    # Specify whether user wants to give any proxy details for connection.
    # The value can be either true or false. If left blank it will be assumed
    # to be false.
    #
    # Example    : DECLINE_SECURITY_UPDATES=false
    #------------------------------------------------------------------------------
    DECLINE_SECURITY_UPDATES=true
    
    #------------------------------------------------------------------------------
    # Specify the Proxy server name. Length should be greater than zero.
    #
    # Example    : PROXY_HOST=proxy.domain.com
    #------------------------------------------------------------------------------
    PROXY_HOST=
    
    #------------------------------------------------------------------------------
    # Specify the proxy port number. Should be Numeric and atleast 2 chars.
    #
    # Example    : PROXY_PORT=25
    #------------------------------------------------------------------------------
    PROXY_PORT=
    
    #------------------------------------------------------------------------------
    # Specify the proxy user name. Leave PROXY_USER and PROXY_PWD
    # blank if your proxy server requires no authentication.
    #
    # Example    : PROXY_USER=username
    #------------------------------------------------------------------------------
    PROXY_USER=
    
    #------------------------------------------------------------------------------
    # Specify the proxy password. Leave PROXY_USER and PROXY_PWD
    # blank if your proxy server requires no authentication.
    #
    # Example    : PROXY_PWD=password
    #------------------------------------------------------------------------------
    PROXY_PWD=

3.正式安装

# 先重启系统,保证配置重新生效
sudo reboot
# 接着登录到oracle用户
# 进入解压后的data目录
cd /data/oracle/database
# 运行安装
./runInstaller -silent -ignorePrereq -responseFile /data/oracle/res/db_install.rsp
# 接下来需要等一会儿,时间略长,出现提示信息后安装成功,告知要新开会话用root用户执行脚本
####(这一步很重要) 新开会话切换用户root或者其他用户可以用sudo的,我的就是用sudo的,根据提示输入两个脚本:
sudo /home/oracle/oraInventory/orainstRoot.sh
sudo /oracledata/data/oracle/product/11.2.0.1/root.sh
# 然后切回原会话按Enter即可
# 检查完善环境变量
vim ~/.bash_profile

export ROACLE_PID=ora11g


netca /silent /responseFile /data/oracle/res/netca.rsp


vim /data/oracle/res/dbca.rsp
dbca -silent -responseFile /data/oracle/res/dbca.rsp

lsnrctl status

SID_LIST_LISTE=
(SID_LIST=
    (SID_DESC=
      (GLOBAL_DBNAME=orcl)
      (ORACLE_HOME=/data/oracle/product/11.2.0)
      (SID_NAME=orcl)
 )
)
All rights reserved
Except where otherwise noted, content on this page is copyrighted.