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.
01Typo in the database link name
The link is erp_link, but the query used user_tables@erp_lnk. The * under the error points at the link name.
Setup
GRANT CREATE DATABASE LINK TO lab_a, lab_b;Grant succeeded.CREATE DATABASE LINK erp_link CONNECT TO lab_b IDENTIFIED BY lab USING 'localhost:1521/FREEPDB1';Database link created.SELECT COUNT(*) FROM user_tables@erp_lnk;SELECT COUNT(*) FROM user_tables@erp_lnk
*
ERROR at line 1:
ORA-02019: connection description for remote database not found
Help: https://docs.oracle.com/error-help/db/ora-02019/COLUMN owner FORMAT a8
COLUMN db_link FORMAT a10
COLUMN host FORMAT a25
SELECT owner, db_link, host FROM all_db_links;OWNER DB_LINK HOST
-------- ---------- -------------------------
LAB_A ERP_LINK localhost:1521/FREEPDB1
1 row selected.all_db_links lists only ERP_LINK (owner LAB_A), so ERP_LNK does not exist.
Querying with the correct name @erp_link returned a result.
SELECT COUNT(*) FROM user_tables@erp_link; COUNT(*)
----------
0
1 row selected.02The link is a private link of another user
lab_b created erp_link and could query through it. lab_a ran the same query with @erp_link and got ORA-02019, because a private link is visible only to its owner.
Setup
GRANT CREATE DATABASE LINK TO lab_a, lab_b;Grant succeeded.CREATE DATABASE LINK erp_link CONNECT TO lab_b IDENTIFIED BY lab USING 'localhost:1521/FREEPDB1';
SELECT COUNT(*) FROM user_tables@erp_link;Database link created.
COUNT(*)
----------
0
1 row selected.SELECT COUNT(*) FROM user_tables@erp_link;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/COLUMN owner FORMAT a8
COLUMN db_link FORMAT a10
COLUMN host FORMAT a25
SELECT owner, db_link, host FROM dba_db_links WHERE db_link LIKE 'ERP_LINK%';OWNER DB_LINK HOST
-------- ---------- -------------------------
LAB_B ERP_LINK localhost:1521/FREEPDB1
1 row selected.As a DBA, dba_db_links shows ERP_LINK exists, but its owner is LAB_B.
CREATE DATABASE LINK erp_link CONNECT TO lab_b IDENTIFIED BY lab USING 'localhost:1521/FREEPDB1';Database link created.We created the link in lab_a's own schema with the same connection details. The query then worked. (Another option is a PUBLIC link, which we did not test here.)
SELECT COUNT(*) FROM user_tables@erp_link; COUNT(*)
----------
0
1 row selected.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
GRANT CREATE DATABASE LINK TO lab_a, lab_b;Grant succeeded.CREATE DATABASE LINK erp_link CONNECT TO lab_b IDENTIFIED BY lab;Database link created.SELECT COUNT(*) FROM user_tables@erp_link;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/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;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.
DROP DATABASE LINK erp_link;
CREATE DATABASE LINK erp_link CONNECT TO lab_b IDENTIFIED BY lab USING 'localhost:1521/FREEPDB1';Database link dropped.
Database link created.We dropped the link and created it again with USING 'localhost:1521/FREEPDB1'. The query then worked.
SELECT COUNT(*) FROM user_tables@erp_link; 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