Saturday, February 25, 2012

Oracle link performance is horible

I have a simple select statement that I execute against an Oracle database i
n
PL/SQL and the results are, for the purposes of this discuaaion,
instantaneous.
I have that Database linked to my SQL server. If I perform that same select
statement to the oracle server:
SELECT X,Y,Z FROM SERVER..SCHEMA.TABLE
it takes 1 minute 14 seconds.
What's up with that? Any ideas, folks?select X,Y,Z FROM openquery(oraserver,'select X,Y,Z from oraTABLE')
"David Jessee" <DavidJessee@.discussions.microsoft.com> wrote in message
news:0CA663E4-0A8F-435D-9087-861D6B5C4580@.microsoft.com...
> I have a simple select statement that I execute against an Oracle database
in
> PL/SQL and the results are, for the purposes of this discuaaion,
> instantaneous.
> I have that Database linked to my SQL server. If I perform that same
select
> statement to the oracle server:
> SELECT X,Y,Z FROM SERVER..SCHEMA.TABLE
> it takes 1 minute 14 seconds.
> What's up with that? Any ideas, folks?|||That helped a lot. Thanks.
However. I can't use a parameterized query...can I?
DECLARE @.someValue varchar(30)
select X,Y,Z FROM openquery(oraserver,'select X,Y,Z from oraTABLE WHERE
x='+@.someValue)
"CK" wrote:

> select X,Y,Z FROM openquery(oraserver,'select X,Y,Z from oraTABLE')
> "David Jessee" <DavidJessee@.discussions.microsoft.com> wrote in message
> news:0CA663E4-0A8F-435D-9087-861D6B5C4580@.microsoft.com...
> in
> select
>
>|||You can do it, but you'd need to make the statement dynamic sql. I don't
have an oracle connection to test it. I've done this before and you really
have to play with the quoting to get it right...but it will work.
Something like this:
DECLARE @.someValue varchar(30)
declare @.cmd varchar(1000)
set @.cmd = 'select X,Y,Z FROM openquery(oraserver,'''select X,Y,Z from
oraTABLE WHERE x='''+@.someValue)''
exec (@.cmd)
"David Jessee" <DavidJessee@.discussions.microsoft.com> wrote in message
news:13E1AA87-0199-4CFA-BCA5-DB09D0945321@.microsoft.com...
> That helped a lot. Thanks.
> However. I can't use a parameterized query...can I?
> DECLARE @.someValue varchar(30)
> select X,Y,Z FROM openquery(oraserver,'select X,Y,Z from oraTABLE WHERE
> x='+@.someValue)
>
>
> "CK" wrote:
>
database

No comments:

Post a Comment