Thursday, October 25, 2012


Finding out the tables referencing the given table in Oracle Database:

Below query gives you details about the tables referencing the given table in Oracle database:


select table_name, constraint_name, status, owner
from all_constraints
where r_owner =  :owner
and constraint_type = 'R'
and r_constraint_name in
 (
   select constraint_name from all_constraints
   where constraint_type in ('P', 'U')
   and table_name = :tablename
   and owner = :owner
 )
order by table_name, constraint_name

Replace the parameters owner, tablename to your schema owner and the table name.