TNS service names ODBC dropdown box garbled, messed up, gibberish

 2011-09

本文仅记录下我解决ODBC 中向 TNS Service Name 下拉框添加数据库服务器选项的问题。

Most likely cause is that there are two or more different Oracle clients installed, with two or more home folders and tnsnames.ora files.

For example, an Oracle 10 client is installed or Oracle XE is installed. Both contain a home folder with tnsnames.ora. Later, the Oracle 11g instant client + ODBC compontents is added. Now there are two home folders.

In this case, the TNS_ADMIN environment variable needs to exist:
  • Create TNS_ADMIN variable via control panel -> system -> advanced -> environment variables -> system variables
  • Set is to one of the admin folders, eg.:

    TNS_ADMIN=D:/Database_installation/oracle/product/10.2.0/db_1/NETWORK/ADMIN

  • picturce as

  • Note: make sure it contains the tnsnames.ora, sqlnet.ora and listener.ora files.
  • Create a ODBC connection using the Oracle driver and check if the "tns service name" dropdown box contains readable entries.

below is my original files

--- tnsnames.ora file------

# tnsnames.ora Network Configuration File: D:/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

PROJ35 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.50.0.35)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = proj35)
    )
  )


dbs107 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.50.0.107)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = dbs107)
    )
  )

--------------------listener.ora  file-----------------

# listener.ora Network Configuration File: D:/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = D:/Database_installation/oracle/product/10.2.0/db_1)
      (PROGRAM = extproc)
    )

(SID_DESC =

(GLOBAL_DBNAME = ORACLE)

(ORACLE_HOME = D:/Oracle/Oracle10g)

(SID_NAME = ORACLE)

)
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = tidemark.achievo.com)(PORT = 1521))
    )
  )

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值