listener does not currently know of SID given in connect descriptor

一次连接数据库怎么也连接不上,查了多方面资料,终于找到答案,总结

首先应该保证数据库的服务启动
在myeclipse的数据库视图中点 右键->new 弹出database driver的窗口,
Driver template选择oracle(thin driver),
Driver name 输入oracle  
connection URL=jdbc:oracle:thin:@localhost:1521:oracle 注意localhost:1521:oracle中的oracle是数据库得sid换成你自己数据库的sid就可以
username:登陆数据库具有system权限的用户名
password:登陆数据库具有system权限的密码
点击add jar 选择ojdbc14.jar的存放位置,没有得可以到百度下一个叫ojdbc14.jar的文件。
点击test driver 到此成功配置。

关于启动数据库后提示ora-12505的解决方法:
"listener does not currently know of SID given in connect descriptor"

第一种可能
是配置得数据库sid名不正确localhost:1521:oracle 即红字部分不是你本机得sid,那么如何查看本机得sid呢?用如下命令 SELECT   NAME   FROM   v$database;在sqlplus中执行就可以看到,把红字部分换成查询出来的sid就可以。
第二种可能
发现sid配置没有错误,但是还是报错,那可能就是oracle得监听配置出了问题,需要检查listener.ora文件,用记事本打开,
正确配置如下:
# listener.ora Network Configuration File: e:\oracle\product\10.2.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = e:\oracle\product\10.2.0\db_1)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = oracle)
      (ORACLE_HOME = e:\oracle\product\10.2.0\db_1)
      (SID_NAME = oracle)
    )
  )
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
  )
红字部分改成oracle创建时候的sid 保存退出。

时间: 2024-08-10 18:13:51

listener does not currently know of SID given in connect descriptor的相关文章

连接oracle数据库出现:ORA-12505,TNS:listener does not currently know of SID given in connect descriptor

Java使用 jdbc:oracle:thin:@11.1.0.14:1521:orcl 连接oracle数据库出现: ORA-12505,TNS:listener does not currently know of SID given in connect descriptor 错误. 表明服务器上sid为orcl的服务并不存在,可以换个方式直接连接服务:把最后一个冒号换为斜杠.顺利连上数据库 jdbc:oracle:thin:@11.1.0.14:1521/orcl

java.sql.SQLException: Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

问题描述: 在使用JDBC连接数据库的时候,报错: java.sql.SQLException: Listener refused the connection with the following error:ORA-12505, TNS:listener does not currently know of SID given in connect descriptor 解决方案: 经检查,是由于连接的URL写错导致,原URL:"jdbc:oracle:thin:@localhost:152

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

引子: 本项目在老电脑上用的是oracle10g,换新电脑装的是oracle11g,但运行项目本没有什么关系,本来说创建个用户,用PLSQL手工导入数据,再改几下配置文件即可跑起来--但实际启动中遇到以下异常导致eclipse不能启动: 2016-01-25 11:34:39,694 DEBUG (com.mchange.v2.resourcepool.BasicResourcePool:1831) - An exception occurred while acquiring a poolab

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

oracle中log.xml报错信息 plsql登录报错信息: 无法请求描述符中的服务 百度了很多,都是一种处理方法,可是对我这里完全不管用,下面是我遇到的两次异常的解决方法: 1.看/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora这个配置文件 # listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/ne

解决Oracle ORA-12505, TNS:listener does not currently know of SID given in connect(转)

http://anthon-lx.iteye.com/blog/811460 完整的错误信息如下: java.sql.SQLException: Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor The Connection descriptor used by th

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

完整的错误信息如下: java.sql.SQLException: Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor The Connection descriptor used by the client was: 192.168.149.128:1521:orcl

ORA 12505 Listener does not currently know of SID given in connection descriptor

一..和以往一样新建完一个Android项目之后,会报android.support.v4....或者V7找不到的错误. 这是因为这两个包在另一个附带的项目(android-support-v7-appcompat)下. 解决办法:右键你刚才建 的项目〉Properties>Android 在下边 点Add  然后把android-support-v7-appcompat添加上就好了. 二.从别的地方直接Import的项目也会报这个错...若是eclipse已经有android-support-

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

这种情况一般因为数据库的实例名没有给,只给了数据库的服务名 什么是数据库实例名?  数据库实例名是用于和操作系统进行联系的标识,就是说数据库和操作系统之间的交互用的是数据库实例名.实例名也被写入参数文件中,该参数为instance_name,在winnt平台中,实例名同时也被写入注册表.  数据库名和实例名可以相同也可以不同.  在一般情况下,数据库名和实例名是一对一的关系,但如果在oracle并行服务器架构(即oracle实时应用集群)中,数据库名和实例名是一对多的关系. 这种情况一般因为数据

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

1. 环境: oracle 11g x64 2. sqlplus 可以正常使用,PLSQLDeveloper登录出错如下: 2. 解决方法:参考http://www.linuxidc.com/Linux/2012-09/69678.htm