DBMS_SESSION.CLOSE_DATABASE_LINK

Hello,
The CLOSE_DATABASE_LINK procedure is used to close an open but inactive database link in the session.

Determining Which Links Are in the Database

The following views show the database links that have been defined at the local database and stored in the data dictionary:

DBA_DB_LINKS Lists all database links in the database.
ALL_DB_LINKS Lists all database links accessible to the connected user.
USER_DB_LINKS Lists all database links owned by the connected user.

Show all db link in my database :

COL OWNER FORMAT a10
COL USERNAME FORMAT A8 HEADING "USER"
COL DB_LINK FORMAT A30
COL HOST FORMAT A7 HEADING "SERVICE"
SELECT * FROM DBA_DB_LINKS;

Example for PLSQL commands : 

To close a database link named LOOPBACK, specify the following:

BEGIN
   DBMS_SESSION.CLOSE_DATABASE_LINK('DBLINKNAME');
END;

Example for SQLcommands : 

alter session close database link DBLINKNAME;

Hits: 10

Leave a Reply

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