Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to execute remote query by Oracle Database Link

989558Feb 15 2013 — edited Feb 15 2013
I use Oracle Database Link to query data from SQL Server. The query is like:

select *
from tableA@DL_SqlServer a
join tableB@DL_SqlServer b
on a.ID = b.ID*

tableA and tableB is large and the result is relatively small. This query executes quickly in SQL Server since indexes are built both on the two tables. But it is very slow on Oracle Database Link to SQL Server.

I guess the join operation is performed on Oracle side not on SQL Server side, thus the indexes are not used. Since I just need the joined result, I prefer to perform the query entirely on SQL Server and get the small result only. But I have no privilege to create views on SQL Sevrer.

I konw that using SQL Server's linked server and OPENQUERY function can achieve this goal. I wonder how to do this on Oracle Database Link. Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 15 2013
Added on Feb 15 2013
7 comments
4,012 views