配置使用Oracle InstantClient

Micheal Chen Lv6

date: 2011-02-10 19:44:07

运行基于Oracle的数据如果不使用ADO.NET的话必须安装Oracle客户端。如果仅仅是与Oracle进行数据交互而没有直接管理Oracle功能的话,可以自己配置Oracle Instant Client。配置方法如下:

  1. 版本选择:
    Oracle Instant Client Basic/BasicLite 10.2.0.4(为支持TOAD9)
    ODBC驱动:Oracle ODBC For Win32 10.2.0.4

  2. 将Oracle Instatnt Client解压至X:\Oracle\Client

  3. 将Oracle ODBC解压至X:\Oracle\Client

  4. “控制面板”-“系统”-“高级”-“环境变量”-“系统变量”添加
    NLS_LANG = AMERICAN_AMERICA.ZHS16GBK(或SIMPLIFIED CHINESE_CHINA.ZHS16GBK)
    TNS_ADMIN = X:\Oracle\Client
    Path变量结尾添加X:\Oracle\Client(注:不同的路径用半角分号间隔)

  5. 在X:\Oracle\Client中用添加如下内容的文件,文件名为tnsnames.ora

  6. 在Console下到安装目录,运行odbc_install以安装ODBC驱动

  7. 可以下载单独的Oracle SDK 和Oracle SQL PLUS到安装目录中,解压即可运行

附ORA文件内容与格式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# TNSNAMES.ORA Network Configuration File:
X:\Oracle\Client\tnsnames.ora
# Generated by Oracle configuration tools.

MINEDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =[Your Oracle Server's IP or Name])(PORT = 1521))
)
(CONNECT_DATA =
(SID = [Your Oracle Server's SID])
(SERVER = DEDICATED)
)
)
  1. 附:若ODBC无法连接,则将注册表中HKLM\SOFEWARE\ORACLE下的NLS_LANG修改名字或删除
  • Title: 配置使用Oracle InstantClient
  • Author: Micheal Chen
  • Created at : 2011-02-10 19:44:07
  • Updated at : 2025-03-22 21:00:48
  • Link: https://www.xhis.com/hexo/2011/02/10/notes/配置使用Oracle-InstantClient/
  • License: This work is licensed under CC BY-NC-SA 4.0.
On this page
配置使用Oracle InstantClient