2016-02-03 107 views
1

我已經配置了帶有數據庫和用戶的Oracle VirtualBox,並填充了一個小型數據庫。 在同一臺機器上,我安裝了Pentaho數據集成(Spoon),JDBC驅動程序,我試圖創建與Oracle DB的連接,但沒有成功。 這是我打字憑據/數據:配置Pentaho數據集成連接到Oracle數據庫

主機名:本地主機

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

端口號:1521

用戶名:SYSTEM

密碼:甲骨文

enter image description here 這是錯誤消息:

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的/勺連接到Oracle數據庫? oracle數據庫似乎工作正常,我也試着用我創建的其他用戶/數據庫,但結果是一樣的。

+1

我想你應該只擁有該字段中的數據庫的名稱。協議,主機和端口已經定義。 – bolav

+0

嘗試刪除端口號。我想你也不需要端口號碼 – Rishu

回答

2

我能夠通過從連接窗口中刪除「主機名」和「端口號」詳細信息來解決同樣的問題。只留下「DB名稱」字符串。

+1

。這樣我成功了連接測試,但是當我使用配置的數據源時,我得到:「IO錯誤:NL異常已生成」。有任何想法嗎? – user2381758

+0

謝謝,這有幫助! –

0

我有類似的問題。可以用這種方式爲客戶端工具解決這個問題,但不能用於carte服務器。

我使用JNDI連接修復了它。

把這個在您的PDI \簡單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>