您的位置:首页 > 数据库 > Oracle

静默安装oracle client

2017-11-14 11:11 211 查看
原文地址:https://wenku.baidu.com/view/4fb59eb8dc3383c4bb4cf7ec4afe04a1b071b0bf.html

1.安装前准备

yum install -y binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat ld-linux.so.2

建议官方要求的这些依赖包都要安装上。

创建组和用户

groupadd oinstall

useradd oracle -g oinstall

passwd oracle123

创建目录

mkdir -p /u01/app/oracle

chown -R oracle:oinstall /u01/app/oracle

chmod -R 775 /u01/app/

1.2 其他信息检查

客户端安装介质解压目录:/home/oracle

客户端的安装目录:/u01/app/oracle/11.2/client

2.配置响应文件

默认的响应文件在解压的目录下的client/response目录下,比如这里是/home/oracle/client/response/client_install.rsp,内容如下:

$ more /opt/oclient/client/response/client_install.rsp

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

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

## ##

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

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

# Do not change the following system generated value.

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

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

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

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

# 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=ora-client-001

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

# Unix group to be set for the inventory directory.

UNIX_GROUP_NAME=oinstall

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

# Inventory location.

INVENTORY_LOCATION=/u01/app/oraInventory

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

# 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

#

# Example : SELECTED_LANGUAGES=en,fr,ja

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

SELECTED_LANGUAGES=en,zh_CN

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

# Complete path of the Oracle Home

ORACLE_HOME=/u01/app/oracle/11.2/client

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

# Complete path of the Oracle Base.

ORACLE_BASE=/u01/app/oracle

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

#Name : INSTALL_TYPE

#Datatype : String

#Description: Installation type of the component.

#

# The following choices are available. The value should contain

# only one of these choices.

# InstantClient : InstantClient

# Administrator : Administrator

# Runtime : Runtime

# Custom : Custom

#

#Example : INSTALL_TYPE = "Administrator"

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

oracle.install.client.installType=Administrator

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

# Name : oracle.install.client.customComponents

# Datatype : StringList

#

# This property is considered only if INSTALL_TYPE is set to "Custom"

#

# Description: List of Client Components you would like to install

#

# The following choices are available. You may specify any

# combinat

ion 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 install.

#

# oracle.sqlj:11.2.0.1.0 -- "Oracle SQLJ"

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

# oracle.javavm.client:11.2.0.1.0 -- "Oracle Java Client"

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

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

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

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

# oracle.precomp:11.2.0.1.0 -- "Oracle Programmer"

# oracle.xdk:11.2.0.1.0 -- "Oracle XML Development Kit"

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

# oracle.assistants.oemlt:11.2.0.1.0 -- "Enterprise Manager Mi
12920
nimal Integration"

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

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

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

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

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

# oracle.ons:11.2.0.0.0 -- "Oracle Notification Service"

# oracle.odbc:11.2.0.1.0 -- "Oracle ODBC Driver"

# oracle.has.client:11.2.0.1.0 -- "Oracle Clusterware High Availability API"

# oracle.dbdev:11.2.0.1.0 -- "Oracle SQL Developer"

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

#

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

oracle.install.client.customComponents="oracle.sqlj:11.2.0.1.0","oracle.rdbms.util:11.2.0.1.0","oracle.javavm.client:11.2.0.1.0","oracle.sqlplus:11.2.0.1.0","oracle.db

java.jdbc:11.2.0.1.0","oracle.ldap.client:11.2.0.1.0","oracle.rdbms.oci:11.2.0.1.0","oracle.precomp:11.2.0.1.0","oracle.xdk:11.2.0.1.0","oracle.network.aso:11.2.0.1.0"

,"oracle.assistants.oemlt:11.2.0.1.0","oracle.oraolap.mgmt:11.2.0.1.0","oracle.network.client:11.2.0.1.0","oracle.network.cman:11.2.0.1.0","oracle.network.listener:11.

2.0.1.0","oracle.ordim.client:11.2.0.1.0","oracle.ons:11.2.0.0.0","oracle.odbc:11.2.0.1.0","oracle.has.client:11.2.0.1.0","oracle.dbdev:11.2.0.1.0","oracle.rdbms.sched

uler:11.2.0.1.0"

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

#Name : MTS_PORT

#Datatype : int

#Description: Port number to be used for by the Oracle MTS Recovery Service to listen

# for requests. This needs to be entered in case oracle.ntoramts is

# selected in the list of custom components in custom install

#

#

#Example : MTS_PORT = 2030

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

oracle.install.client.oramtsPortNumber=

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

# Host name to be used for by the Oracle Scheduler Agent.

# This needs to be entered in case oracle.rdbms.scheduler is

selected in the

# list of custom components during custom install

#

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

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

oracle.install.client.schedulerAgentHostName=

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

# Port number to be used for by the Oracle Scheduler Agent.

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

# list of custom components during custom install

#

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

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

oracle.install.client.schedulerAgentPortNumber=

上面看起来内容较多,实际上主要就根据实际环境修改了这些值,其他默认或不填即可:

ORACLE_HOSTNAME=ora-client-001

UNIX_GROUP_NAME=oinstall

INVENTORY_LOCATION=/u01/app/oraInventory

SELECTED_LANGUAGES=en,zh_CN

ORACLE_HOME=/u01/app/oracle/11.2/client

ORACLE_BASE=/u01/app/oracle

oracle.install.client.installType=Administrator

3.静默安装客户端oracel用户下

切换到安装目录下,执行下面的命令静默安装客户端

./runInstaller -silent -responseFile /home/oracle/client/response/client_install.rsp -ignoreSysPrereqs

根据提示,最后用root用户执行脚本:

# /o01/app/oracle/11.2/client/root.sh

4.配置环境变量

su - oracle

h环境变量: vi .bash_profile

export ORACLE_HOME /u01/app/oracle/11.2/client

export NLS_LANG "simplified chinese_china.ZHS16GBK"(根据情况)

export NLS_DATE_FORMAT "YYYY-MM-DD HH24:Mi:SS"

export LD_LIBRARY_PATH $ORACLE_HOME/lib

export PATH $ORACLE_HOME/bin:$PATH

5.生效环境变量

source .bash_profile

6.登陆sqlplus

sqlplus / nolog
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: