#SQL to find dependency between tables in #Oracle database

By | February 12, 2025

There are times when we need to find which are the tables that depend on a given table. This is useful when cleanup or archiving jobs have to pe performed and the interconnection of constraints is becoming a nuisance.

Lucky for us in the case of Oracle database is quite simple to search through all the constraints , as there exist a view called all_contraints.
The following query will search for all the constraints linked to the table MY_TABLE.

SELECT * FROM user_constraints WHERE table_name = ‘MY_TABLE’;

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.