Getting password from database link

This post is more a reminder to myself. How to get the password from a databaselink definition? Simple:

select name    as db_link
,      userid  as username
,      utl_raw.cast_to_varchar2
         ( dbms_crypto.decrypt(substr(passwordx,19)
                              , 4353
                              , substr(passwordx,3,16)
                              )
         ) as pwd
from sys.link$ 

Thanks to Paul M. Wright

Of course you need special privileges to select from link$…

Advertisements