我们公司用oracle 10,用的是集群服务器,有2个节点.
使用ODBC老是连不上
Unable to connect 
SQLState=08004 
[Oracle][ODBC][Ora]ORA-12154:TNS:could not resolve the connect identifier specified我是用的驱动Oracle inOraClinet10g_home1我E:\oracle\product\10.2.0\client_2\NETWORK\ADMIN\tnsnames.ora内容为:
# tnsnames.ora Network Configuration File: c:\oracle\product\10.2.0\client_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.JDE812 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip)(PORT = 1521))
    (LOAD_BALANCE = yes)
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = JDE812)
      (failover_mode =
        (type = select)
        (method = basic)
      )
    )
  )
我tnsping 可以ping到
C:\Documents and Settings\Administrator>TNSPING JDE812TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 20-10月-
2008 14:30:41Copyright (c) 1997, 2005, Oracle.  All rights reserved.已使用的参数文件:
E:\oracle\product\10.2.0\client_2\network\admin\sqlnet.ora
已使用 TNSNAMES 适配器来解析别名
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vi
p)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip)(PORT = 1521)) (LO
AD_BALANCE = yes) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = JDE812) (
failover_mode = (type = select) (method = basic))))
OK (140 毫秒)路过的神仙,帮帮忙!

解决方案 »

  1.   

    # 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:\oracle\product\10.2.0\db_1)
          (PROGRAM = extproc)
        )
      )LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
          (ADDRESS = (PROTOCOL = TCP)(HOST = vsat1112)(PORT = 1522))
        )
      )# sqlnet.ora Network Configuration File: D:\oracle\product\10.2.0\db_1\network\admin\sqlnet.ora
    # Generated by Oracle configuration tools.# This file is actually generated by netca. But if customers choose to 
    # install "Software Only", this file wont exist and without the native 
    # authentication, they will not be able to connect to the database on NT.SQLNET.AUTHENTICATION_SERVICES= (NTS)NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)# tnsnames.ora Network Configuration File: D:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.LISTENER_ORCL =
      (ADDRESS = (PROTOCOL = TCP)(HOST = vsat1112)(PORT = 1522))
    ORCL =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = vsat1112)(PORT = 1522))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = orcl)
        )
      )EXTPROC_CONNECTION_DATA =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
        )
        (CONNECT_DATA =
          (SID = PLSExtProc)
          (PRESENTATION = RO)
        )
      )我的是这样, 你参考一下
      

  2.   

    参考一下:
    http://www.cnblogs.com/adi-liu/archive/2008/06/22/1227660.html
      

  3.   

    sqlplus也进不去C:\Documents and Settings\Administrator>sqlplus jde812SQL*Plus: Release 10.2.0.1.0 - Production on Mon Oct 20 17:35:04 2008Copyright (c) 1982, 2005, Oracle.  All rights reserved.Enter password:
    ERROR:
    ORA-12560: TNS:protocol adapter error
    Enter user-name: crpdta
    Enter password:
    ERROR:
    ORA-12560: TNS:protocol adapter error
    Enter user-name: crdpta
    Enter password:
    ERROR:
    ORA-12560: TNS:protocol adapter error
    SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*PlusC:\Documents and Settings\Administrator>
      

  4.   

    TNS_ADMIN=<the path of tnsname.ora directory> as and enviornment variable on your machine. 
      

  5.   

    环境变量 TNS_ADMIN= <the path of tnsname.ora directory>
      

  6.   

    环境变量我也设过了
    TNS_NAME=E:\oracle\product\10.2.0\client_2\network\admin不管用啊!
    但是我用 sqlplus username/password@JDE812 
    就可以连接上,企业管理器也没有问题