oracle11g客戶端靜默安裝

guyuanli發表於2018-04-03

簡述:

我這裡使用的版本是Oracle 11gr2 client 11.2.0.4

1.建立oraInst.loc檔案

# vi /etc/oraInst.loc

inventory_loc=/u01/app/oraInventory/

inst_group=oinstall

# chmod 664 /etc/oraInst.loc

說明:這一段是在網上看到別人這麼做,具體什麼意思不清楚

2.修改rsp檔案

# pwd

/soft/client/response

# ls

client_install.rsp netca.rsp

# cp client_install.rsp client.rsp

# vi client.rsp

主要修改client_install.rsp指令碼里面幾個引數,這裡非常簡單

#-------------------------------------------------------------------------------

# This variable holds the hostname of thesystem as set by the user.

# It can be used to force the installationto use an alternative   

# hostname rather than using the firsthostname found on the system

# (e.g., for systems with multiplehostnames and network interfaces).

ORACLE_HOSTNAME=Ben.element        (執行hostname命令檢視)

#-------------------------------------------------------------------------------

# Unix group to be set for the inventorydirectory.  

UNIX_GROUP_NAME=oinstall                  (安裝組)

#-------------------------------------------------------------------------------

# Inventory location.

INVENTORY_LOCATION=/u01/app/oraInventory   (產品清單目錄)

#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------

SELECTED_LANGUAGES=en,zh_CN         (安裝語言)

#-------------------------------------------------------------------------------

# Complete path of the Oracle Home  

ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/db_1    ($ORACLE_HOME目錄)

#-------------------------------------------------------------------------------

# Complete path of the Oracle Base.

ORACLE_BASE=/u01/app/oracle     ($ORACLE_BASE目錄)

#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------

#Name      : INSTALL_TYPE

#Datatype  : String

#Description: Installation type of thecomponent.

#

#            The following choices areavailable. The value should contain

#             only one of these choices.

#               - InstantClient

#               - Administrator

#               - Runtime

#               - Custom

#

#Example   : INSTALL_TYPE = "Administrator"

#------------------------------------------------------------------------------

oracle.install.client.installType=Administrator       (四種選擇安裝模式,我選擇管理員模式)

#-------------------------------------------------------------------------------

#Name      

#Datatype  : boolean

#Description: whether or not this is anupgrade installation

#

#             The following choices areavailable. The value should contain

#             only one of these choices.

#               - true

#               - false

#

#Example   : oracle.install.client.upgrading=true

#------------------------------------------------------------------------------

oracle.install.client.upgrading=false       (布林值更新,選擇false,不知道幹嘛用的,估計可以不寫,但是我這裡寫,也安裝成功)

#------------------------------------------------------------------------------

#------------------------------------------------------------------------------

# Specify the auto-updates option. It canbe one of the following:

#   -MYORACLESUPPORT_DOWNLOAD

#   -OFFLINE_UPDATES

#   -SKIP_UPDATES

#------------------------------------------------------------------------------

oracle.installer.autoupdates.option=SKIP_UPDATES      (跳過更新)

以上是要求選擇和配置的幾個引數

3.安裝client

$ /soft/client/runInstaller -silent -ignorePrereq -force -responseFile /oracle/app/oracle/client_install.rsp

Starting Oracle Universal Installer...

Checking Temp space: must be greater than120 MB.   Actual 217203 MB    Passed

Checking swap space: must be greater than150 MB.   Actual 8195 MB    Passed

Preparing to launch Oracle UniversalInstaller from /tmp/OraInstall2013-09-08_01-14-28PM. Please wait...[oracle@GE_GameSrv_A ~]$ [WARNING] [INS-32016] The selected Oracle homecontains directories or files.

  CAUSE: The selected Oracle home contained directories or files.

  ACTION: To start with an empty Oracle home, either remove its contentsor choose another location.

You can find the log of this installsession at:

/u01/app/oraInventory/logs/installActions2013-09-08_01-14-28PM.log

