Oracle 追溯表被调用的源头SQL
Oracle 根据表名查询调用该表的视图,包,存储过程等
哪些包或者存储过程使用该表
SELECT OWNER,
OBJECT_TYPE,
OBJECT_NAME,
OBJECT_ID,
STATUS
FROM DBA_OBJECTS DO
WHERE 1 = 1
AND OBJECT_ID IN (SELECT OBJECT_ID
FROM PUBLIC_DEPENDENCY PD
CONNECT BY PRIOR OBJECT_ID = REFERENCED_OBJECT_ID
START WITH REFERENCED_OBJECT_ID =
(SELECT OBJECT_ID
FROM DBA_OBJECTS
WHERE 1 = 1
AND OBJECT_TYPE = 'TABLE'
AND OBJECT_NAME = '表名' -- HR_ORGANIZATION_UNITS
AND OWNER = 'OWNER名称'))
ORDER BY OWNER,
OBJECT_NAME,
OBJECT_TYPE
;
--刘轶鹤