2

I have configured Oracle VirtualBox with DB, user and populated a small 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. 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)))

Port Number: 1521

User Name: SYSTEM

Password: oracle

enter image description here 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? 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.

4

3 回答 3

2

通过从连接窗口中删除“主机名”和“端口号”详细信息,我能够解决同样的问题。只留下“数据库名称”字符串。

于 2016-07-06T19:39:48.463 回答
0

我有一个类似的问题。可以为客户端工具解决此问题,但不适用于 carte 服务器。

我用 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>

于 2017-03-15T20:02:15.230 回答
-1

添加

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

到字符串的末尾为我们解决了它。

于 2019-11-06T22:12:24.313 回答