Q
Problem solve Get help with specific problems with your technologies, process and projects.

Querying remote schema using dblink

I created a dblink pointing to a remote schema. How do I query the remote schema using this dblink?

Here's an example.

Create the link using a fixed user:
CREATE DATABASE LINK homeoffice.ourcompany.com
CONNECT TO scott IDENTIFIED BY tiger
USING 'homeoffice';
To query the employee table on the remote database, you'd query as follows:
SELECT *
  FROM [email protected];
A synonym could be created to hide the remote link entirely:
CREATE SYNONYM employee
   FOR [email protected];
Then you could query like this:
SELECT *
  FROM employee ;
The synonym would resolve the remote reference. The key is to remember that the @ will denote a remote database.

For More Information


Dig Deeper on Oracle hosting, outsourcing and remote DBAs

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close