2 qq 29651709 qq_29651709 于 2015.07.22 14:33 提问

ORA-12504: TNS: 监听程序在CONNECT_DATA 中未获得SERVICE_NA

vs2015客户端C#连接服务器的Oracle数据库,提示ORA-12504: TNS: 监听程序在CONNECT_DATA 中未获得SERVICE_NA
图片说明

listener.ora文件内容:图片说明
tnsnames.ora文件内容:图片说明

2个回答

oyljerry
oyljerry   Ds   Rxr 2015.07.22 15:04

先在system用户下查一下你的数据库实例名是否为“orcl”?:

select value$ from sys.props$ where name='GLOBAL_DB_NAME';


listener.ora文件内容改成如下:

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = D:\app\Administrator\product\11.1.0\db_1)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = ORCL)
      (ORACLE_HOME = D:\app\Administrator\product\11.1.0\db_1)
      (SID_NAME = ORCL)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.6.90)(PORT = 1521))
    )
  )


--tnsnames.ora内容:
LISTENERBOB =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.6.90)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = ORCL)
    )
  )


qq_29651709
qq_29651709 方法不对额
2 年多之前 回复
bingefire
bingefire   2015.07.22 17:06

tnsping orcl 能ok吗?或者你该吧localhost改成Ip地址

qq_29651709
qq_29651709 改成10.1.6.161吗 还是我自己的IP?
2 年多之前 回复
qq_29651709
qq_29651709 能OK。。
2 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片