dblink - stored proc [message #626437] |
Mon, 27 October 2014 16:36 |
|
lijjumathew
Messages: 2 Registered: October 2014
|
Junior Member |
|
|
Hi
I have two database A and B and we have a db link.
I have a stored proc in database b say SP1 which accesses tables in database B and gets some values.
1st Approach : I have a scenario where I have to call the stored proc SP1 from database A and get the value returned from SP1 and do some calculations in database A.
I just want to know how the proc gets executed. Does the SP1 gets executed in database B and gets the value ?
2nd Approach : Say I write the same logic that SP1 does in database A accessing the underlying tables from database B using the dblink and do the calculations.
Is this efficient performance wise
Thanks
Matt
|
|
|
|
|
Re: dblink - stored proc [message #626542 is a reply to message #626439] |
Tue, 28 October 2014 15:08 |
Bill B
Messages: 1971 Registered: December 2004
|
Senior Member |
|
|
if it is accessing a large table over the dlink, you might have the procedure on the first database and use the DRIVING_SITE hint to run the code on the other database. It will make a major difference in speed. I had a simple update that was accessing table on a different database and I put in the hint and the update went from 2 hours to 3 seconds.
|
|
|