Oraclezcy 2012-05-19
为了简化Oracle在个人电脑的使用,避免占用不必要的资源,可以不安装Oracle客户端。方法是:使用Oracle InstantClient连接oracle数据库
1 下载相应的程序, 如是10204的instantclient-basic-win32-10.2.0.4.zip (34,742,358 bytes)
或者instantclient-basic-win32-10.2.0.3-20061115.zip
WIN64位系统 下载链接:
http://www.oracle.com/technology/global/cn/software/tech/oci/instantclient/htdocs/winsoft.html?_template=/ocom/print
2 将Oracle Instatnt Client解压。如,至D:/instantclient_10_2
3 环境变量配置: "控制面板"-"系统"-"高级"-"环境变量"-"系统变量"添加
NLS_LANG = AMERICAN_AMERICA.ZHS16GBK(或SIMPLIFIED CHINESE_CHINA.ZHS16GBK)
TNS_ADMIN = D:\instantclient_10_2
LD_LIBRARY_PATH = D:\instantclient_10_2
SQLPATH = D:\instantclient_10_2
Path变量结尾添加D:\instantclient_10_2(注:不同的路径用半角分号;间隔)
4 在D:\instantclient_10_2中用添加如下内容的文件,文件名为tnsnames.ora
5 可以下载单独的Oracle SDK 和Oracle SQL PLUS到安装目录中,解压即可运行
附ORA文件内容与格式
tnsnames.ora
#D:/instantclient_10_2/tnsname.ora
mydb1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =192.168.0.47)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = dedicated)
(SERVICE_NAME = mydb1)
)
)