Syntax for creating Oracle database link
Syntax to create a database link to a target oracle database from another oracle database:
create database link TARGETDB connect to USERID identified by "PASSWORD" using 'TARGETDB';
Now from SOURCEDB the below query will get results from the TARGETDB:
SELECT * FROM TABLENAME@TARGETDB;
General syntax:
create database link LINKNAME connect to USERNAME identified by "PASSWORD" using 'DBNAME';
This has to be executed in oracle source database and not in destination database.
create database link TARGETDB connect to USERID identified by "PASSWORD" using 'TARGETDB';
Now from SOURCEDB the below query will get results from the TARGETDB:
SELECT * FROM TABLENAME@TARGETDB;
General syntax:
create database link LINKNAME connect to USERNAME identified by "PASSWORD" using 'DBNAME';
This has to be executed in oracle source database and not in destination database.
No comments
Please refrain for marketing messages and unnecessary back links.