Database Links
Check
@/u01/dba/dbs/dblinks.sql
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;
GLOBAL_NAMES
This is a CIS Benchmark requirementCheck
SELECT UPPER(VALUE)
FROM V$SYSTEM_PARAMETER
WHERE UPPER(NAME)='GLOBAL_NAMES';
Multi-tenant version...
SELECT DISTINCT UPPER(V.VALUE),
DECODE (V.CON_ID,0,(SELECT NAME FROM V$DATABASE),
1,(SELECT NAME FROM V$DATABASE),
(SELECT NAME FROM V$PDBS B WHERE V.CON_ID = B.CON_ID))
FROM V$SYSTEM_PARAMETER V
WHERE UPPER(NAME) = 'GLOBAL_NAMES';
Change
ALTER SYSTEM SET GLOBAL_NAMES = TRUE SCOPE = SPFILE;
Bibliography
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/
GLOBAL_NAMEShttps://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/GLOBAL_NAMES.htmlhttps://docs.oracle.com/en/database/oracle/oracle-database/19/admin/distributed-database-concepts.html#GUID-234E1CB5-6B8A-4877-9BAE-11DF82610D27