kettle5.4ODBC和OCI连接配置

1.kettle 5.4 使用JDBC连接的时候报错(测试不同的数据库,发现只是连接11gRAC 的时候会报JDBC的错误)

具体报错如下

java.sql.SQLException: 建数据库连接出现异常:

oracle.jdbc.driver.OracleDriver

jdbc:oracle:thin:@90.12.xx.xx:1521:orcl

ORCL_CON

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:

90.12.xx.xx:1521:orcl

使用sqlplus 进一步测定发现数据库功能正常,尝试其他的连接方式。

2.尝试用ODBC的方式连接:

管理工具-->数据源--用户DSN--添加--选择oracle驱动

在kettle上配置ODBC连接 测试OK!

3.尝试OCI的连接方式报错如下:

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

        Error connecting to database: (using class oracle.jdbc.driver.OracleDriver)
        no ocijdbc11 in java.library.path

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

        Error connecting to database: (using class oracle.jdbc.driver.OracleDriver)
        no ocijdbc11 in java.library.path

            at org.pentaho.di.core.database.Database.normalConnect(Database.java:428)
            at org.pentaho.di.core.database.Database.connect(Database.java:358)
            at org.pentaho.di.core.database.Database.connect(Database.java:311)
            at org.pentaho.di.core.database.Database.connect(Database.java:301)
            at org.pentaho.di.core.database.DatabaseFactory.getConnectionTestReport(DatabaseFactory.java:80)

        主机名       :
        端口           : 1521
        数据库名:orcl

4.google 了一下采取以下方案解决:

在环境变量中设置:

ORACLE_HOME=D:\app\gssjcj\product\11.2.0\dbhome_1
TNS_ADMIN=D:\app\gssjcj\product\11.2.0\dbhome_1\NETWORK\ADMIN
PATH=%ORACLE_HOME%\BIN;%PATH%

tnsnames.ora contains:
J3_CX =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 90.xx.xx.xx)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

Copied OCIJDBC11.dll to the libswt\win64

配置OCI连接:

测试OK!

之后在http://community.pentaho.com/看到如下描述:

OCI

OCI uses the Oracle client installed on the client you‘re currently using. If you are using OCI and an Oracle Net8 client, the JDBC driver version used in Kettle needs to match your Oracle client version. PDI 2.5.0 shipped with version 10.1, 3.0.0 ships with version 10.2. You can either install that version of the Oracle client or change the JDBC driver in PDI if versions don‘t match up.

This is how you change the Oracle JDBC driver in Kettle. Replace files "ojdbc14.jar" and "orai18n.jar" in the directory libext/JDBC of your distribution with the files found in the $ORACLE_HOME/jdbc directory on your server or if the versions are different, with the JDBC driver that matches your Net8 client. For Oracle 11g the drivers are named ojdbc5.jar and ojdbc6.jar.

If you still have issues please remember that the DLL that Oracle uses to connect has to be in your path. If all else fails, try copying the ocijdbc10.dll (might be called different in different versions) to the libswt/win32 folder (or win64).

RAC (Real Application Cluster)

When dealing with a Real Application Cluster or other complex failover oracle situations, please define the connection like this:

·         * Set to native (JDBC) connection type

·         * Leave hostname and port empty (this is also working with a port setting of -1)

·         * Set the database name to something like this...
(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = host1-vip)(PORT =
1521))(ADDRESS = (PROTOCOL = TCP)(HOST = host2-vip)(PORT = 1521))(LOAD_BALANCE
= yes)(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME =
db-service)(FAILOVER_MODE =(TYPE = SELECT)(METHOD = BASIC)(RETRIES = 180)(DELAY
= 5))))

or
(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=PRIMARY_NODE_HOSTNAME)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=SECONDARY_NODE_HOSTNAME)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=DATABASE_SERVICENAME)))

or
(DESCRIPTION=(FAILOVER=ON)(ADDRESS_LIST=(LOAD_BALANCE=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=xxxxx)(PORT=1526))(ADDRESS=(PROTOCOL=TCP)(HOST=xxxx)(PORT=1526)))(CONNECT_DATA=(SERVICE_NAME=somesid)))

Note: This does only work with a
repository based system until 3.0.4. Beginning with 3.0.5 and 3.1 file based
systems do also support this.

时间: 2024-11-06 20:47:46

kettle5.4ODBC和OCI连接配置的相关文章

