I have an Oracle Package (Schema1) that is calling another Oracle Package (Schema2) over a DB link. There are no recent code changes.

When I try to compile the package in (Schema1) it throws the following errors.

(replaced the actual schema names with 1 and 2 for clarity)

ORA-04052: error occurred when looking up remote object [email protected]@SCHEMA1

ORA-04020: deadlock detected while trying to lock object [email protected]@SCHEMA1

What we have tried

  1. Killed all user sessions

  2. Recompiled the package in SCHEMA2 even so SCHEMA1 that calls it over the DBLINK failes with "ORA-04020: deadlock detected"

We have 4 Database regions, and this is only happening in two of the regions.


SCHEMA1: Oracle 11g

SCHEMA2: Oracle 12c (on ExaData)

1 Answer 1


Look at this webpage https://docs.oracle.com/cloud/latest/db112/LNPLS/nameresolution.htm#LNPLS017, especially the INNER CAPTURE section. Does the package exist on both sides of the link or only one? What does the ORA-60 deadlock trace file show? What does DBMS_UTILITY.NAME_RESOLVE show for "[email protected]@SCHEMA1"? Do the DBLINKS loopback?

  • The package exists, this is an existing package (both sides) been working for years, then this just happened.
    – Elim Garak
    Commented Apr 26, 2018 at 23:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.