Hi Robbin,

I just went through this myself (I am a newbie).

The key things to look at are: 

1. Your data_config.xml. I created a table called 'foo' and an
ora_data_config.xml file with a simple example to get it working that
looks like this:

<dataConfig>
  <dataSource type="JdbcDataSource" 
              driver="oracle.jdbc.driver.OracleDriver"
              url="jdbc:oracle:thin:@servername.cisco.com:1521:sidname"
              user="scott" 
              password="tiger"/>
  <document>
    <entity name="user" 
            query="SELECT id, username from foo">
    </entity>
  </document>
</dataConfig>

Some gotcha's: 
If your Oracle DB is configured with Service_name rather than SID (ie.
You may be running failover, RAC, etc), the url parameter of jdbc
connection can read like this:

              url="jdbc:oracle:thin:@(DESCRIPTION = (LOAD_BALANCE = on)
(FAILOVER = on) (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =
<your_server_name_here>.cisco.com)(PORT = 1528))) (CONNECT_DATA =
(SERVICE_NAME = <your_service_name>.<your domain>.COM)))"

2. In your solr_config.xml file, add something like this to reference
the above listed file:

  <requestHandler name="/dataimport"
class="org.apache.solr.handler.dataimport.DataImportHandler">
  <lst name="defaults">
    <str name="config">ora-data-config.xml</str>
  </lst>
  </requestHandler>

3. I have Solr1.4 running under Tomcat 6. It looks like you are trying
the jetty example, but pay mind to getting the "cwd" pointing to your
solr home by setting your JNDI path as described in the
dataimporthandler wiki.

4. When it blows up, as it did numerous times for me until I got it
right, check the logs. As I am running under Tomcat, I was able to check
<tomcat_home>\logs\catalina.2009-12-14.log to view DIH errors both upon
restart of Tomcat and after running the DIH.


5. There are some tools to check your JDBC connection you might try
before pulling too much of your hair out. Try here:
http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/content.html

Good Luck!
Ken

-----Original Message-----
From: Turner, Robbin J [mailto:robbin.j.tur...@boeing.com] 
Sent: Monday, December 14, 2009 10:27 AM
To: solr-user@lucene.apache.org
Subject: RE: Request Assistance with DIH

How does this help answer my question?  I am trying to use the
DATAImportHandler Development console.  The url you suggest assumes I
had it working already.  

Looking at my logs and the response to the Development console, it does
not appear that the connection to Oracle is being made.

So if someone could offer some configuration/connection setup directions
I would very much appreciate it.

Thanks
Robbin 

-----Original Message-----
From: Joel Nylund [mailto:jnyl...@yahoo.com] 
Sent: Friday, December 11, 2009 8:26 PM
To: solr-user@lucene.apache.org
Subject: Re: Request Assistance with DIH

add ?command=full-import to your url

http://localhost:8983/solr/dataimport?command=full-import

thanks
Joel

On Dec 11, 2009, at 7:45 PM, Robbin wrote:

> I've been trying to use the DIH with oracle and would love it if 
> someone could give me some pointers.  I put the ojdbc14.jar in both 
> the Tomcat lib and <solr home>/lib.  I created a dataimport.xml and 
> enabled it in the solrconfig.xml.  I go to the http://<solr server>/ 
> solr/admin/dataimport.jsp.  This all seems to be fine, but I get the 
> default page response and doesn't look like the connection to the 
> oracle server is even attempted.
>
> I'm using the Solr 1.4 release on Nov 10.
> Do I need an oracle client on the server?  I thought having the ojdbc 
> jar should be sufficient.  Any help or configuration examples for 
> setting this up would be much appreciated.
>
> Thanks
> Robbin

Reply via email to