I'm working on an Oracle database that has every table exposed in a view. I have made a view name contain the name of the table it is exposing, for clarity reasons. Now I would like to find out if there are tables whose name is not contained in any view, meaning that I forgot to have a view exposing them.
If I query all_tables and all_views, let's assume that I get the following result:
SELECT table_name FROM all_tables:
TABLE1
TABLE2
TABLE3
SELECT view_name FROM all_tables:
TABLE1_VIEW
TABLE2_VIEW
I now would like to query the two results and obtain all the table names that are included in any view name and those that are not. In my example, TABLE1 and TABLE2 are included, but TABLE3 is not.
I have tried looping all the table names and looking for each one of them on the view names result set. I was wondering if there is a more direct approach.
TABLE1_VIEW. Rather check ifALL_VIEWS.TEXTcolumn contains some table name.