专栏首页杨建荣的学习笔记数据库静默安装总结(r3笔记第58天)

数据库静默安装总结(r3笔记第58天)

在学习数据库的时候,不知道dbca的命令用了多少遍,但是越是安装也是觉得自己会的越少,因为图形界面的清晰直白反而不知道哪些准备工作是需要特别准备的,如果在远程支持的环境中,图形界面就会受到网络带宽的影响,如果在本地的环境中学习的时候,总是提示少这个包,那个包的。其实有很多的安装包如果不使用图形界面都不是必须的。个人感触比较深的一个例子就是安装的时候缺少报了libXp.so相关的错误,结果自己折腾了半天,从网上下载安装包费了很大的周折才算搞定,最后发现使用静默安装就不需要这个包了,基于学习的环境,摆脱图形界面也是一个好的开始,你需要考虑的东西越多,你就学到的越多。

说到静默安装,就不得不提到响应文件,就是所谓的response  file。在oracle,db2的安装中都有提供响应文件,这个响应文件其实就是一个配置文件。里面可以配置一些安装的细节,像dbca里面能够看到的安装选项,在响应文件中都有体现。你可以通过响应文件来设置安装企业版,个人版,标准被,安装的语言包,安装的字符集等等。

响应文件可以通过安装目录获得,比如得到解压后的安装包。响应文件的模板就是db_install.rsp

[oracle@rac1  database]$ pwd
/u02/ora11g/database
[oracle@rac1 database]$ ll
total  64
drwxr-xr-x 12 ora11g dba  4096 Sep 18  2011 doc
drwxr-xr-x  4 ora11g  dba  4096 Sep 22  2011 install
-rwxr-xr-x  1 ora11g dba 28122 Sep 22  2011  readme.html
drwxr-xr-x  2 ora11g dba  4096 Sep 22  2011  response
drwxr-xr-x  2 ora11g dba  4096 Sep 22  2011 rpm
-rwxr-xr-x  1  ora11g dba  3226 Sep 22  2011 runInstaller
drwxr-xr-x  2 ora11g dba  4096 Sep  22  2011 sshsetup
drwxr-xr-x 14 ora11g dba  4096 Sep 22  2011  stage
-rwxr-xr-x  1 ora11g dba  5466 Aug 22  2011  welcome.html
[oracle@rac1 database]$ cd response
[oracle@rac1 response]$  ll
total 80
-rwxr-xr-x 1 ora11g ora11g 44533 Sep 22  2011  dbca.rsp
-rwxr-xr-x 1 ora11g ora11g 24992 Sep 22  2011 db_install.rsp
-rwxr-xr-x 1 ora11g  ora11g  5871 Sep 22  2011  netca.rsp

以下标黄的部分是在响应文件中需要格外注意的。可以根据自己的需求和环境来设置

#################################################################### ## Copyright(c) Oracle Corporation 1998,2011. 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=rac1

#------------------------------------------------------------------------------- # Specify the Unix group to be set for the inventory directory. #------------------------------------------------------------------------------- UNIX_GROUP_NAME=dba

#------------------------------------------------------------------------------- # Specify the location which holds the inventory files. # This is an optional parameter if installing on # Windows based Operating System. #------------------------------------------------------------------------------- INVENTORY_LOCATION=/home/oracle

#------------------------------------------------------------------------------- # 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 # # all_langs : All languages # # Specify value as the following to select any of the languages. # Example : SELECTED_LANGUAGES=en,fr,ja # # Specify value as the following to select all the languages. # Example : SELECTED_LANGUAGES=all_langs #------------------------------------------------------------------------------ SELECTED_LANGUAGES=en,zh_CN,th,zh_TW

#------------------------------------------------------------------------------ # Specify the complete path of the Oracle Home. #------------------------------------------------------------------------------ ORACLE_HOME=/home/oracle/ORAHOME

#------------------------------------------------------------------------------ # Specify the complete path of the Oracle Base. #------------------------------------------------------------------------------ ORACLE_BASE=/home/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 and is considered # only if InstallEdition is EE. # # true : Components mentioned as part of 'optionalComponents' property # are considered for install. # false : Value for 'optionalComponents' is not considered. #------------------------------------------------------------------------------ oracle.install.db.EEOptionsSelection=true

