用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

at org.pentaho.di.core.database.Database.normalConnect(Database.java:312)
    at org.pentaho.di.core.database.Database.connect(Database.java:261)
    at org.pentaho.di.core.database.Database.connect(Database.java:223)
    at org.pentaho.di.core.database.Database.connect(Database.java:213)
    at org.pentaho.di.core.database.DatabaseFactory.getConnectionTestReport(DatabaseFactory.java:55)
    at org.pentaho.di.core.database.DatabaseMeta.testConnection(DatabaseMeta.java:2409)
    at org.pentaho.ui.database.event.DataHandler.testDatabaseConnection(DataHandler.java:487)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:294)
    at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:124)
    at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:112)
    at org.pentaho.ui.xul.swt.tags.SwtButton.access$000(SwtButton.java:17)
    at org.pentaho.ui.xul.swt.tags.SwtButton$1.widgetSelected(SwtButton.java:77)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
    at org.eclipse.jface.window.Window.open(Window.java:796)
    at org.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:238)
    at org.pentaho.di.ui.core.database.dialog.XulDatabaseDialog.open(XulDatabaseDialog.java:161)
    at org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate.newConnection(SpoonDBDelegate.java:512)
    at org.pentaho.di.ui.spoon.Spoon.newConnection(Spoon.java:6290)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.pentaho.xul.EventHandler.handleMenuEvent(EventHandler.java:42)
    at org.pentaho.xul.swt.menu.PopupMenu.handleMenuEvent(PopupMenu.java:40)
    at org.pentaho.xul.swt.menu.MenuChoice.handleMenuEvent(MenuChoice.java:77)
    at org.pentaho.xul.swt.menu.MenuChoice.handleEvent(MenuChoice.java:73)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    at org.pentaho.di.ui.repository.dialog.RepositoryExplorerDialog.open(RepositoryExplorerDialog.java:604)
    at org.pentaho.di.ui.spoon.Spoon.exploreRepository(Spoon.java:2894)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.pentaho.xul.EventHandler.handleMenuEvent(EventHandler.java:42)
    at org.pentaho.xul.swt.menu.MenuBar.handleMenuEvent(MenuBar.java:52)
    at org.pentaho.xul.swt.menu.Menu.handleMenuEvent(Menu.java:117)
    at org.pentaho.xul.swt.menu.MenuChoice.handleMenuEvent(MenuChoice.java:77)
    at org.pentaho.xul.swt.menu.MenuChoice.handleEvent(MenuChoice.java:73)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:945)
    at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:5574)
    at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:412)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.pentaho.commons.launcher.Launcher.main(Launcher.java:116)
Caused by: org.pentaho.di.core.exception.KettleDatabaseException:
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

at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:435)
    at org.pentaho.di.core.database.Database.normalConnect(Database.java:296)
    ... 61 more
Caused by: 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:
10.9.202.67:1521:ORCL

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:420)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:430)
    ... 62 more

主机名       : 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;

