使用TnsNames别名连接到Oracle DB

时间:2019-03-27 12:04:32

标签: c# database oracle connection-string tnsnames

在我的TnsNamesOra中,

TEST11.12.13.14 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 11.12.13.14)(PORT = 1234))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = TESTNAME)
    )
  )

如果我的连接字符串如下所示:

Data Source = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 11.12.13.14)(PORT = 1234)))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = TEST))); User Id = admin; Password = admin ; DBA Privilege = SYSDBA ; Pooling = false; Connection Timeout = 30" providerName="Oracle.DataAccess.Client

一切正常。

但是我想做这样的事情:

Data Source = TEST11.12.13.14; User Id = admin; Password = admin ; DBA Privilege = SYSDBA ; Pooling = false; Connection Timeout = 30" providerName="Oracle.DataAccess.Client

但是出错了

  

ORA-12154:TNS:无法解析指定的连接标识符

0 个答案:

没有答案