The installation of Oracle Client 11g wassuccessful.     (客戶端成功安裝)

Please check'/u01/app/oraInventory/logs/silentInstall2013-09-08_01-14-28PM.log' for moredetails.

Successfully Setup Software.   (軟體成功安裝)

-silent 表示以靜默方式安裝,不會有任何提示

-noconfig 表示不執行配置助手netca

-responseFile 表示使用哪個響應檔案client_install.rsp

注意:我這裡沒有使用-noconfig引數

安裝結束後,以root使用者執行$ORACLE_HOME下的root.sh(如果客戶端型別是instantClient則不用,但是我選擇instantClient安裝模式,就沒安裝成功過):

#/u01/app/oracle/product/10.2.0/client_1/root.sh

4.驗證安裝有效性

$ plus /nolog

SQL*Plus: Release 11.2.0.4.0 Production onSun Sep 8 07:54:40 2013

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

SQL>

5.配置tnsnames.ora

也可以直接從資料庫copy過來

# vi tnsnames.ora

# tnsnames.ora Network Configuration File:/u01/app/oracle/product/11.2.0.4/db_1/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.

BEN =

(DESCRIPTION =

   (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.8)(PORT = 1521))

   (ADDRESS = (PROTOCOL = TCP)(HOST = 8.8.8.129)(PORT = 1521))

   (CONNECT_DATA =

     (SERVER = DEDICATED)

     (SERVICE_NAME = ben)

    )

  )

6.登入驗證

$ sqlplus scott/tiger@ben

SQL*Plus: Release 11.2.0.4.0 Production onSun Sep 8 08:27:18 2013

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

Connected to:

Oracle Database 11g Enterprise EditionRelease 11.2.0.4.0 - 64bit Production

With the Partitioning, Automatic StorageManagement, OLAP, Data Mining

and Real Application Testing options

SQL>

結束語

雖然執行指令碼靜默安裝的時候,有一點點警告,說一些環境不符合,一些條件不滿足,但是看到提示說成功安裝client,軟體成功安裝就沒問題了。

7.安裝中遇到的問題

invalid stored block lengths  

invalid stored block lengths此報錯資訊一般出現在oracledatabase 安裝或者upgrade patch時   

   

造成此錯誤的原因有以下幾種  

a.)下載的安裝包有問題  

b.)解壓過程中出現問題  

c.)傳輸過程中存在問題  

  

  

解決方案  

a.)重新下載DB安裝包  

b.)重新解壓  

c.)重新上傳到伺服器中,預設開二進位制傳輸  

d.)restart server  

這裡我選擇重新上傳安裝檔案,因為在上傳的過程中遇到一點問題。

8.以下是client.rsp完整資訊

###############################################################################

## Copyright(c) Oracle Corporation1998,2013. All rights reserved.          ##

##                                                                          ##

## Specify values for the variables listedbelow to customize                ##

## your installation.                                                       ##

##                                                                          ##

## Each variable is associated with acomment. The comment                   ##

## can help to populate the variables withthe appropriate                   ##

## values.                                                                                                                                                                                                                                                                       ##

##                                                                          ##

###############################################################################

#-------------------------------------------------------------------------------

# Do not change the following systemgenerated value.

#-------------------------------------------------------------------------------

oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v11_2_0

#-------------------------------------------------------------------------------

# This variable holds the hostname of thesystem as set by the user.

# It can be used to force the installationto use an alternative   

# hostname rather than using the firsthostname found on the system

# (e.g., for systems with multiplehostnames and network interfaces).

ORACLE_HOSTNAME=Ben.element

#-------------------------------------------------------------------------------

# Unix group to be set for the inventorydirectory.  

UNIX_GROUP_NAME=oinstall

#-------------------------------------------------------------------------------

# Inventory location.

INVENTORY_LOCATION=/u01/app/oraInventory/

#-------------------------------------------------------------------------------

# Specify the languages in which thecomponents 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 selectany of the languages.

# Example : SELECTED_LANGUAGES=en,fr,ja

#

# Specify value as the following to selectall the languages.

