Oracle database tips logo
Article categories | Blog and News Page | SQL | SQL*Plus | DBA Scripts | Standby dbs | Database Links | Techno webcasts | Oracle Magazine | Free IT Magazines | Oracle Database Hosting Companies | Site Search |
RSS
XML RSS
What is this?
AddThis Feed Button

Social Bookmarking


Free Linux Manuals !


A Newbie's Getting Started Guide to Linux



The GNU/Linux Advanced Administration
-- FREE --
IT Magazine
Subscriptions

Oracle Magazine Oracle Magazine Contains technology strategy articles, sample code, tips, Oracle and partner news, how-to articles for developers and DBAs

WebSite Magazine WebSite Magazine Practical advice, helpful tools and insights for website owners

Dr Dobb's Journal Dr Dobb's Journal enables coders to write the most efficient programs and help in daily programming quandaries

DM Review DM Review is recognized as the premier business intelligence, analytics and data warehousing publication
Various other Free IT magazine subscriptions
NoAdware Free Trial

NoAdware Remove
harmful
adware,
spyware,
trojans,
dialers
and worms!
- Featured ebook -

Database Normalization
by Alf Pedersen

Database Normalization ebook Understand and master how to normalize a database using methods richly documented with graphical ERD and server diagram examples

Manage Oracle Database Links

Always test these 'manage oracle database links' commands on a test server
before implementing them on a production server.

Know your open links

Once you have created and made use of a database link in Oracle,
you might want to keep an eye on the number of concurrent open database links
in your database so you can tune the open_links initialization parameter.

Read more here on limiting concurrent open links.

You will need to query v$dblink to see how many links are open in your session:

SQL> select in_transaction, count(*) from v$dblink 
     group by in_transaction;

IN_   COUNT(*)
--- ----------
YES          1


Here are some interesting columns and descriptions of v$dblink:

db_link           Db link name
owner_id          Owner name
logged_on         Is the database link currently logged on?
protocol          Dblink's communications protocol
open_cursors      Are there any cursors open for the db link ?
in_transaction    Is the db link part of a transaction which 
                  has not been commited or rolled back yet ?
update_sent       Was there an update on the db link ?

 

dba_db_links

To gather information on all database links in your database, query dba_db_links.
You will need dba privileges to see this view, the alternatives are user_db_links and all_db_links.

A user who does not have dba privileges can query all_db_links to see
which db links are available to him.

SQL> select * from dba_db_links;

OWNER      DB_LINK     HOST       CREATED
---------- ----------  ---------- ----------
SCOTT      REMOTEDB    remotedb   23-feb-2008 23:59:05


Some interesting columns:

owner           User who owns the db link, 
                will state 'PUBLIC' if it is a public database link.
db_link         Db link name.
username        The username that was specified if it was hardcoded 
                during the create statement, null if not specified 
                during the create statement.
host            The tnsnames alias specified during the create 
                statement.
created         Date and time of link creation.

Click here to read about troubleshooting database link errors.

Recommended reading:

  • Oracle Online Documentation : Administrator's Guide, Creating Database Links
  • Oracle Online Documentation : SQL Reference, Create Datatabase Link syntax



  • Return from 'manage oracle database links' back to 'oracle database link tutorials'