Wednesday, August 27, 2008

Using dbms_metadata.get_ddl

In Oracle 10g sys.link$ no longer contains a clear text password, so if you need to recreate the database links you need to use the encrypted password. e.g

SET LONG 10000
SELECT dbms_metadata.get_ddl('DB_LINK', 'MY_LINK')FROM dual;

CREATE DATABASE LINK "MY_LINK"
CONNECT TO "TEST_ACCOUNT" IDENTIFIED BY VALUES '05E6F2E494A9AA49D4E0CA5F42300237FE'
USING 'TEST_DB';