also you can add
select /*+deriving_site(table1)*/
to make sure it is executed on dblink
Main Topics
Browse All TopicsI developed a object function call 'decryptPAN' in Oracle and registered this object at my two databases; DB1 and DB2. My application need to access two DB1 and DB2 at the same time. So, i create a DBlink for this.
Let say, my application open database connection to DB1 and need to access Table1 from DB2 in order to get the card no in clear text from DB2. Then, I will issue the SQL statement like this : Select decryptPAN(card number) from Table1
However, i found out that Oracle will use the 'decryptPAN' from DB1 instead of DB2 to decrypt the card no when i issue the SQL command. This cause a performance issue to us when the volume is high. Is that any way to inform oracle to use the 'decryptPAN' object in the DB for the respective table. For eg: If the table is at DB1, then oracle should use 'decryptPAN' at DB1.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Ya. I know it work by adding the @dblink in the select. But, i want to know is there any other way without changing the program. I have a lot of program using this SQL and it cause a lot of impact by make this changes. Furthermore, the programmer have to know the dblink name when they code the program and it is no more transparent to them. Is that anyway we can solve this problem by impose some other setting in ORACLE
option 1
you can create a (public) synonym decryptPAN for decryptPAN@dblink
there must be no such synonym in B1
and the owner of decryptPAN can not use it:
if the owner calls decryptPAN he will always use his own functon instead of the public synonym,
if decryptPAN should not be used on B1 it could be dropped , but all objects that depend on it become invalid (an can be recompiled if the synonym exists )
a private synonym can not be made with the same name as the object
option 2
change decryptPAN
function decryptPAN(p_cardnumber) return ..
is
begin
RETURN decryptPAN@dblin(p_cardnum
end;
ok, you are using this
Select decryptPAN(card number) from Table1
and Table1 is a synonym for table in a linked db, right?
or your query is like this
Select decryptPAN(card number) from Table1@dblink
and you want to use decryptPAN from dblink, and your current db has that function too, and you do not want to change any application code?
looks like you have to touch your code somehow, and the way flow01 proposed above may not solve anything, even if you have a wrapper which calls a function in linked db, oracle will grab all data from linked db, this is my guess, cannot test it, but you can test on your site...
Business Accounts
Answer for Membership
by: HainKurtPosted on 2009-11-04 at 20:01:07ID: 25746667
what happens if you say
er) er)
dblink.decryptPAN(cardnumb
or
decryptPAN@dblink(cardnumb