gpt4 book ai didi

oracle - ORA-12154 : TNS:could not resolve the connect identifier specified

转载 作者:行者123 更新时间:2023-12-04 07:13:51 25 4
gpt4 key购买 nike

我正在尝试连接到安装在 Linux EL 5 上的 oracle 11g 并收到以下错误

SQL> connect sys/password@ud06 as sysdba
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor

我在network/admin下的listener.ora如下
LISTENER=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=ud06)(PORT=1521))
(ADDRESS=(PROTOCOL=ipc)(KEY=extproc))))

SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=orcl)
(ORACLE_HOME=/home/oracle/app/oracle/product/11g)
(SID_NAME=orcl))
(SID_DESC=
(SID_NAME=plsextproc)
(ORACLE_HOME=/home/oracle/app/oracle/product/11g)
(PROGRAM=extproc)))

我的 tnsnames.ora 如下
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

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

UD06=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = ud06)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)

我的 lsnrctl 状态显示如下:
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ud06.us.server.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 17-FEB-2010 16:23:06
Uptime 0 days 0 hr. 12 min. 33 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/app/oracle/product/11g/network/admin/listener.ora
Listener Log File /home/oracle/app/oracle/product/11g/log/diag/tnslsnr/ud06/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ud06.us.server.com)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
Service "plsextproc" has 1 instance(s).
Instance "plsextproc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

最佳答案

你能 ping ud06 成功吗(作为 ud06,而不是 ud06.us.server.com)?

命令是什么

lsnrctl services

展示?

编辑:
在我看来,也许数据库实例名称实际上不是“orcl”? lsnrctl 服务输出告诉我的是,尽管在 listener.ora 文件中定义了“orcl”服务,但实际上并未运行。

您可以使用服务器上的直接连接登录吗?如果是这样,您使用什么作为 ORACLE_SID 环境变量值?以 SYS 用户身份登录并发出命令:

更改系统寄存器;

然后再次发出 lsnrctl services 命令,看看是否有其他实例没有出现。

此外,正如 Alex 指出的那样,tnsping 命令正在报告一个完全限定的服务名称。编辑 sqlnet.ora 文件并将 NAMES.DEFAULT_DOMAIN 值设置为 NULL(如果它有值)。

编辑 2:服务器上的 tnsping ud06 工作吗?或者我假设客户端和服务器在不同的系统上是错误的?

关于oracle - ORA-12154 : TNS:could not resolve the connect identifier specified,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2285527/

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