Here is a simple script to extract the DB Links DDL with the encripted password.

SET LONG 9000 -- to print the complete string

SELECT DBMS_METADATA.GET_DDL('DB_LINK',a.db_link,a.owner) 
FROM dba_db_links a;

7 responses to “How to extract the DB LINKS DDL with the password”

  1. Jack Nicholson Avatar

    Ohh..It is really great tip. Can you tell me it provides encrypted password or simple password? Thanks for sharing.

    Like

  2. Muneer Alam Avatar

    thats helpful. Thanks Alex

    Like

  3. Bikash Kumar Avatar
    Bikash Kumar

    By using above query,I didn’t get real password details.Hence my LIVE account has locked suddenly.

    Noone is able to provide the password.

    Like

    1. Alex Lima Avatar

      I do recommend to test it before you execute anything in your production systems at your own risk.

      In the Disclaimer:
      I do not recommend apply any information posted here in your production system without fully test it in your testing systems.

      Like

  4. afvms Avatar
    afvms

    Great tip! Very useful!

    Like

  5. sudheergodgerigmailcom Avatar
    sudheergodgerigmailcom

    SELECT ‘CREATE ‘
    || DECODE (U.NAME, ‘PUBLIC’, ‘PUBLIC ‘)
    || ‘DATABASE LINK “‘
    || DECODE (U.NAME, ‘PUBLIC’, NULL, U.NAME || ‘.’)
    || L.NAME
    || ‘” CONNECT TO “‘
    || L.USERID
    || ‘” IDENTIFIED BY VALUES ”’
    || L.PASSWORDX
    || ”’ USING ”’
    || L.HOST
    || ””
    || CHR (10)
    || ‘;’
    TEXT
    FROM sys.link$ L, sys.user$ U
    WHERE L.OWNER# = U.USER#;

    — i found this on net dont recall the site but this should work

    Like

  6. ISHA VERMA Avatar
    ISHA VERMA

    Thanks, itr works :)

    Like

Leave a reply to sudheergodgerigmailcom Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.