Kettle 连接失败 Oracle 数据库报 ora-12505 的解决方法(转)的更多相关文章

  1. 本地连接虚拟机 Oracle数据库 报ORA-12541:TNS:no listener

    一.环境 本机环境:win10,pl/sql Developer 虚拟机环境:win10,oracle 11g 1.本机和虚拟机互相ping都可以ping通. 2.虚拟机监听程序已启动. 二.配置文件 ...

  2. oracle数据库升级dbua操作阻塞解决方法(解决ORA-32004报错)

    操作环境 1.SuSE11sp3操作系统 2.oracle 11.2.0.3版本升级到11.2.0.4版本 问题现象   oracle 11.2.0.3版本升级到11.2.0.4版本时执行dbua命令 ...

  3. 执行Oracle存储过程报权限不足的解决方法

    当前Oracle用户sofa拥有connect.dba.resource的角色权限,但奇怪的是却没有执行Oracle Procedure的权限.后来通过查找资料发现:如果sofa用户需要执行Proce ...

  4. navicat连接oracle数据库报ORA-28547: connection to server failed, probable Oracle Net admin error错误的解决方法

    原文:navicat连接oracle数据库报ORA-28547: connection to server failed, probable Oracle Net admin error错误的解决方法 ...

  5. Toad客户端连接Oracle数据库报错 ORA-12170:TNS:连接超时

    Oracle 客户端连接Oracle数据库报错   ORA-12170:TNS:连接超时  排错步骤: 1. 查看网络是否畅通:  打开cmd,ping数据库IP 2. 查看端口是否畅通: 打开cmd ...

  6. 本地未安装Oracle数据库,如何连接远程Oracle数据库

    方法一:用Navicat Premium连接 注意,这里用的要是黄色的版本,而不是只针对Mysql的绿色版本 工具栏选择[工具]-[选项],点击[其他-OCI]    你会发现有个OCI librar ...

  7. ODAC连接远程Oracle数据库时,数据源名称orcl改为gscloud

    今天用ODAC连接远程Oracle数据库时,怎么也连接不上, 更改配置文件的tnsname.ora,使之都一样,并完全配置正确还是出现错误,连接不上. 最后请大神一世,原来是数据源名称的问题. 把数据 ...

  8. plsql连接本地oracle数据库,而远程主机却无法连接,出现无监听程序的解决方法(转)

    原文转自:plsql连接本地oracle数据库,而远程主机却无法连接,出现无监听程序的解决方法 最近在使用plsql连接本地oracle数据库的时候,在同一网络环境中,出现了可以连接本地oracle, ...

  9. 通过MSSQL连接服务器连接至Oracle数据库

    前言 有很多时候,我们需要MSSQL与Oracle进行跨库查询或数据交互.本篇随笔将阐述如何通过MSSQL的连接服务器连接至Oracle数据库,并且读取数据的示例. 具体步骤 首先需要到Oracle的 ...

随机推荐

  1. MSSQL 获取指定日期所在星期的第一天和最后一天日期 获取指定日期坐在月的第一天和最后一天

    ufn_GetWeekFirstAndEndDay    获取指定日期所在星期的第一天和最后一天日期 ALTER FUNCTION [dbo].[ufn_GetWeekFirstAndEndDay]( ...

  2. 用Python写的一个多线程机器人聊天程序

    本人是从事php开发的, 近来想通过php实现即时通讯(兼容windows).后来发现实现起来特别麻烦, 就想到python.听说这家伙在什么地方都能发挥作用.所以想用python来做通讯模块...所 ...

  3. Struts2六、为应用指定多个配置文件

    为了使用Struts.xml更简洁,更利于维护,我们可以把Struts.xml要配置的Action信息分类别放在其他的XML文件中,使用include在struts.xml中加载这些文件: 将Web. ...

  4. 探求C#.Net中ArrayList与Array的区别 【转】

    ArrayList与Array的区别概述     ArrayList 是数组的复杂版本.ArrayList 类提供在大多数 Collections 类中提供但不在 Array 类中提供的一些功能.例如 ...

  5. mac itunes ios 7 升级 出现 this device isn't eligible for the requested build

    今天在对我的iPod 进行iOS7 升级的时候(在mac iTunes 上进行的),一直弹出框提示 解决办法就是 1. 打开HOSTS (Mac 下路径为:/etc/hosts, 至于怎么打开host ...

  6. 【线段树】【4-6组队赛】Problem H

    Problem Description #include <iostream> #include <algorithm> using namespace std; int n, ...

  7. js生成随机数的方法实例总结 [收藏]

    js生成随机数的方法实例总结 js生成随机数主要用到了内置的Math对象的random()方法.用法如:Math.random().它返回的是一个 0 ~ 1 之间的随机数.有了这么一个方法,那生成任 ...

  8. 创建基于maven的项目模版

    我们在实际工作中 ,有些项目的架构是相似的,例如基于 restful的接口项目,如果每次都重新搭建一套架构或者通过拷贝建立一个项目难免有些得不偿失,这里我们可以用maven的archtype建立项目模 ...

  9. asp.net textbox控件基础

    asp.net有两种控件,一种是html控件,一种是asp控件,在说textbox控件之前,先看看按钮的两个命令oncommand和onclick.每次点击按钮后,都会提交命令,但是程序会首先执行Pa ...

  10. SqlServer mssql 按月统计所有部门

    以订单统计为例,前端展示柱状图(Jquery统计): 表及主要字段描述如下:表名:Orders1.日期CreateTime2.金额Amount3.用户UserID 情况一:根据部门统计某一年每月销量( ...