Kettle 连接失败 Oracle 数据库报 ora-12505 的解决方法(转)

 

 

用kettle新建DB连接的时候总是报错,可是用plsql连接是可以连上,错误信息大致如下:

错误连接数据库 [MIS] : org.pentaho.di.core.exception.KettleDatabaseException:
Error occured while trying to connect to the database

Error connecting to database: (using class oracle.jdbc.driver.OracleDriver)
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:
10.9.202.67:1521:ORCL



org.pentaho.di.core.exception.KettleDatabaseException:
Error occured while trying to connect to the database

Error connecting to database: (using class oracle.jdbc.driver.OracleDriver)
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:
10.9.202.67:1521:ORCL



主机名       : 10.9.202.67
端口           : 1521
数据库名:ORCL

查找资料得知:

jdbc连接数据库的时候,需要使用数据库的sid_name,而不是数据库的services_name
而使用plsql连接数据库的时候,只需要数据库的services_name即可,所以修改连接字符串中的services_name (即连接参数中的database name)为sid_name

PS:查看数据库的sid_name语句:

select INSTANCE_NAME from v$instance;

ORACLE是个分外妖娆的女人,她总能勾起你的欲望,去驾驭她
posted @   临沂东哥  阅读(1227)  评论(1编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
历史上的今天:
2019-08-17 利用游标实现按会计月汇总数据,利用MERGE INTO实现数据库添加或更新
点击右上角即可分享
微信分享提示