v$link

I’d forgotten about this:

select userid, password from sys.link$

More usefully:

set linesize 300
set trimspool on
set pagesize 0
spool &spoolfile..sql
select ‘–‘ user$.name chr(10)
‘create database link ‘ link$.name ‘ ‘
‘connect to ‘ link$.userid ‘ ‘
‘identified by ‘ link$.userid ‘ ‘
‘using ‘ ”” link$.host ””
‘;’
from sys.link$,
sys.user$
where link$.owner# = user$.user#
/
spool off

Advertisements