gpt4 book ai didi

java - ORA-12514 : TNS:listener does not currently know of service requested in connect descriptor

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:25:52 25 4
gpt4 key购买 nike

我在尝试通过监听器连接到 Oracle 数据库 XE 时遇到问题:

 sqlplus system/my_password@XE

我收到以下错误:

ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor

我使用 Ubuntu 12.10 和 Oracle Express Edition 11g。

我的主要目标是将 java + oracle db 与 jdbc 连接起来,但我遇到了同样的错误。

这是我的listener.ora

# listener.ora Network Configuration File:

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
(PROGRAM = extproc)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = watson)(PORT = 1521))
)
)

DEFAULT_SERVICE_LISTENER = (XE)

和 tnsnames.ora

# tnsnames.ora Network Configuration File:

XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = watson)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)

EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)

lsnrctl service

LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 04-FEB-2014 17:01:44
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
The command completed successfully

最佳答案

我不得不在 Windows 服务中重新启动我的 OracleServiceXE 服务,它又可以工作了。

关于java - ORA-12514 : TNS:listener does not currently know of service requested in connect descriptor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21553557/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com