Skip to Main Content
  • Questions
  • Synonym based on dblink get ORA-02019

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Mohamed.

Asked: June 27, 2019 - 8:09 am UTC

Last updated: June 27, 2019 - 9:37 am UTC

Version: 12.0.2.1818

Viewed 1000+ times

You Asked

hello dear ,
i have 3 databases in as an image from each others , with the same db versions db1, db2 , db3
db1 & db2 have a synonym of a function based on database link like that :
create or replace synonym VALIDATE_FORM_USER  for VALIDATE_FORM_USER@db_link
;
db3 has the same synonym but based on user on the same database not based on dblink like that :
create or replace synonym VALIDATE_FORM_USER for USER1.VALIDATE_FORM_USER;


and i use this function in oracle forms via PL/SQL library PLL, and i have one application server with one source files points to the three databases db1 , db2 & db3 with different configuration url app1 , app2 & app3, the forms of app1 & app2 based on db1 & db2 using the mentioned function is working normally , but when open the same form from the app3 which based on db3 i got "ORA-02019: connection description for remote database not found" , and need to compile the pll on the db3 "and if compile in db3 , apps based on db1 & db2 raise the same error".
i need to share the same the same source file to all applications with recompile the screen for each project

and Chris said...

The database is looking for a database link which doesn't exist!

You could get around this by creating a "loopback" database link on db3. This is a link which points back to the same database.

That way you can have the same synonym definition on all databases.

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database