Oracle InstantClient安装步骤

2013-07-09

Instant Client allows you to run your applications without installing the standard Oracle client or having an ORACLE_HOME. OCI, OCCI, Pro*C, ODBC, and JDBC applications work without modification, while using significantly less disk space than before. Even SQL*Plus can be used with Instant Client. No recompile, no hassle.

1、下载(需要注册免费的Oracle Web帐户):
http://www.oracle.com/technetwork/database/features/instant-client/index.html
http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
http://download.oracle.com/otn/nt/instantclient/112030/instantclient-basic-nt-11.2.0.3.0.zip
http://download.oracle.com/otn/nt/instantclient/112030/instantclient-sqlplus-nt-11.2.0.3.0.zip

2、将下载的zip文件解压缩到
e:\instantclient_11_2

3、批处理添加PATH环境变量
@echo off
path %PATH%;e:\instantclient_11_2
set tmp=%path%
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v "Path" /t REG_SZ /f /d "%tmp%"

4、创建系统环境变量nls_lang,值为AMERICAN_AMERICA.ZHS16GBK
@echo off
set value=AMERICAN_AMERICA.ZHS16GBK
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v "NLS_LANG" /t REG_SZ /f /d "%value%"

5、x86设置注册表
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Oracle]
"ORACLE_HOME"="E:\\instantclient_11_2"
"ORACLE_BASE"="E:\\instantclient_11_2"
"ORACLE_SID"="MYDB"
"TNS_ADMIN"="E:\\instantclient_11_2"
"NLS_LANG"="AMERICAN_CHINA.ZHS16GBK"

6、x64设置注册表
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Oracle]
"ORACLE_HOME"="E:\\instantclient_11_2"
"ORACLE_BASE"="E:\\instantclient_11_2"
"ORACLE_SID"="MYDB"
"TNS_ADMIN"="E:\\instantclient_11_2"
"NLS_LANG"="AMERICAN_AMERICAN.ZHS16GBK"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Oracle\Key_OraDB11g_home1]
"ORACLE_HOME"="E:\\instantclient_11_2"
"ORACLE_BASE"="E:\\instantclient_11_2"
"ORACLE_SID"="MYDB"
"TNS_ADMIN"="E:\\instantclient_11_2"
"NLS_LANG"="AMERICAN_AMERICAN.ZHS16GBK"

7、设置tnsnames.ora
在e:\instantclient_11_2\network\admin创建文件tnsnames.ora
ORCL_test =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = 192.168.100.5)
(PORT = 1521)
)
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
8、现在你可用PL.SQL.Developer/Toad/Lib128连接Oracle了。

分类:数据库 | 标签: |

相关日志

评论被关闭!