今天拿了一台虚拟机测试,进行静默安装oracle 11g,前期的准备工作(创建组,用户,配置内核参数,配置环境变量,依赖包,创建目录等)跟图形化界面安装一样,这里就不再重复了,下面就直接配置静默安装相关的文件。
STP1:修改软件安装响应文件db_install.rsp (在oracle解压缩安装文件的/home/oracle/software/database/response目录下面)
-
####################################################################
-
## 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=localhost.localdomain
-
-
#-------------------------------------------------------------------------------
-
# Specify the Unix group to be set for the inventory directory.
-
#-------------------------------------------------------------------------------
-
UNIX_GROUP_NAME=oinstall
-
-
#-------------------------------------------------------------------------------
-
# Specify the location which holds the inventory files.
-
# This is an optional parameter if installing on
-
# Windows based Operating System.
-
#-------------------------------------------------------------------------------
-
INVENTORY_LOCATION=/u01/app/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
-
#
-
# 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
-
-
#------------------------------------------------------------------------------
-
# Specify the complete path of the Oracle Home.
-
#------------------------------------------------------------------------------
-
ORACLE_HOME=/u01/app/oracle
-
-
#------------------------------------------------------------------------------
-
# Specify the complete path of the Oracle Base.
-
#------------------------------------------------------------------------------
-
ORACLE_BASE=/u01/app
-
-
#------------------------------------------------------------------------------
-
# 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=false
-
-
#------------------------------------------------------------------------------
-
# 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
-
-
…………
|
红色标记就是需要手动配置的参数,由于之前没有设置参数 DECLINE_SECURITY_UPDATES(上面红色粗体),所以报了以下错误
-
[oracle@localhost oraInventory]$ tail 100 /tmp/OraInstall2015-02-01_11-06-39PM/installActions2015-02-01_11-06-39PM.log
-
tail: cannot open `100' for reading: No such file or directory
-
==> /tmp/OraInstall2015-02-01_11-06-39PM/installActions2015-02-01_11-06-39PM.log <==
-
INFO: Completed background operations
-
INFO: Validating state <getOCMDetails>
-
WARNING: My Oracle Support Username/Email Address Not Specified
-
SEVERE: Provide the My Oracle Support password.
-
INFO: Adding ExitStatus VAR_VALIDATION_FAILURE to the exit status set
-
WARNING: A log of this session is currently saved as: /tmp/OraInstall2015-02-01_11-06-39PM/installActions2015-02-01_11-06-39PM.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 -2
-
INFO: Shutdown Oracle Database 11g Release 2 Installer
-
INFO: Unloading Setup Driver
|
将
DECLINE_SECURITY_UPDATES=true加上后就好了
STEP2:执行静默安装数据库软件
-
[oracle@localhost database]$ ./runInstaller -silent -force -responseFile /home/oracle/software/database/response/db_install.rsp
-
Starting Oracle Universal Installer...
-
-
Checking Temp space: must be greater than 120 MB. Actual 219625 MB Passed
-
Checking swap space: must be greater than 150 MB. Actual 10047 MB Passed
-
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-02-01_11-23-32PM. Please wait ...[oracle@localhost database]$ [WARNING] [INS-32016] The selected Oracle home contains directories or files.
-
CAUSE: The selected Oracle home contained directories or files.
-
ACTION: To start with an empty Oracle home, either remove its contents or choose another location.
-
[WARNING] [INS-32055] The Central Inventory is located in the Oracle base.
-
CAUSE: The Central Inventory is located in the Oracle base.
-
ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base 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. /tmp/OraInstall2015-02-01_11-23-32PM/installActions2015-02-01_11-23-32PM.log
-
ACTION: Identify the list of failed prerequisite checks from the log: /tmp/OraInstall2015-02-01_11-23-32PM/installActions2015-02-01_11-23-32PM.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:
-
/u01/app/oracle/oraInventory/logs/installActions2015-02-01_11-23-32PM.log
-
The installation of Oracle Database 11g was successful.
-
Please check '/u01/app/oracle/oraInventory/logs/silentInstall2015-02-01_11-23-32PM.log' for more details.
-
-
As a root user, execute the following script(s):
-
1. /u01/app/oracle/oraInventory/orainstRoot.sh
-
2. /u01/app/oracle/root.sh
-
-
Successfully Setup Software.
|
安装完成后,用root的身份登录执行
-
[root@localhost response]# /u01/app/oracle/oraInventory/orainstRoot.sh
-
Changing permissions of /u01/app/oracle/oraInventory.
-
Adding read,write permissions for group.
-
Removing read,write,execute permissions for world.
-
-
Changing groupname of /u01/app/oracle/oraInventory to oinstall.
-
The execution of the script is complete.
-
[root@localhost response]# /u01/app/oracle/root.sh
-
Check /u01/app/oracle/install/root_localhost.localdomain_2015-02-01_23-30-25.log for the output of root script
-
[root@localhost response]#
|
STEP3:配置静默安装监听的响应文件
netca.rsp,配置监听程序
-
[oracle@localhost bin]$ ./netca /silent /responsefile /home/oracle/software/database/response/netca.rsp
|
STEP4:配置静默安装数据库的响应文件
dbca.rsp
在这些配置参数中,有个需要特别说明一下GDBNAME = "orcl.localdomain" 在配置GDBNAME时,以为只是配置全局数据库名,所以就将值配置为“orcl”,结果在静默安装时,xshell的安装界面直接空白,什么都没有,不知道问题出在哪里,于是将响应文件dbca.rsp再重新看了一下,发先GDBNAME后面还需要一个域名
-
[root@localhost response]# hostname
-
localhost.localdomain
查看了一下域名,所以将 GDBNAME = "orcl.localdomain" 再执行静默安装,就OK了
-
[oracle@localhost bin]$ ./dbca -silent -responseFile /home/oracle/software/database/response/dbca.rsp
-
Copying database files
-
1% complete
-
3% complete
-
11% complete
-
18% complete
-
26% complete
-
37% complete
-
Creating and starting Oracle instance
-
40% complete
-
45% complete
-
50% complete
-
55% complete
-
56% complete
-
60% complete
-
62% complete
-
Completing Database Creation
-
66% complete
-
70% complete
-
73% complete
-
85% complete
-
96% complete
-
100% complete
-
Look at the log file "/u01/app/cfgtoollogs/dbca/orcl/orcl.log" for further details.
至此,oracle 11g的静默安装已经完成!
补充:
关于静默安装数据库软件的时候,后面的一些参数说明:
[oracle@LINUX142 database]$ ./runInstaller -help
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-04-20_03-33-11PM. Please wait ...[oracle@LINUX142 database]$ Usage:
runInstaller [-options] [()*]
Where options include:
-clusterware oracle.crs,
Version of Cluster ready services installed.
-crsLocation
Used only for cluster installs, specifies the path to the crs home location. Specifying this overrides CRS information obtained from central inventory.
-invPtrLoc
Unix only. To point to a different inventory location. The orainst.loc file contains:
inventory_loc=
inst_group=<>
-jreLoc
Path where Java Runtime Environment is installed. OUI cannot be run without it.
-logLevel
To filter log messages that have a lesser priority level than . Valid options are: severe, warning, info, config, fine, finer, finest, basic, general, detailed, trace. The use of basic, general, detailed, trace is deprecated.
-paramFile
Specify location of oraparam.ini file to be used by OUI.
-responseFile
Specifies the response file and path to use.
-attachHome
For attaching homes to the OUI inventory.
-cfs
Indicates that the Oracle home specified is on cluster file system (shared). This is mandatory when '-local' is specified so that Oracle Universal Installer can register the home appropriately into the inventory.
-clone
For making an Oracle Home copy match its current environment.
-debug
For getting the debug information from OUI.
-detachHome
For detaching homes from the OUI inventory without deleting inventory directory inside Oracle home.
-enableRollingUpgrade
Used in cluster environment, to enable upgrade of a product on a subset of nodes (on which the product was installed).
-executeSysPrereqs
Execute system pre-requisite checks and exit.
-force
Allowing silent mode installation into a non-empty directory.
-help
Displays above usage.
-ignoreSysPrereqs
For ignoring the results of the system pre-requisite checks.
-local
Performs the operation on the local node irrespective of the cluster nodes specified.
-printdiskusage
Log debug information for disk usage.
-printmemory
Log debug information for memory usage.
-printtime
Log debug information for time usage.
-relink
For performing relink actions on the oracle home
Usage: -relink -maketargetsxml [-makedepsxml ] [name=value]
-silent
For silent mode operations, the inputs can be a response file or a list of command line variable value pairs.
-waitforcompletion
Installer will wait for completion instead of spawning the java engine and exiting.
-suppressPreCopyScript
Suppress the execution of precopy script.
-acceptUntrustedCertificates
Accept untrusted certificates from a secure site.
-suppressPostCopyScript
Suppress the execution of postcopy script.
-noconfig
Do not execute config tools.
-noconsole
For suppressing display of messages to console. Console is not allocated.
-formCluster
To install the Oracle clusterware in order to form the cluster.
-remotecp
Unix specific option. Used only for cluster installs, specifies the path to the remote copy program on the local cluster node.
-remoteshell
Unix specific option. Used only for cluster installs, specifies the path to the remote shell program on the local cluster node.
-executePrereqs
To execute only the prerequisite checks.
-ignorePrereq
To ignore running the prerequisite checks.
-ignoreInternalDriverError
To ignore any internal driver errors.
-downloadUpdates
To download updates only.
-showProgress
To show the installation progress on the console. This option is supported only in case of silent installation.
Command Line Variables Usage
Command line variables are specified using ; for example:
[ session: | compName: | compName:version: ]variableName=" valueOfVariable"]
Session/Installer variables are specified using:
[session:]varName=value
Ex 1: session:ORACLE_HOME_NAME="OraHome"
Ex 2: ORACLE_HOME_NAME="OraHome"
The lookup order is session:varName then just varName. The session prefix is used to avoid ambiguity.
Component variables are specified using:
[compInternalName:[Version:]]varName
Ex 1: oracle.comp1:1.0.1:varName="VarValue"
Ex 2: oracle.comp1:varName="VarValue"
The lookup order is compInternalName:Version:varName, then compInternalName:varName, then just varName.
|
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30150152/viewspace-1452043/
,如需转载,请注明出处,否则将追究法律责任。