gpt4 book ai didi

database - ORA-12505, TNS :listener does not currently know of SID given in connect des

转载 作者:太空狗 更新时间:2023-10-30 01:59:00 24 4
gpt4 key购买 nike

请帮助我,因为我刚刚安装了 Oracle 11g,但无法使用以下设置使用 SQL Devloper 进行连接:

用户名:系统

密码:我的密码

主机名:localhost

端口:1521

SID:XE

错误信息:

状态:失败 - 测试失败:监听器拒绝连接并出现以下错误:

ORA-12505,TNS:监听器当前不知道连接描述符中给定的 SID

我检查了 Windows 服务:

OracleServiceXE:已启动

OracleXETNSListener:已启动

我也无法连接到管理页面:**http://localhost:8080/apex/f?p=4950**

显示“无法显示此页面”

我还测试了使用 SqlPlus 进行连接:

测试 1:结果为 ORA-12170:TNS:发生连接超时

C:\oracleexe\app\oracle\product\11.2.0\server\bin>sqlplus.exe system/mypassword@XE

SQL*Plus:2014 年 4 月 22 日星期二 11:22:31 发布 11.2.0.2.0 生产版版权所有 (c) 1982、2010,甲骨文。保留所有权利。

错误:ORA-12170: TNS: 发生连接超时

输入用户名:

测试二:结果成功

C:\oracleexe\app\oracle\product\11.2.0\server\bin>sqlplus.exe system/mypassword

SQL*Plus:2014 年 4 月 22 日星期二 11:33:22 发布 11.2.0.2.0 生产版版权所有 (c) 1982、2010,甲骨文。保留所有权利。

连接到:Oracle 数据库 11g 快捷版 11.2.0.2.0 版 - 生产

SQL>

测试3:结果成功

C:\oracleexe\app\oracle\product\11.2.0\server\bin>sqlplus.exe/as sysdba

SQL*Plus:2014 年 4 月 22 日星期二 11:34:29 发布 11.2.0.2.0 生产版版权所有 (c) 1982、2010,甲骨文。保留所有权利。

连接到:Oracle 数据库 11g 快捷版 11.2.0.2.0 版 - 生产

SQL>

Listener.log

22-APR-2014 11:53:51 * (CONNECT_DATA=(SID=XE)(CID=(PROGRAM=SQL Developer)(HOST=__jdbc__)(USER=admin))) * (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=50010)) * establish * XE * 12505
TNS-12505: TNS:listener does not currently know of SID given in connect descriptor

tnsnames.ora:

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

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

ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)

LSNRCTL>状态

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 11.2.0.2.0 - Produ
ction
Start Date 22-APR-2014 14:29:22
Uptime 0 days 0 hr. 56 min. 43 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File C:\oraclexe\app\oracle\product\11.2.0\server\network\a
dmin\listener.ora
Listener Log File C:\oraclexe\app\oracle\diag\tnslsnr\NASAYAO2\listener\
alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=NASAYAO2)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", 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

请帮助我。

最佳答案

我有同样的问题,但我在 oracle linux 上运行。经过搜索和测试,我可以将 sqldeveloper 连接到我的 oracle11g 而无需设置我的 listener.ora 或其他

这是我在终端sql上运行的语法

alter system set LOCAL_LISTENER='(DESCRIPTION_LIST =  (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))))';

然后

alter system register;

我得到了教程 here

关于database - ORA-12505, TNS :listener does not currently know of SID given in connect des,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23209962/

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