簡體   English   中英

配置 Pentaho 數據集成以連接到 Oracle DB

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

我已經使用 DB、用戶配置了 Oracle VirtualBox 並填充了一個小 DB。 在同一台機器上,我安裝了 Pentaho Data-Integration(Spoon)、JDBC 驅動程序,我正在嘗試創建與 Oracle DB 的連接,但沒有成功。 這是我輸入憑據/數據的地方:

主機名:本地主機

數據庫名稱:(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCL)))

端口號:1521

用戶名: SYSTEM

密碼:甲骨文

在此處輸入圖片說明 這是錯誤消息:

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)))

如何配置它以將 Pentaho/Spoon 連接到 Oracle DB? oracle DB 似乎工作正常,我也嘗試過使用我創建的其他用戶/數據庫,但結果是一樣的。

通過從連接窗口中刪除“主機名”和“端口號”詳細信息,我能夠解決同樣的問題。 只留下“數據庫名稱”字符串。

我有一個類似的問題。 可以為客戶端工具以這種方式解決它,但不能為點菜服務器解決。

我用 JNDI 連接修復了它。

把它放在你的 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

以及您的 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>

添加

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

到字符串的末尾為我們解決了它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM