ORA-12505, TNS:listener 当前不知道 connect des 中给出的 SID
请帮助我,因为我刚刚安装了 Oracle 11g 但无法使用 SQL Devloper 使用以下设置进行连接:
Please kindly help me as I just installed Oracle 11g but cannot connnect using SQL Devloper using the settings below:
用户名:系统
密码:mypassword
Password: mypassword
主机名:本地主机
端口:1521
SID:XE
错误信息:
状态:失败 - 测试失败:侦听器拒绝连接,错误如下:
Status : Failure -Test failed: Listener refused the connection with the following error:
ORA-12505,TNS:listener 当前不知道连接描述符中给出的 SID
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
我检查了 Windows 服务:
OracleServiceXE:已启动
OracleServiceXE: Started
OracleXETNSListener:已启动
OracleXETNSListener: Started
我也无法连接到管理页面:**http://localhost:8080/apex/f?p=4950**
I also unable to connect to admin page: **http://localhost:8080/apex/f?p=4950**
显示无法显示此页面"
我还测试了使用 SqlPlus 进行连接:
测试 1:结果是 ORA-12170:发生 TNS:连接超时
C:oraclexapporacleproduct11.2.0serverin>sqlplus.exe system/mypassword@XE
C:oraclexeapporacleproduct11.2.0serverin>sqlplus.exe system/mypassword@XE
SQL*Plus:2014 年 4 月 22 日星期二 11:22:31 发布 11.2.0.2.0 生产版版权所有 (c) 1982, 2010,甲骨文.保留所有权利.
SQL*Plus: Release 11.2.0.2.0 Production on Tue Apr 22 11:22:31 2014 Copyright (c) 1982, 2010, Oracle. All rights reserved.
错误:ORA-12170: TNS:Connect 超时发生
ERROR: ORA-12170: TNS:Connect timeout occurred
输入用户名:
测试 2:结果成功
C:oraclexapporacleproduct11.2.0serverin>sqlplus.exe system/mypassword
C:oraclexeapporacleproduct11.2.0serverin>sqlplus.exe system/mypassword
SQL*Plus:2014 年 4 月 22 日星期二 11:33:22 发布 11.2.0.2.0 生产版版权所有 (c) 1982, 2010,甲骨文.保留所有权利.
SQL*Plus: Release 11.2.0.2.0 Production on Tue Apr 22 11:33:22 2014 Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:Oracle 数据库 11g 快捷版 11.2.0.2.0 版 - 生产
Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
SQL>
测试 3:结果成功
C:oraclexapporacleproduct11.2.0serverin>sqlplus.exe/as sysdba
C:oraclexeapporacleproduct11.2.0serverin>sqlplus.exe / as sysdba
SQL*Plus:2014 年 4 月 22 日星期二 11:34:29 发布 11.2.0.2.0 生产版版权所有 (c) 1982, 2010,甲骨文.保留所有权利.
SQL*Plus: Release 11.2.0.2.0 Production on Tue Apr 22 11:34:29 2014 Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:Oracle 数据库 11g 快捷版 11.2.0.2.0 版 - 生产
Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
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:oraclexeapporacleproduct11.2.0server
etworka
dminlistener.ora
Listener Log File C:oraclexeapporaclediag nslsnrNASAYAO2listener
alertlog.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\.pipeEXTPROC1ipc)))
(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 Net Configuration中,打开Local,然后打开Listeners.
- 选择您的监听器.
- 在右上角的组合框中,选择数据库服务.
- 点击添加数据库.
- 填写 3 个字段:全局数据库名称(即 ORCL.NET.在 SQL Plus 中键入 SELECT * FROM GLOBAL_NAME)、Oracle 主目录(即 C:appUserproduct11.2.0dbhome_1)和 SID(即 orcl)
- 文件 > 保存网络配置.
- 重新启动 OracleOraDb11g_home1TNSListener 服务.
相关文章