The above link describes database links, details when you would use them and shows you how to create and use them. There are even example CREATE DATABASE LINK commands. Once you have created a database link, you can create a synonym for an object accessed through the link as follows:
CREATE SYNONYM remote_table FOR remote_table@link_name;You can create database links in any Oracle database. So which database do you create the link in? The rule of thumb is to create the link in the database that your application will connect to. Assume that your application connects to the database ORCL. While connected to ORCL, the application can query its tables stored in ORCL without any problems. However, you may also want the application to query tables in database ORCL2. So in ORCL, you would create a database link which connects to ORCL2. This way, your application can issue queries to ORCL which are passed to ORCL2 through the database link.
Dig Deeper on Oracle DBA jobs, training and certification
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.