Recognizing a connection via a database link, in a logon trigger
mtefftMay 15 2011 — edited May 18 2011Can anyone suggest a means for a logon trigger to (1) recognize that the connection is via a database link and (2) determine the name of the database link?
I want to use this information to ALTER SESSION SET CURRENT_SCHEMA.
Rationale: I have some database links that are defined with credentials for users that have excessive privileges. I want to replace the users on the links with users that have less privileges. However, changing the user would also affect the name resolution. To reduce the risks of this change, I would like to use a logon trigger to detect that the connection is over a database link, determine the name of the link used, and (via an algorithm I hope to delegate to someone unsuspecting) determine how to set the CURRENT_SCHEMA to more closely mimic the current behavior.
I appreciate any suggestions on this.