Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How do I find out where a database link goes

hufftonJul 25 2014 — edited Jul 26 2014

The problem is that we have test environments which are copies of production. If due to an error or an oversight a database link is not recreated, we end up with a database link in a test system pointing to production, with the possibility of poisoning the target system with test data.

We are trying to build a script to prove that we are pointing at the right place. The problem with database links as we all know is that you need to read the dba_db_links view, then look in the tnsnames.ora, then piece the data together.

Is there a simpler way of doing this?

For example, if the remote user had appropriate privileges I could do:

select host_name, instance_name from v$instance@dblink;

But we don't control all the remote databases, so we can't rely on this.

Does anyone have any clever ideas, or do I have to write a script to join the view and tnsnames?

Thanks

PaulH

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 23 2014
Added on Jul 25 2014
8 comments
4,776 views