Skip to Main Content
  • Questions
  • Find database links pointing to an instance

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Paul.

Asked: March 27, 2023 - 10:00 pm UTC

Last updated: March 30, 2023 - 12:49 pm UTC

Version: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0

Viewed 1000+ times

You Asked

With regards to Database Links, I can look at dba_db_links to see what that particular instance's DB Links to other instances. Is there a way to tell which other instances have DB links to the instance that I'm currently in? Maybe entries in the data dictionaries?

For example,
Instance A has a DB_Link -> Instance C & Instance D. I can find these in DBA_DB_LINKS when logged in to Instance A.

However, Instance B has a DB Link -> Instance A. Is there a way to tell, logged in to Instance A, that Instance B has a db link to Instance A?

Thanks,
Paul

and Chris said...

UPDATE 30 March 2023

You can use the view DBA_DB_LINK_SOURCES to see other databases that have made connections to this database.

Thanks to commenter Denis for pointing this out.

Another quick and dirty way is to look to see if there are any sessions connected from a remote database. You can infer this to some extent if V$SESSION.PROGRAM starts "oracle@":

select sid, serial#, username, program
from   v$session
where  program like 'oracle@%';

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

DBA_DB_LINK_SOURCES

Denis, March 30, 2023 - 11:46 am UTC

Looks to me this view is useful to identify db link sources

DBA_DB_LINK_SOURCES identifies all unique source databases that opened database links to the local database.

https://docs.oracle.com/en/database/oracle/oracle-database/21/refrn/DBA_DB_LINK_SOURCES.html#GUID-0E6F0B9A-F816-4791-8DCB-00623DDD7456
Chris Saxon
March 30, 2023 - 12:45 pm UTC

I didn't know about that, thanks for sharing!

A reader, March 30, 2023 - 6:22 pm UTC

Denis,
Wow! That's fantastic. It saves me quite a bit of time looking for sources on other servers.

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database