Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Determining calling database via dblink
Hi,
I have a setup where I have 2 remote databases and a local database. I have table1 on my local database, table1 has a before insert trigger which calls a function. My remote databases have views which are simple select * from table1_at_local_db.
How can I determine which database is inserting to table1?
Ideally, I'd like to use something like sys_context and get the global_name of the database which initiated the transaction. I thought of using SYS_CONTEXT ('USERENV','IP_ADDRESS'), but then that will require I keep a list of IP addresses and do the crossref, and if we move a server I'll forget and my app will blow up. Furthermore (since I haven't had a chance to test this yet) I don't even know if I'll get the remote db's IP in this situation.
Any ideas? Help?
Thanks
J
Received on Mon Aug 26 2002 - 19:21:34 CDT