Oracle中Error while performing database login with the XXXdriver; Listener refused the connection with the following error; ORA-12505,TNS:listener does not currently know of SID given inconnect descrip

一次连接数据库怎么也连接不上,查了多方面资料,终于找到答案,总结
首先应该保证数据库的服务启动
在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 保存退出。
---------------------------------------------------------------------
(SID_DESC =
(GLOBAL_DBNAME = oracle)
(ORACLE_HOME = e:\oracle\product\10.2.0\db_1)
(SID_NAME = oracle)
)
GLOBAL_DBNAME= 的内容是用SYSTEM用户登录之后新建sql执行以下代码 :SELECT NAME FROM v$database; 查询出来的数据就是等号后面的内容,切记两个红色字体的名称一定要相同
如果没有这段代码请复制到你的文件中,然后把ORACLE_HOME这个路径修改一下切记两个蓝色路径一定要相同
----------------------------------------------------------------------
Oracle中Error while performing database login with the XXXdriver; Listener refused the connection with the following error; ORA-12505,TNS:listener does not currently know of SID given inconnect descrip的更多相关文章
- Hive中导入Oracle数据错误:Listener refused the connection with the following error: ORA-12505
问题: 今天往Hive中导入Oracle数据的时候碰到了如下错误:Listener refused the connection with the following error: ORA-12505 ...
- Connection to Oracle failed. [66000][12505] Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor .
我安装了Oracle数据库,默认的数据库用户名是system,密码口令是安装过程中你自己设置的.可以先使用命令框,输入 sqlplus system; 然后再输入密码即可. 然后我的数据库连接工具使用 ...
- Listener refused the connection with the following error 错误解决
原文地址 :http://blog.csdn.net/zajin/article/details/17753351 做个备份: 查询数据库当前进程的连接数: select count(*) from ...
- Error while performing database login with the sqljdbc driver:Unable to create connection. Check your URL.
从微软官网下载jdbc驱动包sqljdbc4,运行sqljdbc_4.0.2206.100_chs.exe,将驱动包解压到了Microsoft JDBC Driver 4.0 for SQL Serv ...
- error while performing database login with the xxx driver
在MyEclipse的安装路径下D:\Program Files\MyEclipse 6.0\eclipse下面找到eclipse.ini文件,用记事本打开 eclipse.ini文件 -showsp ...
- Myeclipse连接Mysql数据库时报错:Error while performing database login with the pro driver:unable
driver template: Mysql connector/j(下拉框进行选择) driver name: 任意填,最好是数据库名称,方便查找 connection URL: jdbc:mysq ...
- 66000][12505] Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor oracle.n et.ns.NetException: Listener refuse
新装的idea开发工具后连接数据库出现如题所示错误. 1.网上搜了不少的文章,没有解决我的问题.后来细心看了一下url: 一开始url是这样子的. jdbc:oracle:thin:@:s21_pdb ...
- java.sql.SQLException: Listener refused the connection with the following error: ORA-12505, TNS:list
package DisplayAuthors; import java.sql.*; public class DisplayAuthors { private static final Str ...
- 关于Oracle出现listener refused the connection with the ORA-12505错误,解决方案
出现listener refused the connection with the ORA-12505错误,解决方案: 1.首先重启一下电脑,释放被占用的1521端口 2.重启后打开Oracle D ...
随机推荐
- 【代码笔记】iOS-json文件的使用
一,工程图. 二,代码. - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the ...
- 火狐浏览器sqlite插件
https://addons.mozilla.org/zh-cn/firefox/addon/sqlite-manager/
- MBTIles实现
MBTIles实现 3.1 Compliant(符合) python: raster2mb (write) python: mbutil (read/write) python: landez (wr ...
- 测试sql server服务是否配置正确
最简单的方法: 新建一个testdb.udl文件,双击可出现测试界面
- Java虚拟机(二)对象的创建与OOP-Klass模型
前言 在前一篇文章中我们学习了Java虚拟机的结构原理与运行时数据区域,那么我们大概知道了Java虚拟机的内存的概况,那么内存中的数据是如何创建和访问的呢?这篇文章会给你答案. 1.对象的创建 对象的 ...
- Django ModelForm类生成表单
1. 定义ModelForm类 #froms.py from django import forms from app01.modles import User class UserModelForm ...
- 【SPL标准库专题(8)】 Datastructures:SplFixedArray
SplFixedArray主要是处理数组相关的主要功能,与普通php array不同的是,它是固定长度的,且以数字为键名的数组,优势就是比普通的数组处理更快. 类摘要 SplFixedArray im ...
- 如何使用 Azure PowerShell 在 Azure Marketplace 中查找 Windows VM 映像
本主题介绍如何使用 Azure PowerShell 在 Azure Marketplace 中查找 VM 映像. 创建 Windows VM 时使用此信息来指定 Marketplace 映像. 确保 ...
- centos7安装mysql5.7修改设置密码策略
centos7操作系统在安装mysql5.7社区版之后会有默认密码,通过grep命令在mysqld.log文件中即可找到,如下所示: 标识位置即在初始化安装时mysql的默认密码,然后通过mysql ...
- 访问url地址 但tomcat会发两次请求??
statDate===2017-06-27================2017年7月11日 16:06:43执行成功,共删除0条.2017年7月11日 16:06:43执行成功,共插入48835条 ...