java oracle thin 和 oci 连接方式实现多数据库的故障切换

一.thin方式 该种方式简便易用非经常见. 当中URL为 jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on) (ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)) (ADDRESS=(PROTOCOL=TCP)(HOST=10.132.111.14)(PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=busi_db))) 当中LOAD_BALANCE=on表示负载开启,

解决使用OCI连接oracle LNK2019: 无法解析的外部符号的问题

据我所知,在使用OCI连接Oracle时出现LNK2019: 无法解析的外部符号问题的情况有两种: 一.没有引入附加依赖项,右键项目->属性->配置属性->链接器->输入中添加oraocci11.lib(视数据库版本而定).或在程序之中添加 #pragma comment(lib , "oraocci11.lib"). 二.64位的机器,64位的oracle数据库,编译为win32.应该编译为64位的程序(在属性,配置管理器中修改).这个问题真是疏忽了.

java oci 连接oracle抛java.lang.UnsatisfiedLinkError: ocijdbc11...

首先成功安装oracle客户端,可用sqlplus工具连接TNSNAMES.ORA配置的本地服务名如: conn user/[email protected] 若连接成功:客户端安装成功. java程序若要采用oci方式连接本地服务,需要进行相应的配置具体可见ORACLE_HOME/jdbc/Readme.txt文件里的说明,其中 部分摘抄如下: Setting Up Your Environment --------------------------- On Windows platform

Android - 设置adb的usb连接配置

设置adb的usb连接配置 本文地址: http://blog.csdn.net/caroline_wendy 把须要測试的手机连接入电脑.通过系统查找USB连接配置,找到厂商ID: 把ID加入进adb_usb.ini; 使用命令: vi ~/.android/adb_usb.ini 如: 0x2717 0x9bb5 使用adb命令: adb kill-server adb start-server 能够方便Android Studio查找USB连接设备.

kubuntu14.04下面vpn(vpnc)连接配置

前几天在公司内部一直配置不了kubuntu14.04下面的vpn,从而无法实现在外网访问公司内网的一些功能:是不方便在回家后继续coding(当然还有其它的事情,如邮件收发等,可以不用在linux下面气虚一个windows系统了,大多数人还得wine一个rtx,方法见附录)功夫不负有心人,今天在计算所配置成功了!(所有命令为手动敲打,如有问题请给我留言) 1)安装网络挂件vpnc,也可以通过新立得终端搜索network-manager找到vpnc组件进行安装 sudo apt-get insta

【j2ee spring】6、spring与数据库的连接配置

spring与数据库的连接配置 这里我们开始使用spring管理来配置数据的操作了 1.首先在xml文件中配置数据的连接 MySQL <bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <!-- results in a setDriverClassName(String) call --&

Cisco 6807XL与Cisco 6800IA连接配置

在这里先用一张老图来说明一下6807XL和6800IA 配置完成后,6800IA就相当于6807XL的一块板卡. 在这里简单地说明一下配置过程,其实配置说起来很简单,但是有几点需要注意一下: 1.设备到手后不要急着去配置,尤其是从来没有接触过的设备. 2.仔细阅读官方的配置文档,这一点很重要.这里附上官方文档如下: http://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst6500/ios/15-1SY/config_guide/sup2

oracle远程连接配置

今日需要对站内所有的空间数据做入库处理,所以在服务器上安装了oracle,在本地需要对其进行连接,在网上查阅了相关资料,整理如下: 远程服务端配置:1. 数据库配置    因为要为外界客户端提供数据服务,所以一定要将 [数据库操作模式] 配置为 "共享服务模式". 我就是犯了这个错误,将操作模式配置成了"专用服务器模式",导至远程客户端无法正常连接.    如果不能确定数据库的操作模式,可以打开ORACLE "Database Configuration

Nginx与Tomcat、Client之间请求的长连接配置不一致问题解决[转]

http://bert82503.iteye.com/blog/2152613 前些天,线上出现“服务端长连接与客户端短连接引起Nginx的Writing.Active连接数过高问题”,这个是由于“服务端使用HTTPs长连接,而客户端使用短连接”引起.这几天,发现Nginx与Tomcat之间也存在同样的问题,原因是两边的相关配置参数不一致引起的.(这是心细活!) 先说说服务为什么使用HTTPs长连接技术?有如下几个原因: 对响应时间要求较高: 服务走的是公网,客户端与服务端的TCP建立的三次握手