What is DB link?
Oracle DB links are used to connect to different sources through procedures/views. It helps creating views or materialized views by pulling data from different db sources.
To check the db links present in the database, the below query can be used.
Query:
select * from dba_db_links;
SQL> desc dba_db_links;
Name Null? Type
----------------------------------------- -------- ----------------------------
OWNER NOT NULL VARCHAR2(128)
DB_LINK NOT NULL VARCHAR2(128)
USERNAME VARCHAR2(128)
HOST VARCHAR2(2000)
CREATED NOT NULL DATE
HIDDEN VARCHAR2(3)
SHARD_INTERNAL VARCHAR2(3)
VALID VARCHAR2(3)
INTRA_CDB VARCHAR2(3)
Create a DB link:
Create or replace database link "<DB link name>" connect as "<remote username>" identified by "<Remote user password>" using "<Remote DB TNS details>";
No comments:
Post a Comment
If you have any queries/ any suggestion please do comment and let me know.