简体   繁体   English

配置 Pentaho 数据集成以连接到 Oracle DB

[英]Configure Pentaho data Integration to connect to Oracle DB

I have configured Oracle VirtualBox with DB, user and populated a small DB.我已经使用 DB、用户配置了 Oracle VirtualBox 并填充了一个小 DB。 In the same machine I've installed Pentaho Data-Integration(Spoon), the JDBC driver and I'm trying to create a connection to Oracle DB but without success.在同一台机器上,我安装了 Pentaho Data-Integration(Spoon)、JDBC 驱动程序,我正在尝试创建与 Oracle DB 的连接,但没有成功。 This is where I'm typing the credentials/data:这是我输入凭据/数据的地方:

Host Name : localhost主机名:本地主机

Database Name : (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCL)))数据库名称:(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCL)))

Port Number : 1521端口号:1521

User Name : SYSTEM用户名: SYSTEM

Password : oracle密码:甲骨文

在此处输入图片说明 This is the error message:这是错误消息:

Error connecting to database [oraConn12c] : 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)
IO Error: NL Exception was generated TNS-04605: Invalid syntax error: Unexpected char or LITERAL "(" before or at  ( DESCRIPTION =


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)
IO Error: NL Exception was generated TNS-04605: Invalid syntax error: Unexpected char or LITERAL "(" before or at  ( DESCRIPTION =


    at org.pentaho.di.core.database.Database.normalConnect(Database.java:459)
    at org.pentaho.di.core.database.Database.connect(Database.java:357)
    at org.pentaho.di.core.database.Database.connect(Database.java:328)
    at org.pentaho.di.core.database.Database.connect(Database.java:318)
    at org.pentaho.di.core.database.DatabaseFactory.getConnectionTestReport(DatabaseFactory.java:80)
    at 
.......
... more  .....
Caused by: java.sql.SQLRecoverableException: IO Error: NL Exception was generated TNS-04605: Invalid syntax error: Unexpected char or LITERAL "(" before or at  ( DESCRIPTION =
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:743)
    at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:666)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:566)
    at java.sql.DriverManager.getConnection(DriverManager.java:664)
    at java.sql.DriverManager.getConnection(DriverManager.java:208)
    at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:569)
    ... 52 more
Caused by: oracle.net.ns.NetException: NL Exception was generated TNS-04605: Invalid syntax error: Unexpected char or LITERAL "(" before or at  ( DESCRIPTION =
    at oracle.net.resolver.AddrResolution.resolveAddrTree(AddrResolution.java:733)
    at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:493)
    at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:595)
    at oracle.net.ns.NSProtocol.connect(NSProtocol.java:230)
    at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1452)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:496)
    ... 58 more

Hostname       : localhost
Port           : 1521
Database name  : (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCL)))

How can I configure it in order to connect Pentaho/Spoon to the Oracle DB?如何配置它以将 Pentaho/Spoon 连接到 Oracle DB? The oracle DB seems to be working fine, I've also tried with other users/databases that I created, but the result is the same. oracle DB 似乎工作正常,我也尝试过使用我创建的其他用户/数据库,但结果是一样的。

I was able to resolve this same issue by removing 'Host Name' and 'Port Number' details from the connection window.通过从连接窗口中删除“主机名”和“端口号”详细信息,我能够解决同样的问题。 Leaving only the 'DB Name' string.只留下“数据库名称”字符串。

I had a similar issue.我有一个类似的问题。 Could solve it that way for the client tool, but not for the carte server.可以为客户端工具以这种方式解决它,但不能为点菜服务器解决。

I fixed it with an JNDI connection.我用 JNDI 连接修复了它。

put this in your pdi\\simple-jdni\\jdbc.properties把它放在你的 pdi\\simple-jdni\\jdbc.properties

mydb/type=javax.sql.DataSource
mydb/driver=oracle.jdbc.driver.OracleDriver
mydb/url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS(PROTOCOL=TCP)(HOST=myhost)(PORT=myport)))(CONNECT_DATA=(SERVICE_NAME=myservicename)))
mydb/user=myuser
mydb/password=mypassword

and this connection in your repositories.xml:以及您的 repositories.xml 中的此连接:

<connection>
<name>JNDI</name>
<server>myserver</server>
<type>ORACLE</type>
<access>JNDI</access>
<database>mydb</database>
<port>myport</port>
<username>myuser</username>
<password>mypassword</password>
<servername/>
<data_tablespace/>
<index_tablespace/>
<attributes>
  <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  <attribute><code>PORT_NUMBER</code><attribute>myport</attribute></attribute>
  <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
  <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
</attributes>

Adding添加

(FAILOVER_MODE=(type=select)(method=basic)(retries=20)(delay=3))))

to the end of the string solved it for us.到字符串的末尾为我们解决了它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM