How to write a query statement using a DB Link (DBLink) or Database Link? How to query multiple Oracle database servers in one query?
First make sure you have an existing Database Link or DB Link. If you do not have one, you will first need to create a new Database Link.
To create a database link:
From the Database menu | Create | select DB Link
Or
From the Schema Browser | DB Links tab | select "Create Database Link" button.
Then in the Create Database Link window, give your DB Link a name and fill out the database to connect field and username & password fields.
Note: DB Links are used in queries at the end of each table or view name.
SAMPLE QUERY:
1)
SELECT *
FROM <table_name>@<db_link_name>
2)
SELECT *
FROM <table_name>@<db_link_name>, <existing_schema_name>.<table_name> (or just <table_name> for the existing database connection)
* This query will combine results from the DB Link and the existing database connection.
© 2025 Quest Software Inc. ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center