creating a synonym


How to Create Synonym

Database links are notoriously slow, not an optimal solution for applications needing real-time response.
Expect the database link to cause a delay in accessing the remote data.

Here is an example of creating a synonym for scott's database link. 

SQL> create synonym rem_emp for emp@remotedb;

Synonym created.

SQL> select count(*) from rem_emp;

COUNT(*)
----------
14


The other method is to create a view on your remote database's data. 


SQL> create view v_emp as select * from emp@remotedb;

View created.

SQL> select count(*) from v_emp;

COUNT(*)
----------
14


No comments:

java.sql.SQLSyntaxErrorException: Access was denied to the user in MySQL 8.4.

 java.sql.SQLSyntaxErrorException: Access denied for user 'SIT'@'%' to database 'SIT' means the MySQL user SIT does ...