$ su -
# vi /etc/oraInst.loc(加入或修改以下内容,其中/u01/app/oracle是ORACLE_BASE)
inventory_loc=/u01/app/oracle/oraInventory
inst_group=oinstall
# chmod 664 /etc/oraInst.loc
# exit
.建立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 racle.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 (布尔值更新,选择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-responseFile /soft/client/response/client.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.验证安装有效性
$ sqlplus /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