需求:Linux平台,安裝完整版Oracle客戶端
Tips:如果只是用到sqlldr,sqlplus功能,可以參考《Linux上oracle精簡版客戶端快速部署》快速部署精簡版;如果需要用到proc等其他功能,建議安裝完整版客戶端。
環境:RHEL5.4 + Oracle client 11.2.0.1
1.安裝前檢查
## 1.1 依賴包 ## 比如RHEL5的依賴包需求:rpm -q 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
建議官方要求的這些依賴包都要安裝上。
1.2 其他信息檢查
服務器的目錄空間和規划、主機CPU、內存等信息。這些一般都符合要求。
主要就是確定接下來的客戶端介質的解壓目錄以及之后客戶端安裝的目錄。
我這里根據實際環境設定的:
客戶端安裝介質解壓目錄:/opt/oclient
客戶端的安裝目錄:/opt/app/oracle/11.2/client
2.配置響應文件
默認的響應文件在解壓的目錄下的client/response目錄下,比如這里是/opt/oclient/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=oracle
-------------------------------------------------------------------------------
Inventory location.
INVENTORY_LOCATION=/opt/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=/opt/app/oracle/11.2/client
-------------------------------------------------------------------------------
Complete path of the Oracle Base.
ORACLE_BASE=/opt/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
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 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 Minimal 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=oracle
INVENTORY_LOCATION=/opt/app/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/opt/app/oracle/11.2/client
ORACLE_BASE=/opt/app/oracle
oracle.install.client.installType=Administrator
<h1 id="3"> 3.靜默安裝客戶端 </h1>
切換到安裝目錄下,執行下面的命令靜默安裝客戶端
./runInstaller -silent -responseFile /opt/oclient/client/response/client_install.rsp
根據提示,最后用root用戶執行兩個腳本,比如這里是:
# /opt/app/oracle/oraInventory/orainstRoot.sh
# /opt/app/oracle/11.2/client/root.sh
<h1 id="4"> 4.配置環境變量 </h1>
/bin/csh環境變量: vi ~/.cshrc
setenv ORACLE_HOME /opt/app/oracle/11.2/client
setenv NLS_LANG "simplified chinese_china.ZHS16GBK"
setenv NLS_DATE_FORMAT "YYYY-MM-DD HH24:Mi:SS"
setenv LD_LIBRARY_PATH $ORACLE_HOME/lib
setenv PATH $ORACLE_HOME/bin:$PATH
最后測試下確定proc命令可用。
$ proc
Pro*C/C++: Release 11.2.0.1.0 - Production on 星期一 4月 25 14:04:52 2016
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
系統默認選項值取自於: /opt/app/oracle/11.2/client/precomp/admin/pcscfg.cfg
選項名稱 當前值 說明
auto_connect 否 允許自動連接到 ops$ 帳戶
char_map charz 正在映射字符數組和字符串
close_on_commit否 關閉所有 COMMIT 游標
cmax 100 用於連接池的 CMAX 值
cmin 2 用於連接池的 CMIN 值
cincr 1 用於連接池的 CINCR 值
ctimeout 0 用於連接池的 CTIMEOUT 值
cnowait 0 用於連接池的 CNOWAIT 值
common_parser 否 使用 Common SQL Front End 進行語法分析
code kr_c 所要生成的代碼類型
comp_charset multi_byte C 編譯器支持的字符集類型
config default 使用另一配置文件覆蓋系統配置文件
cpool 否 支持連接共享
cpp_suffix none 覆蓋默認的 C++ 文件名后綴
db2_array 否 支持 DB2 數組插入/選擇語法
dbms native v6/v7/v8 兼容模式
def_sqlcode 否 生成 '#define SQLCODE sqlca.sqlcode' 宏
define x86_64 定義預處理程序符號
none
duration transaction 設置高速緩存中的對象的連接持續時間
dynamic oracle 指定 Oracle 或 ANSI 動態 SQL 語義
errors 是 錯誤消息是否發送到終端
errtype none intype 文件錯誤的列表文件名
events 否 支持發布-訂閱事件通知
fips none ANSI 不兼容用法的 FIPS 標志
header none 指定預編譯標頭的文件擴展名
hold_cursor 否 控制游標高速緩存中的游標存留數
implicit_svpt 否 在緩沖的插入之前的隱式保存點
iname none 輸入文件的名稱
include none 所含文件的目錄路徑
intype none 類型信息的輸入文件名
lines 否 向生成的代碼添加若干行指令
lname none 覆蓋默認列表文件名
ltype short 在列表文件生成的數據量
maxliteral 1024 生成的字符串字面量的最大長度
maxopencursors 10 高速緩存的打開游標的最大數量
max_row_insert 0 要在插入時緩沖的最大行數
mode oracle 代碼對 Oracle 或 ANSI 規則的順應性
native_types 否 本機浮點/雙精度支持
nls_char none 指定國家語言字符變量
nls_local 否 控制如何完成 NLS 字符語義
objects 是 支持對象類型
oname none 輸出文件的名稱
oraca 否 控制 ORACA 的使用
outline no 在其中創建大綱的類別 [yes/no/
outlnprefix
none 大綱名稱前綴
pagelen 80 列表文件的頁長度
parse full 控制對哪一 非 SQL 代碼進行語法分析
prefetch 1 在游標 OPEN 時預先提取的行數
release_cursor 否 控制從游標高速緩存釋放的游標數
runoutline 否 如果是, 則在數據庫中創建大綱
select_error 是 控制選擇錯誤的標志
sqlcheck syntax 編譯時 SQL 的檢查量
stmt_cache 0 語句高速緩存的大小
sys_include /usr/lib64/gcc/系統標頭文件所在的目錄
/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include
/usr/lib/gcc/x86_64-redhat-linux/4.1.1/include
/usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/include
/usr/include
$ORACLE_HOME/precomp/public
threads 否 表示多線程的應用程序
type_code oracle 使用 Oracle 或動態 SQL 的 ANSI 類型代碼
unsafe_null 否 允許不使用指示符表列的 NULL 提取
userid
none 用戶名/口令 [@dbname] 連接字符串
utf16_charset nchar_charset 由 UTF16 變量使用的字符集表單
varchar 否 允許使用隱式 varchar 結構
version recent 要返回哪一版本的對象
PCC-F-02135, CMD-LINE: 用戶請求幫助