How to execute remote query by Oracle Database Link
989558Feb 15 2013 — edited Feb 15 2013I 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!