本博文讲述如何在linux系统下静默安装oracle11g(11.2.4.0)。主要用于图形显示不方便的场景,也适用于脚本化批量部署的需要。

系统环境

OS: Oracle Linux Server release 6.7 

      软件包采用mini安装,降低系统负载,减少系统漏洞***面。并安装oracle工具包,简化oracle数据库安装流程。省去创建oracle用户和oinstall用户租的创建,并能够满足通过oracle安装过程的依赖检查。

  静默安装流程:

 1. 定义目录结构:

 ORACLE_BASE ORACLE产品的根目录 

 Linux建议设置:ORACLE_BASE=/u01/app/oracle

 ORACLE_HOME 数据库产品目录

 Linux建议设置:ORACLE_HOME=/u01/app/oracle/product/11.2.4/dbhome_1

 ORACLE_INVENTORY 数据库资产清单目录

 Linux建议设置:ORACLE_INVENTORY=/u01/app/oraInventory

 2.准备应答文件:

 

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY    #仅安装软件不创建数据库
ORACLE_HOSTNAME=DB-DEV01                   #服务器主机名
UNIX_GROUP_NAME=oinstall                   #软件安装所需群组
INVENTORY_LOCATION=/u01/app/oraInventory       #指定资产清单目录
SELECTED_LANGUAGES=en,zh_CN                    #软件语言
ORACLE_HOME=/u01/app/oracle/product/11.2.4/dbhome_1 #ORACLE_HOME
ORACLE_BASE=/u01/app/oracle                    #ORACLE_BASE
oracle.install.db.InstallEdition=EE            #安装版本,本例选择企业版
oracle.install.db.EEOptionsSelection=false     
oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.4.0,oracle.oraolap:11.2.0.4.0,oracle.rdbms.dm:11.2.0.4.0,oracle.rdbms.dv:11.2.0.4.0,oracle.rdbms.lbac:11.2.0.4.0,oracle.rdbms.rat:11.2.0.4.0
oracle.install.db.DBA_GROUP=dba                #安装软件时的指定用户
oracle.install.db.OPER_GROUP=       
oracle.install.db.CLUSTER_NODES=
oracle.install.db.isRACOneInstall=false
oracle.install.db.racOneServiceName=
oracle.install.db.config.starterdb.type=
oracle.install.db.config.starterdb.globalDBName=
oracle.install.db.config.starterdb.SID=
oracle.install.db.config.starterdb.characterSet=AL32UTF8    #字符集
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.SYSMAN=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.automatedBackup.osuid=
oracle.install.db.config.starterdb.automatedBackup.ospwd=
oracle.install.db.config.starterdb.storageType=
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=
DECLINE_SECURITY_UPDATES=true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
COLLECTOR_SUPPORTHUB_URL=
oracle.installer.autoupdates.option=SKIP_UPDATES
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=

 3.执行安装命令

    /directory_path/runInstaller [-silent] [-noconfig] -responseFile /home/oracle/

 4.查看安装过程

 执行上面的命令后,会弹出

  You can find the log of this install session at:

 /u01/app/oraInventory/logs/installActions2015-12-09_10-26-42PM.log

 使用tail -f 监控安装过程。

 5.结束后应用,切换到root用户,应用指定的脚本安装结束。


常见问题以及解决方案:

1. Could not retrieve local nodename

INFO: Setting value for the property:configcmds in the bean:configcmdmappings

SEVERE: [FATAL] PRVF-0002 : Could not retrieve local nodename.

Refer associated stacktrace #oracle.install.commons.util.exception.DefaultErrorAdvisor:35

INFO: Advice is ABORT

SEVERE: Unconditional Exit

INFO: Adding ExitStatus FAILURE to the exit status set

WARNING: A log of this session is currently saved as: /tmp/OraInstall2016-06-26_07-52-09PM/installActions2016-06-26_07-52-09PM.log. Oracle recommends that if you want to keep this log, you should move it from the temporary location to a more permanent location.

INFO: Finding the most appropriate exit status for the current application

INFO: Exit Status is -1

INFO: Shutdown Oracle Database 11g Release 2 Installer

解决方案: