2016-02-03 106 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>