SQL script to find where is a certain object used

SELECT OWNER, 
       NAME, 
       TYPE 
  FROM DBA_DEPENDENCIES 
 WHERE REFERENCED_OWNER = upper('&OWNER') 
   AND REFERENCED_NAME = upper('&object')
   AND REFERENCED_TYPE IN ('PACKAGE', 'PROCEDURE', 'FUNCTION');

select
   x.sid
from
   v$session x, v$sqltext y
where
   x.sql_address = y.address
and
   upper(y.sql_text) like upper('%object%');

Leave a Reply

%d bloggers like this: