Oracle中Error while performing database login with the XXXdriver; Listener refused the connection wit...

简介: Oracle中Error while performing database login with the XXXdriver; Listener refused the connection wit...

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


总结


首先应该保证数据库的服务启动


在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这个路径修改一下切记两个蓝色路径一定要相同


----------------------------------------------------------------------

相关文章
|
2月前
|
SQL Oracle 关系型数据库
WARNING: Too Many Parse Errors With error=911 When Running a JDBC Application Connected to an Oracle 19c database
WARNING: Too Many Parse Errors With error=911 When Running a JDBC Application Connected to an Oracle 19c database (
33 2
|
3天前
|
SQL 移动开发 Java
“\r\n### Error updating database. ,解决问题的思路在于认真参考给的错误提示,看错误提示,这里我的数据表,没有写primary key 导致的
“\r\n### Error updating database. ,解决问题的思路在于认真参考给的错误提示,看错误提示,这里我的数据表,没有写primary key 导致的
|
19天前
|
Oracle 关系型数据库 Linux
Requirements for Installing Oracle Database/Client 19c on OL8 or RHEL8 64-bit (x86-64) (Doc ID 2668780.1)
Requirements for Installing Oracle Database/Client 19c on OL8 or RHEL8 64-bit (x86-64) (Doc ID 2668780.1)
15 0
|
2月前
|
SQL Oracle 关系型数据库
Connect to Autonomous Database Using Oracle Database Tools
Connect to Autonomous Database Using Oracle Database Tools
29 1
|
2月前
|
人工智能 Oracle 关系型数据库
一篇文章弄懂Oracle和PostgreSQL的Database Link
一篇文章弄懂Oracle和PostgreSQL的Database Link
|
2月前
|
人工智能 关系型数据库 数据库
PostgreSQL 常见问题解决方案 - ERROR: database is being accessed by other users
PostgreSQL 常见问题解决方案 - ERROR: database is being accessed by other users
|
2月前
|
SQL Oracle 安全
Oracle Database Vault Access Control Components
Oracle Database Vault Access Control Components
20 0
|
2月前
|
Oracle 安全 关系型数据库
What Is Oracle Database Vault?
The Oracle Database Vault security controls protect application data from unauthorized access, and helps you to comply with privacy and regulatory requirements. You can deploy controls to block privileged account access to application data and control sensitive operations inside the database using
17 0
|
2月前
|
Oracle 关系型数据库
19c 开启Oracle Database Vault
19c 开启Oracle Database Vault
51 1
|
2月前
|
Oracle 关系型数据库 Linux
服务器Centos7 静默安装Oracle Database 12.2
服务器Centos7 静默安装Oracle Database 12.2
153 0