#------------------------------------------------------------------------------ # This variable is considered only if 'EEOptionsSelection' is set to true. # # Description: List of Enterprise Edition Options you would like to enable. # # 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 enable. # # oracle.oraolap:11.2.0.3.0 - Oracle OLAP # oracle.rdbms.dm:11.2.0.3.0 - Oracle Data Mining # oracle.rdbms.dv:11.2.0.3.0 - Oracle Database Vault # oracle.rdbms.lbac:11.2.0.3.0 - Oracle Label Security # oracle.rdbms.partitioning:11.2.0.3.0 - Oracle Partitioning # oracle.rdbms.rat:11.2.0.3.0 - Oracle Real Application Testing #------------------------------------------------------------------------------ oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.3.0,oracle.oraolap:11.2.0.3.0,oracle.rdbms.dm:11.2.0.3.0,oracle.rdbms.dv:11.2.0.3.0,oracle.rdbms.lbac:11.2.0.3.0,oracle.rdbms.rat:11.2.0.3.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 value to be specified for OSDBA and OSOPER group is only for UNIX based # # Operating System. # # # ###############################################################################

#------------------------------------------------------------------------------ # The DBA_GROUP is the OS group which is to be granted OSDBA privileges. #------------------------------------------------------------------------------ oracle.install.db.DBA_GROUP=dba

#------------------------------------------------------------------------------ # The OPER_GROUP is the OS group which is to be granted OSOPER privileges. # The value to be specified for OSOPER group is optional. #------------------------------------------------------------------------------ oracle.install.db.OPER_GROUP=dba

#------------------------------------------------------------------------------ # Specify whether user doesn't want to configure Security Updates. # The value for this variable should be true if you don't want to configure # Security Updates, false otherwise. # # 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 对于静默安装 runInstaller是必须的执行文件,脚本本身提供了大量的选项。可以通过./runInstaller -help来看到 Preparing to launch Oracle Universal Installer from /tmp/OraInstall2014-11-18_04-00-22AM. Please wait ...[oracle@rac1 database]$ Usage: runInstaller [-options] [(<CommandLineVariable=Value>)*]

Where options include: -clusterware oracle.crs,<crs version> Version of Cluster ready services installed.

-crsLocation <Path> Used only for cluster installs, specifies the path to the crs home location. Specifying this overrides CRS information obtained from central inventory.

-invPtrLoc <full path of oraInst.loc> Unix only. To point to a different inventory location. The orainst.loc file contains: inventory_loc=<location of central inventory> inst_group=<>

-jreLoc <location> 。。。。。 安装的时候,可以使用如下命令。

[oracle@rac1 database]$ ./runInstaller -silent -responsefile /home/oracle/new.rsp -ignoreSysPrereqs Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB. Actual 993 MB Passed Checking swap space: must be greater than 150 MB. Actual 3967 MB Passed Preparing to launch Oracle Universal Installer from /tmp/OraInstall2014-11-18_04-15-07AM. Please wait ...[oracle@rac1 database]$ [WARNING] [INS-32008] Oracle base location cant be same as the user home directory. CAUSE: The specified Oracle base is same as the user home directory. ACTION: Provide an Oracle base location other than the user home directory. [WARNING] [INS-13014] Target environment do not meet some optional requirements. CAUSE: Some of the optional prerequisites are not met. See logs for details. /u04/app/oraInventory/logs/installActions2014-11-18_04-15-07AM.log ACTION: Identify the list of failed prerequisite checks from the log: /u04/app/oraInventory/logs/installActions2014-11-18_04-15-07AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually. You can find the log of this install session at: /u04/app/oraInventory/logs/installActions2014-11-18_04-15-07AM.log 如果响应文件出现问题,就会出现类似下面的问题。

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2014-11-18_04-06-16AM. Please wait ...[oracle@rac1 database]$ [FATAL] [INS-10105] The given response file /home/oracle/new.rsp is not valid. CAUSE: Syntactically incorrect response file. Either unexpected variables are specified or expected variables are not specified in the response file. ACTION: Refer the latest product specific response file template SUMMARY: - cvc-enumeration-valid: Value '1' is not facet-valid with respect to enumeration '[INSTALL_DB_SWONLY, INSTALL_DB_AND_CONFIG, UPGRADE_DB]'. It must be a value from the enumeration. cvc-type.3.1.3: The value '1' of element 'oracle.install.option' is not valid.

