ORA-12514 TNS:侦听器当前不知道连接描述符中请求的服务 [英] ORA-12514 TNS:listener does not currently know of service requested in connect descriptor
问题描述
我们有一个在本地运行的应用程序,遇到以下错误:
We have an application running locally where we're experiencing the following error:
ORA-12514:TNS:listener当前不知道所请求的服务 在连接描述符中
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
我已经使用TNSPing
测试了连接,该连接可以正确解析,并且
我尝试SQLPlus
尝试连接,但失败,并出现与上述相同的错误.我将此语法用于SQLPlus
:
I've tested the connection using TNSPing
which resolved correctly and
I tried SQLPlus
to try connecting, which failed with the same error as above. I used this syntax for SQLPlus
:
sqlplus username/password@addressname[or host name]
我们已验证:
- 服务器上的TNS侦听器正在运行.
- 服务器上的Oracle本身正在运行.
我们不知道对此环境所做的任何更改. 我们还能测试什么?
We don't know of any changes that were made to this environment. Anything else we can test?
推荐答案
我遇到了这个问题,解决方法是确保tnsnames.ora
中的SERVICE_NAME
在您的数据库中是有效的服务名称.要找出有效的服务名称,可以在oracle中使用以下查询:
I had this issue and the fix was to make sure in tnsnames.ora
the SERVICE_NAME
is a valid service name in your database. To find out valid service names, you can use the following query in oracle:
select value from v$parameter where name='service_names'
我将tnsnames.ora
更新为:
TEST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = *<validhost>*)(PORT = *<validport>*))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = *<servicenamefromDB>*)
)
)
然后我跑了
sqlplus user@TEST
成功! 侦听器基本上是在告诉您,根据数据库,您正在使用的任何service_name都不是有效的服务.
Success! The listener is basically telling you that whatever service_name you are using isn't a valid service according to the DB.
(**我正在从Win7客户端工作站到远程DB上运行sqlplus,并怪DBA;)*)
(*I was running sqlplus from Win7 client workstation to remote DB and blame the DBAs ;) *)
这篇关于ORA-12514 TNS:侦听器当前不知道连接描述符中请求的服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!