locked
Oracle Linked Server poor performance RRS feed

  • Question

  • I am currently querying two databases - One in SQL Server and one Oracle, to find records which are in one but not the other (essentially a reconcilliation) this is working fine in MS Access, using 2 passthrough queries to return the results of the 2 databases, then another query to find the data in one but not the other.

     

    I decided to try the linked server approach as I thought this would give me enhanced performance - but strangely enough when I query the oracle database from MS Access the query takes about 22 seconds - whereas when I query the linked server from SQL Server the same query takes about 55 seconds.

     

    The only difernce I can see is the passthrough query in MS Access is connecting using ODBC, an the linked server is connecting using Microsoft OLE DB Provider for Oracle.

     

    Any ideas would be appreciated

    Monday, April 16, 2007 8:06 AM

Answers

  • You don't specify how you are querying the Oracle database but I would guess you are using a 4 part name query against the Oracle data source. Try changing your query to use OpenQuery instead. That is also closer to how a pass-through query in Access would execute.

     

    -Sue

    Monday, April 16, 2007 12:13 PM

All replies

  • You don't specify how you are querying the Oracle database but I would guess you are using a 4 part name query against the Oracle data source. Try changing your query to use OpenQuery instead. That is also closer to how a pass-through query in Access would execute.

     

    -Sue

    Monday, April 16, 2007 12:13 PM
  • Thanks I will give it a go. Is using th 4 part name a bad way to query?

     

    <edit> WOW that is much better thanks very much for your help </edit>

    Monday, April 16, 2007 12:16 PM
  • In and of itself, the four part name isn't necessarily a bad thing but you can send the query over to the server to be executed on the remote data source and force more processing, data filtering on the server. So you can push more processing off to the server. Some people have a hard time with Openquery as the flip side is that you aren't sending transact sql - you need to send the sql syntax used by the remote data source, the other database platform. I've found with Oracle data sources, it's generally better to just use Openquery.

     

    -Sue

    Monday, April 16, 2007 10:56 PM
  • Sue - thanks very much you have been very helpful.  My query now runs in under 15 seconds now.
    Tuesday, April 17, 2007 6:43 AM