move dblinks from one database to another

Get metadata from a dblink (or anything else) using dbms_metadata. One of the nice things about this is that it will pull the dblink password and set it in the new database with the ‘BY VALUES’ keywords.

SELECT owner, db_link, DBMS_METADATA.GET_DDL(‘DB_LINK’,DB_LINK, OWNER) as DDL FROM dba_db_links;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s