这个问题很明显就是因为响应文件中的设置错误。有INSTALL_DB_SWONLY, INSTALL_DB_AND_CONFIG, UPGRADE_DB3个选项,但是相应文件里设置错误。 查看响应文件的配置,确实有问题。 # 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=1 --这个地方设置错误,需要写为INSTALL_DB_SWONLY..不是数字 如果大体没有问题,就可以看到一个后台进程在执行安装。 PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 12298 oracle 20 0 1494m 160m 22m R 194.5 8.1 0:40.84 /tmp/OraInstall2014-11-18_04-15-07AM/jdk/jre/bin/java -Doracle.installer.library_loc=/tmp/OraInstall2014-1 通过日志文件也能看到安装的一些细节。 查看安装目录,也会看到在逐渐增大。 [oracle@rac1 ORAHOME]$ du -sh . 1.8G . [oracle@rac1 ORAHOME]$ du -sh . 2.2G . [oracle@rac1 ORAHOME]$ du -sh . 4.0G 如果在日志文件中看到如下的内容,证明安装已经完成。 INFO: Finding the most appropriate exit status for the current application INFO: Exit Status is 6 INFO: List of warnings encountered in this Application: INFO: PREREQS_FAILED_WITH_WARNING INFO: Shutdown Oracle Database 11g Release 2 Installer INFO: Unloading Setup Driver 同时,也可以通过sqlplus来测试安装进度 [oracle@rac1 bin]$ ./sqlplus ./sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory --这个时候说明安装还在继续 [oracle@rac1 bin]$ ./sqlplus Error 6 initializing SQL*Plus SP2-0667: Message file sp1<lang>.msb not found --这个时候说明安装已经完成,需要设置的就是ORACLE_HOME了 SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory

[oracle@rac1 ~]$ export ORACLE_SID=A --设置ORACLE_HOME以后,可以简单的测试是否sqlplus一切正常 [oracle@rac1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue Nov 18 04:34:08 2014

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Connected to an idle instance.

本文分享自微信公众号 - 杨建荣的学习笔记(jianrong-notes),作者:r3笔记第58天

原文出处及转载信息见文内详细说明,如有侵权,请联系 yunjia_community@tencent.com 删除。

原始发表时间:2014-11-18

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • 因子分析的一个小例子

    今天做了下因子分析中的东东,本来想找一些公共网站的数据,限于时间和要做一些数据整理,时间来不及,就找了一个现成的数据源。

    jeanron100
  • Greenplum工具GPCC和GP日志中时间不匹配的问题分析

    今天同事反馈了一个问题,之前看到没有太在意,虽然无伤大雅,但是想如果不重视,那么后期要遇到的问题就层出不穷,所以就作为我今天的任务之一来看看吧。能不能定位和解决...

    jeanron100
  • Data Guard搭建困境突围(一)(r10笔记第17天)

    在Oracle 10g的中搭建Data Guard环境真是一个纠结,目前大体都是采用两种方式,一种是rman备份,一种是duplicate的方式,但是这...

    jeanron100
  • 研究具有奇异性的DAE系统的临界清除时间灵敏度(CS SY)

    标准电力系统模型是参数相关的微分代数方程(DAE)类型。由于存在瞬态事件,电压崩溃可能作为瞬态负载流解的分支出现,该分支由系统轨迹在失去电压因果关系的状态空间中...

    用户6853689
  • 贝叶斯学习记录

    这篇文章用于记录学习贝叶斯定理及其应用过程中的记录,希望由浅及深的提供一份自我学习教程。 引子 概率的定义:概率是一个0-1之间的数,代表了我们对某个事实或预测...

    生信宝典
  • 从Splay到动态优化的新路径

    摘要:考虑在二叉搜索树中执行搜索序列的任务。 在每次搜索之后,允许算法以与执行的重构量成比例的成本任意地重构树。 执行的成本是搜索所花费的时间和使用重组操作优化...

    罗大琦
  • Objective-C自学笔记(1)-AppDelegate.m

    2016-05-0506:58:49 发表评论 353℃热度 写一些平时看书学习iOS的笔记,基础的、进阶的都有,供以后回顾,也可以让刚开始学习的同学学习。 ...

    timhbw
  • 文本处理工具 - TextBlob

    TextBlob是一个用Python编写的开源的文本处理库。它可以用来执行很多自然语言处理的任务,比如,词性标注,名词性成分提取,情感分析,文本翻译,等等。你可...

    种花家的奋斗兔
  • HDUOJ-----Climbing Worm

    Climbing Worm Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/3276...

    Gxjun
  • numpy.ndarray

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。 ...

    于小勇

扫码关注云+社区

领取腾讯云代金券