Bu hatayı db link ile remote db den bir distributed query çekmek isterken aldım.
SELECT o.OWNER, o.OBJECT_NAME, o.OBJECT_TYPE, os.source_size
FROM dba_objects@db_link o, dba_object_size@db_link os
WHERE o.OWNER=os.owner
and o.OBJECT_NAME = os.name
and o.OBJECT_TYPE = os.type
and o.object_name = upper(p_OBJECT_NAME)
LINE/COL ERROR
-----------------------------------------------------------------
ORA-04052: error occurred when looking up remote object
SYS.IDL_UB2$@DB_LINK
ORA-00604: error occurred at recursive SQL level 1
ORA-06552: PL/SQL: Compilation unit analysis terminated
ORA-06553: PLS-201: identifier 'UNDEFINED' must be decl
workarounds olarak bir çözüm üretmek gerekirse
1-) Local db üzerinden bir view yaratabiliriz.
On local
Create or replace view remote_obje
SELECT o.OWNER, o.OBJECT_NAME, o.OBJECT_TYPE, os.source_size
FROM dba_objects@db_link o,dba_object_size@db_link os
WHERE o.OWNER=os.owner
and o.OBJECT_NAME = os.name
and o.OBJECT_TYPE = os.type
and o.object_name = upper(p_OBJECT_NAME);
2-)Ya da remote db üzerinde bu view yaratıp sorgumuzu yapabiliriz.
on destination
Create or replace view remote_obje
SELECT o.OWNER, o.OBJECT_NAME, o.OBJECT_TYPE, os.source_size
FROM dba_objects o, dba_object_size os
WHERE o.OWNER=os.owner
and o.OBJECT_NAME = os.name
and o.OBJECT_TYPE = os.type
and o.object_name = upper(p_OBJECT_NAME);