====== Client connection ======
===== Service names in tnsnames.ora =====
**Simple service configuration for DB :**
=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(Host = )
(Port = )
)
)
(CONNECT_DATA =
(SID = )
)
)
** Service configuration for RAC DB :**
RAC10G.GENCSCP =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 62.185.197.213)(PORT = 1523))
(ADDRESS = (PROTOCOL = TCP)(HOST = 62.185.197.215)(PORT = 1523))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RAC.GENCSCP)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
)
)
)
===== Database links =====
**Check current links :**
set linesize 4000
col owner for a10
col username for a10 heading "USER"
col db_link for a30
col host for a30 heading "SERVICE"
SELECT * FROM DBA_DB_LINKS;
**Check opened Link connections :**
COL DB_LINK FORMAT A25
COL OWNER_ID FORMAT 99999 HEADING "OWNID"
COL LOGGED_ON FORMAT A5 HEADING "LOGON"
COL HETEROGENEOUS FORMAT A5 HEADING "HETER"
COL PROTOCOL FORMAT A8
COL OPEN_CURSORS FORMAT 999 HEADING "OPN_CUR"
COL IN_TRANSACTION FORMAT A3 HEADING "TXN"
COL UPDATE_SENT FORMAT A6 HEADING "UPDATE"
COL COMMIT_POINT_STRENGTH FORMAT 99999 HEADING "C_P_S"
SELECT * FROM V$DBLINK
/
**Create new Public DB link :**
create public database link connect to identified by using '';
**Create new DB link with different owner :**
grant create database link to ;
/
create procedure .
is
begin
execute immediate '
create database link
connect to
identified by
using '''' ';
end;
/
exec .;
/
drop procedure .;
/
**Drop Database link of different user :**
create procedure .
is
begin
execute immediate '
drop database link ';
end;
/
exec .;
drop procedure .;