首页 > 数据库 > Oracle > 正文
Oracle Instant Client的安装和使用
2012-07-05       个评论      
收藏    我要投稿

Oracle Instant Client的安装和使用
 
根据自己需求到Oracle网站(http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html)下载相应的Instant Client版本软件包,各软件包的描述如下:
Instant Client Package
Description  www.2cto.com  
Notes
Basic
All files required to run OCI, OCCI, and JDBC-OCI applications
OCI http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10646/oci01int.htm#i423362
OCCI http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10764/install.htm#CACFFGHF
JDBC http://download.oracle.com/docs/cd/E11882_01/java.112/e16548/instclnt.htm#CIHFDFJC
Basic Lite
Smaller version of the Basic, with only English error messages and Unicode, ASCII, and Western European character set support (10.2 only)
OCI http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10646/oci01int.htm#i423362
OCCI http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10764/install.htm#CACFFGHF
JDBC http://download.oracle.com/docs/cd/E11882_01/java.112/e16548/instclnt.htm#CIHFDFJC
JDBC Supplement*
Additional(附加的) support for XA, Internationalization, and RowSet operations under JDBC
JDBC http://download.oracle.com/docs/cd/E11882_01/java.112/e16548/instclnt.htm#CIHFDFJC
SQL*Plus*
Additional libraries and executable(可执行的) for running SQL*Plus with Instant Client
SQL*Plus 10.2  www.2cto.com  http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ape.htm#sthref3926
SQL*Plus 11.2 http://download.oracle.com/docs/cd/E11882_01/server.112/e16604/apd.htm#CHDCHJJJ
ODBC Supplement*
Additional(附加的) libraries for enabling ODBC applications with Instant Client (Not all platforms)
ODBC   
http://www.oracle.com/technetwork/database/features/oci/odbc-ic-releasenotes-094306.html
SDK*
Additional header files and an example makefile for developing Oracle applications with Instant Client
 
ODAC*
Includes ODP.NET, Oracle Services for MTS, Oracle Providers for ASP.NET, Oracle Provider for OLE DB, and OO4O with Oracle Instant Client
 
标*的为可选软件包。
 
1、以11.2.0.2.0版本为例,下载Basic软件包(要支持中文只能下载Basic软件包)
2、解压缩必须包到C:\Oracle\instantclient_11_2
3、设置环境变量:
NLS_lANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK
TNS_ADMIN=C:\Oracle\instantclient_11_2
Path=C:\Oracle\instantclient_11_2;%Path%
 
为避免访问数据库时出现中文乱码,NLS_lANG的设置很重要;TNS_ADMIN如不设置,tnsnames.ora默认寻址为Instant Client目录下的network\ADMIN目录;%Path%为原有Path变量。
4、参照下面内容编写tnsnames.ora,并保存到安装目录:C:\Oracle\instantclient_11_2
# TNSNAMES.ORA Network Configuration File: C:\oracle\ora90\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
 
#sample  www.2cto.com  
 
#DATABASENAME =
#  (DESCRIPTION =
#    (ADDRESS_LIST =
#      (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
#    )
#    (CONNECT_DATA =
#      (SERVICE_NAME = servicename)
#    )
#  )
 
如果有要连接多个Oracle实例,请继续往该文件中加入其它实例的配置。
5、测试:
C:\Oracle\instantclient_11_2>sqlplus /nolog
 
SQL*Plus: Release 11.2.0.2.0 Production on Fri Sep 9 09:42:06 2011
 
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
 
SQL> conn username/password @ <连接字符串>
 
至此,安装已经完成。PLSQL Developer等工具,以及应用软件都可以正常使用了。
 
附录:Linux下环境变量设置
如解压到了/usr/local/oracle目录,配置好TNS_ADMIN、LD_LIBRARY_PATH等,复制到.bashrc文件部分内容如下:  www.2cto.com  
 
export ORACLE_HOME=/usr/local/oracle
 
export TNS_ADMIN=$ORACLE_HOME/NETWORK/ADMIN
 
export LD_LIBRARY_PATH=$ORACLE_HOME
 
export SQLPATH=$ORACLE_HOME
 
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
 
PATH=$PATH:$ORACLE_HOME
 
export PATH
 
 
作者 中国蓝天
点击复制链接 与好友分享!回本站首页
相关TAG标签
上一篇:Oracle数据恢复情景2-模拟redo log丢失(1)
下一篇:Oracle表空间和数据文件管理
相关文章
图文推荐
文章
推荐
点击排行

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训
版权所有: 红黑联盟--致力于做实用的IT技术学习网站