# Example : SELECTED_LANGUAGES=all_langs

#-------------------------------------------------------------------------------

SELECTED_LANGUAGES=en,zh_CN

#-------------------------------------------------------------------------------

# Complete path of the Oracle Home  

ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/db_1

#-------------------------------------------------------------------------------

# Complete path of the Oracle Base.

ORACLE_BASE=/u01/app/oracle

#-------------------------------------------------------------------------------

#Name      : INSTALL_TYPE

#Datatype  : String

#Description: Installation type of thecomponent.

#

#             The following choices areavailable. The value should contain

#             only one of these choices.

#               - InstantClient

#               - Administrator

#               - Runtime

#               - Custom

#

#Example   : INSTALL_TYPE = "Administrator"

#------------------------------------------------------------------------------

oracle.install.client.installType=Administrator

#-------------------------------------------------------------------------------

#Name      : oracle.install.client.upgrading

#Datatype  : boolean

#Description: whether or not this is anupgrade installation

#

#             The following choices areavailable. The value should contain

#             only one of these choices.

#               - true

#               - false

#

#Example   : oracle.install.client.upgrading=true

#------------------------------------------------------------------------------

oracle.install.client.upgrading=false

#------------------------------------------------------------------------------

# Name      : oracle.install.client.customComponents

# Datatype  : StringList

#

# This property is considered only ifINSTALL_TYPE is set to "Custom"

#

# Description: List of Client Componentsyou would like to install

#

#  The following choices are available. You may specify any

#  combination of these choices.  Thecomponents you choose should

#  be specified in the form "internal-component-name:version"

#  Below is a list of components you may specify to install.

#

# oracle.sqlj:11.2.0.4.0 -- "OracleSQLJ"

# oracle.rdbms.util:11.2.0.4.0 --"Oracle Database Utilities"

# oracle.vm.client:11.2.0.4.0 --"Oracle Java Client"

# oracle.sqlplus:11.2.0.4.0 --"SQL*Plus"

# oracle.dbjava.jdbc:11.2.0.4.0 --"Oracle JDBC/THIN Interfaces"

# oracle.ldap.client:11.2.0.4.0 --"Oracle Internet Directory Client"

# oracle.rdbms.oci:11.2.0.4.0 --"Oracle Call Interface (OCI)"

# oracle.precomp:11.2.0.4.0 -- "OracleProgrammer"

# oracle.xdk:11.2.0.4.0 -- "Oracle XMLDevelopment Kit"

# oracle.network.aso:11.2.0.4.0 --"Oracle Advanced Security"

# oracle.assistants.oemlt:11.2.0.4.0 --"Enterprise Manager Minimal Integration"

# oracle.oraolap.mgmt:11.2.0.4.0 --"OLAP Analytic Workspace Manager and Worksheet"

# oracle.network.client:11.2.0.4.0 --"Oracle Net"

# oracle.network.cman:11.2.0.4.0 --"Oracle Connection Manager"

# oracle.network.listener:11.2.0.4.0 --"Oracle Net Listener"

# oracle.ordim.client:11.2.0.4.0 --"Oracle Multimedia Client Option"

# oracle.odbc:11.2.0.4.0 -- "OracleODBC Driver"

# oracle.has.client:11.2.0.4.0 -- "OracleClusterware High Availability API"

# oracle.dbdev:11.2.0.4.0 -- "OracleSQL Developer"

# oracle.rdbms.scheduler:11.2.0.4.0 --"Oracle Scheduler Agent"

#

#-------------------------------------------------------------------------------

