Solved

database link re-creation script

Posted on 2008-10-10
6
2,296 Views
Last Modified: 2013-12-18
How to create a script to generate a script to recreate existing database links in oracle 10g db.

Note :- Kindly note down this is oracle 10g version and passwords are encrypted.

Any suggestion/trick !!!!!!!!!


Thanks in advance.
0
Comment
Question by:kamisid
  • 2
6 Comments
 
LVL 34

Accepted Solution

by:
johnsone earned 250 total points
ID: 22690548
Here is how I used to figure these things out for myself.

Do an export of the user that owns the database link, or create a user and a dummy link and export that.  Then do an import with show=y and the command to recreate the link should be in the output.  There is probably an undocumented syntax to put the encrypted password back in.
0
 
LVL 4

Assisted Solution

by:hqassap
hqassap earned 250 total points
ID: 22747807

Use this:
SELECT DBMS_METADATA.GET_DDL('DB_LINK', db_link, '{owner}') FROM all_db_links;


0
 

Author Comment

by:kamisid
ID: 22780833
is it possible to pull all daabase links from all users by using dbms_metadata.get_ddl('DB_LINK'.....)  ?
0
 
LVL 4

Expert Comment

by:hqassap
ID: 22802263

Typically, yes; but practically, there are some bugs with extracting all DB_Links in one statement. It is better to extract DB_Links schema by schema by login to the DB_LINKS owner and then execute the following statement, then switch to the next schema and execute the statement again and so on..

SELECT DBMS_METADATA.get_ddl ('DB_LINK', db_link)
  FROM user_db_links;

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
report returning null 21 95
VB.Net - CSV to Oracle table 4 68
Create table from select - oracle 6 40
Trying to get a Linked Server to Oracle DB working 21 59
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question