Database Links in Oracle

A database link is a schema object in one database that enables you to access objects on another database.

SQL> desc dba_db_links
 Nombre                                                                                     ¨Nulo?   Tipo
 —————————————————————————————— ——– ————————————————————-
 OWNER                                                                                      NOT NULL VARCHAR2(30)
 DB_LINK                                                                                    NOT NULL VARCHAR2(128)
 USERNAME                                                                                            VARCHAR2(30)
 HOST                                                                                                VARCHAR2(2000)
 CREATED                                                                                    NOT NULL DATE

Use the below query to find the db links available for a database:


set lines 152
col owner for a15
col db_link for a30
col username for a15
col host for a30

select owner,db_link,username,host,CREATED
from dba_db_links;

spool db_link_test.sql

select ‘select count(*) from tab@’||db_link||’;’
from dba_db_links;

spool off

spool db_link_output.log

@db_link_test.sql

spool off

=================


How to Test if a DB link is working fine?

select ‘ connect ‘||owner||’/’||owner||’1’||chr(10)||
‘select count(*) from tab@’||db_link||’;’
from dba_db_links;

select distinct owner
from dba_db_links;

22 thoughts on “Database Links in Oracle”

  1. Appreciating the hard work you put into your
    website and detailed information you present. It’s awesome to come across a
    blog every once in a while that isn’t the same unwanted rehashed information.
    Great read! I’ve bookmarked your site and I’m adding your RSS feeds to
    my Google account.

    My blog post :: nordvpn coupons inspiresensation; https://t.co,

  2. 350fairfax nordvpn cashback
    I do not know if it’s just me or if perhaps everybody else encountering issues with your blog.
    It seems like some of the written text within your posts
    are running off the screen. Can someone else please comment and let me know if this is happening to them too?
    This may be a problem with my web browser
    because I’ve had this happen previously. Kudos

  3. Have you ever considered writing an ebook or guest authoring on other websites? I have a blog based upon on the same topics you discuss and would really like to have you share some stories/information. I know my viewers would appreciate your work. If you are even remotely interested, feel free to shoot me an e-mail.

  4. Simply want to say your article is as amazing. The clarity on your post is simply great and that i could think you are an expert in this subject. Well together with your permission let me to take hold of your RSS feed to stay updated with imminent post. Thank you 1,000,000 and please continue the rewarding work.

  5. hi!,I like your writing very much! proportion we be in contact extra approximately your article on AOL?
    I need an expert in this space to resolve my problem. Maybe that is you!
    Looking forward to see you.

  6. Do you have a spam issue on this blog; I also am a blogger, and I was curious about your situation;
    many of us have developed some nice procedures
    and we are looking to exchange techniques with others,
    be sure to shoot me an e-mail if interested.

  7. Howdy I am so delighted I found your website, I really found you by accident, while I was researching on Yahoo for
    something else, Regardless I am here now and would just
    like to say kudos for a marvelous post and a all round enjoyable
    blog (I also love the theme/design), I don’t have time to read through
    it all at the moment but I have book-marked it and also included your RSS feeds, so
    when I have time I will be back to read a great deal
    more, Please do keep up the fantastic work. Eharmony special coupon code 2025
    https://tinyurl.com/yt83ggsk

Leave a Reply

Your email address will not be published. Required fields are marked *