ORA-12514 TNS:listener 当前不知道连接描述符中请求的服务

ORA-12514 TNS:listener does not currently know of service requested in connect descriptor(ORA-12514 TNS:listener 当前不知道连接描述符中请求的服务)
本文介绍了ORA-12514 TNS:listener 当前不知道连接描述符中请求的服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个在本地运行的应用程序,但遇到以下错误:

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 客户端工作站运行 sqlplus 到远程数据库并责怪 DBA ;) *)

(*I was running sqlplus from Win7 client workstation to remote DB and blame the DBAs ;) *)

这篇关于ORA-12514 TNS:listener 当前不知道连接描述符中请求的服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

SQL to Generate Periodic Snapshots from Transactions Table(用于从事务表生成定期快照的SQL)
MyBatis support for multiple databases(MyBatis支持多个数据库)
Oracle 12c SQL: Missing column Headers in result(Oracle 12c SQL:结果中缺少列标题)
SQL query to find the number of customers who shopped for 3 consecutive days in month of January 2020(查询2020年1月连续购物3天的客户数量)
How to get top 10 data weekly (This week, Previous week, Last month, 2 months ago, 3 month ago)(如何每周获取前十大数据(本周、前一周、上个月、2个月前、3个月前))
Select the latest record for an Id per day - Oracle pl sql(选择每天ID的最新记录-Oracle pl SQL)