database ORA-12505, TNS:listener 当前不知道 connect des 中给出的 SID

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23209962/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 09:14:11  来源:igfitidea点击:

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

databaseoracleoracle11goracle-sqldevelopersqlplus

提问by Jemru

Please kindly help me as I just installed Oracle 11g but cannot connnect using SQL Devloper using the settings below:

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

Username: system

用户名:系统

Password: mypassword

密码:我的密码

Hostname: localhost

主机名:本地主机

Port: 1521

端口:1521

SID: XE

SID:XE

Error message:

错误信息:

Status : Failure -Test failed: Listener refused the connection with the following error:

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

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

ORA-12505, TNS:listener 当前不知道连接描述符中给出的 SID

I checked on Windows Services:

我检查了 Windows 服务:

OracleServiceXE: Started

OracleServiceXE:已启动

OracleXETNSListener: Started

OracleXETNSListener:已启动

I also unable to connect to admin page: **http://localhost:8080/apex/f?p=4950**

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

It says "This page can't be displayed"

提示“无法显示此页面”

I also tested to connect using SqlPlus:

我还测试了使用 SqlPlus 连接:

Test 1: Result is ORA-12170: TNS:Connect timeout occurred

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

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

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

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.

SQL*Plus:2014 年 4 月 22 日星期二 11:22:31 发布 11.2.0.2.0 生产版 版权所有 (c) 1982, 2010,Oracle。版权所有。

ERROR: ORA-12170: TNS:Connect timeout occurred

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

Enter user-name:

输入用户名:

Test 2: Result is Successful

测试 2:结果成功

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

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

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.

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

Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production

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

SQL>

查询>

Test 3: Result is Successful

测试 3:结果成功

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

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

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.

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

Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production

连接到: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:

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> status

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.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

Please kindly help me.

请帮助我。

回答by Isra Habibi

I have same problem, but I run on oracle linux. After searching and testing, i can connect sqldeveloper to my oracle11g without setting my listener.ora or else

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

here is the syntax that i run on terminal sql

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

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

then

然后

alter system register;

i get the tutorial here

我在这里得到教程

回答by Isra Habibi

  1. Open Net Manager. In Oracle Net Configuration, open Local, and then, open Listeners.
  2. Select your Listener.
  3. In the upper right ComboBox, select Database Services.
  4. Clic Add Database.
  5. Fill the 3 fields: Global Database Name(i.e. ORCL.NET. In SQL Plus type SELECT * FROM GLOBAL_NAME), Oracle Home Directory(i.e. C:\app\User\product\11.2.0\dbhome_1) and SID(i.e. orcl)
  6. File > Save Network Configuration.
  7. Restart the OracleOraDb11g_home1TNSListenerservice.
  1. 打开网络管理器。在Oracle Net Configuration 中,打开Local,然后打开Listeners
  2. 选择您的监听器。
  3. 在右上角的 ComboBox 中,选择Database Services
  4. CLIC添加数据库
  5. 填写 3 个字段:全局数据库名称(即 ORCL.NET。在 SQL Plus 中键入 SELECT * FROM GLOBAL_NAME)、Oracle 主目录(即 C:\app\User\product\11.2.0\dbhome_1)和SID(即 orcl)
  6. 文件 > 保存网络配置。
  7. 重新启动OracleOraDb11g_home1TNSListener服务。

回答by hitman1000

For SQL Developer maybe you need to add these parameters

对于 SQL Developer,您可能需要添加这些参数

AddVMOption -Duser.language=en

AddVMOption -Duser.region=US

in the file

在文件中

$SQLDEVELOPER_HOME\sqldeveloper\bin\sqldeveloper.conf

回答by Samapti

if u r using oracle 11g enterprise edition, then do one thing, u just uninstall it, and again reinstall oracle 11g. do all the steps carefully. when installation will finish, then go to start menu-oracle 11g-configuration & migration tool-database configuration assistance. open this & again do configuration here u will give a sid name . that sid will be used when u will create a connection in sql developer insteade of xe. execept this above dont change other. i hope it will be definitely work.

如果您使用的是oracle 11g 企业版,那么做一件事,您只需将其卸载,然后再次重新安装oracle 11g。仔细完成所有步骤。安装完成后,转到开始菜单-oracle 11g-配置和迁移工具-数据库配置帮助。打开这个并再次在此处进行配置,您将给出一个 sid 名称。当您在 sql developer 而不是 xe 中创建连接时,将使用该 sid。除此以外不要改变其他。我希望它肯定会起作用。

回答by user7302314

If you Still getting this Error message:

如果您仍然收到此错误消息:

Status : Failure -Test failed: Listener refused the connection with the following error:

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

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

ORA-12505, TNS:listener 当前不知道连接描述符中给出的 SID

Do following steps: 1. open cmd prompt. 2. c:/ services.msc 3. its navigate to system services console there it self once you check it the OracleServiceXE status. 4.then starts the service status(rightclick>start) wait till status showing the running.

执行以下步骤: 1. 打开 cmd 提示符。2. c:/services.msc 3. 一旦您检查它的 OracleServiceXE 状态,它就会导航到系统服务控制台。4.然后启动服务状态(右键单击>启动)等到状态显示运行。