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