oracle.install.client.customComponents="oracle.sqlj:11.2.0.4.0","oracle.rdbms.util:11.2.0.4.0","oracle.javavm.client:11.2.0.4.0","oracle.sqlplus:11.2.0.4.0","oracle.dbjava.jdbc:11.2.0.4.0","oracle.ldap.client:11.2.0.4.0","oracle.rdbms.oci:11.2.0.4.0","oracle.precomp:11.2.0.4.0","oracle.xdk:11.2.0.4.0","oracle.network.aso:11.2.0.4.0","oracle.assistants.oemlt:11.2.0.4.0","oracle.oraolap.mgmt:11.2.0.4.0","oracle.network.client:11.2.0.4.0","oracle.network.cman:11.2.0.4.0","oracle.network.listener:11.2.0.4.0","oracle.ordim.client:11.2.0.4.0","oracle.odbc:11.2.0.4.0","oracle.has.client:11.2.0.4.0","oracle.dbdev:11.2.0.4.0","oracle.rdbms.scheduler:11.2.0.4.0"

#-------------------------------------------------------------------------------

# Host name to be used for by the Oracle SchedulerAgent.

# This needs to be entered in caseoracle.rdbms.scheduler is selected in the

# list of custom components during custominstall

#

# Example   : oracle.install.client.schedulerAgentHostName = acme.domain.com

#------------------------------------------------------------------------------

oracle.install.client.schedulerAgentHostName=

#------------------------------------------------------------------------------

# Port number to be used for by the OracleScheduler Agent.

# This needs to be entered in caseoracle.rdbms.scheduler is selected in the

# list of custom components during custominstall

#

# Example:oracle.install.client.schedulerAgentPortNumber = 1500

#------------------------------------------------------------------------------

oracle.install.client.schedulerAgentPortNumber=

#------------------------------------------------------------------------------

# Specify the auto-updates option. It canbe one of the following:

#   -MYORACLESUPPORT_DOWNLOAD

#   -OFFLINE_UPDATES

#   -SKIP_UPDATES

#------------------------------------------------------------------------------

oracle.installer.autoupdates.option=SKIP_UPDATES

#------------------------------------------------------------------------------

# In case MYORACLESUPPORT_DOWNLOAD optionis chosen, specify the location where

# the updates are to be downloaded.

# In case OFFLINE_UPDATES option is chosen,specify the location where the updates

# are present.

#------------------------------------------------------------------------------

oracle.installer.autoupdates.downloadUpdatesLoc=

#------------------------------------------------------------------------------

# Specify the My Oracle Support AccountUsername which has the patches download privileges

# to be used for software updates.

#

# Example   :AUTOUPDATES_MYORACLESUPPORT_USERNAME=abc@oracle.com

#------------------------------------------------------------------------------

AUTOUPDATES_MYORACLESUPPORT_USERNAME=

#------------------------------------------------------------------------------

# Specify the My Oracle Support AccountUsername password which has the patches download privileges

# to be used for software updates.

#

# Example   : AUTOUPDATES_MYORACLESUPPORT_PASSWORD=password

#------------------------------------------------------------------------------

AUTOUPDATES_MYORACLESUPPORT_PASSWORD=

#------------------------------------------------------------------------------

# Specify the Proxy server name. Lengthshould be greater than zero.

#

# Example   : PROXY_HOST=proxy.domain.com

#------------------------------------------------------------------------------

PROXY_HOST=

#------------------------------------------------------------------------------

# Specify the proxy port number. Should beNumeric and at least 2 chars.

#

# Example   : PROXY_PORT=25

#------------------------------------------------------------------------------

PROXY_PORT=

#------------------------------------------------------------------------------

# Specify the proxy user name. LeavePROXY_USER and PROXY_PWD

# blank if your proxy server requires noauthentication.

#

# Example   : PROXY_USER=username

#------------------------------------------------------------------------------

PROXY_USER=

#------------------------------------------------------------------------------

# Specify the proxy password. LeavePROXY_USER and PROXY_PWD  

# blank if your proxy server requires noauthentication.

#

# Example   : PROXY_PWD=password

#------------------------------------------------------------------------------

PROXY_PWD=

#------------------------------------------------------------------------------

# Specify the proxy realm.

#

# Example   : PROXY_REALM=metalink

#------------------------------------------------------------------------------

PROXY_REALM=

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7490392/viewspace-2152562/,如需轉載,請註明出處,否則將追究法律責任。

相關文章