Database Links

Check

@/u01/dba/dbs/dblinks.sql

SET LINESIZE 132

COLUMN host FORMAT A10

COLUMN db_link FORMAT A25

COLUMN owner FORMAT A20

COLUMN username FORMAT A20

COLUMN created FORMAT A20

SELECT * FROM dba_db_links

/

Create

Prerequisites

Ensure network name is resolvable...

ping target

where target is the hostname (from DNS or /etc/hosts) of the target server.

Ensure stanzas for target databases are in tnsnames.ora. Check the tnsnames.ora config is resolvable...

tnsping TNS_ALIAS

Create Database Link

sqlplus / as sysdba

CREATE PUBLIC DATABASE LINK &LINK USING '&TNS_ALIAS';

CONNECT AS &USER1

CREATE DATABASE LINK "&LINK" CONNECT TO &TARGETUSER1 IDENTIFIED BY "&TARGETPWD1";

CONNECT AS &USER2

CREATE DATABASE LINK "&LINK" CONNECT TO &TARGETUSER2 IDENTIFIED BY "&TARGETPWD2";

Change Database Link Password

Since 11gR2, it is possible to change the password in a database link without dropping and recreating it...

ALTER DATABASE LINK &dblinkname CONNECT TO &username IDENTIFIED BY &newpassword;

Bibliography


210630.1 - Database Links: Troubleshooting ORA-2085 "database link %s connects to %s"467787.1 - Inserting Data To View Mapped Via Dblink To Remote Table Returns Ora-02069
https://ss64.com/orav/V$DBLINK.htmlhttps://jhdba.wordpress.com/tag/change-database-link-password/ https://jhdba.wordpress.com/2015/09/28/identifying-database-link-usage/