Oracle 23.26ConnectionLab-verified · 2026-12-02

ORA-02019: connection description for remote database not found

The name after @ does not match any database link the current user can use.

Oracle AI Database 26ai Free 23.26.3.0.0
ORA-02019: connection description for remote database not found

Jump to a cause

  1. 01Typo in the database link name
  2. 02The link is a private link of another user
  3. 03The link was created without a USING clause

Lab-verifiedReproduced and fixed on Oracle AI Database 26ai Free 23.26.3.0.0 · 2026-12-02 · container image gvenzl/oracle-free:23-slim

ORA-02019 means Oracle could not find a database link (or its connect string) for the name you wrote after @. It is not a network error: the lookup fails before any connection is attempted.

We reproduced three common reasons on Oracle 26ai Free: a typo in the link name, a private link owned by a different user, and a link created without a USING clause.

03The link was created without a USING clause

CREATE DATABASE LINK erp_link CONNECT TO lab_b IDENTIFIED BY lab; succeeded with "Database link created.", but the first query through @erp_link failed with ORA-02019. Without USING, the link has no connect string.

Setup
Setuprun as system
GRANT CREATE DATABASE LINK TO lab_a, lab_b;
OUTPUT
Grant succeeded.
Setuprun as lab_a
CREATE DATABASE LINK erp_link CONNECT TO lab_b IDENTIFIED BY lab;
OUTPUT
Database link created.
Reproducerun as lab_a
SELECT COUNT(*) FROM user_tables@erp_link;
✕ ERROR
SELECT COUNT(*) FROM user_tables@erp_link
                                 *
ERROR at line 1:
ORA-02019: connection description for remote database not found
Help: https://docs.oracle.com/error-help/db/ora-02019/
Check the causerun as lab_a
COLUMN owner FORMAT a8
COLUMN db_link FORMAT a10
COLUMN host FORMAT a25
SELECT db_link, NVL(host, '(null)') AS host FROM user_db_links;
OUTPUT
DB_LINK    HOST
---------- -------------------------
ERP_LINK   (null)

1 row selected.

In user_db_links, the HOST of ERP_LINK is (null): the link exists but has nowhere to connect.

Fixrun as lab_a
DROP DATABASE LINK erp_link;
CREATE DATABASE LINK erp_link CONNECT TO lab_b IDENTIFIED BY lab USING 'localhost:1521/FREEPDB1';
OUTPUT
Database link dropped.


Database link created.

We dropped the link and created it again with USING 'localhost:1521/FREEPDB1'. The query then worked.

After the fixrun as lab_a
SELECT COUNT(*) FROM user_tables@erp_link;
✓ SUCCESS
  COUNT(*)
----------
         0

1 row selected.

FAQ

The DB link works for one user but ORA-02019 for another. Why?

In our test the link was private to lab_b. dba_db_links showed owner LAB_B, and lab_a could not see it. Creating the link in lab_a's schema fixed it.

How do I list the database links I can use?

SELECT owner, db_link, host FROM all_db_links; shows your own links and PUBLIC links. Compare the DB_LINK value with the name after @.

Is ORA-02019 a tnsnames.ora problem?

Not in these cases. Either the link name was not found, or the link had no USING clause at all (HOST was null). When the link has a USING alias that is missing from tnsnames.ora, we got ORA-12154 instead.

CREATE DATABASE LINK succeeded, so why does the first query fail?

Creating the link does not connect. In our test a link without USING was created without error, and ORA-02019 appeared only on the first SELECT ... @erp_link. Check HOST in user_db_links.

How we verify

Each scenario starts from fresh database users. A script runs the setup, confirms the exact error code, applies the fix and runs the statement again. The output shown is what the database printed, saved by the script.

lab_a and lab_b are ordinary users created for the test; system is the DBA account. Oracle AI Database 26ai Free Release 23.26.3.0.0 - Develop, Learn, and Run for Free 23.26.3.0.0