Question on Oracle Public DB link inside Procedures

oracle

Scenario :
A procedure 'XYZ' is created with DB account 'SCOTT'. The procedure uses a public DB link to connect to another database.
We have another user 'EVE' who has access to execute procedures owned by 'SCOTT'.
If procedure XYZ is executed by EVE , how does the public DB link inside the procedure work? Does it use the credentials of SCOTT to connect to Target DB ( the owner) or does it use the credentials of EVE ( the executor)?

Best Answer

This depends on how the link was set up. A public link means it is accessible to anyone to access the link but the credentials used to access the remote DB can either be those of the current user or a specific user.

Take a look at CREATE DATABASE LINK for the full syntax and explanations.