How to compare two Oracle schemas
Before a release, check what differs between DEV and TEST. The data dictionary answers most of it with MINUS.
Objects in one schema only
select object_type, object_name from all_objects where owner = 'DEV_APP'
minus
select object_type, object_name from all_objects where owner = 'TEST_APP'
order by 1, 2;Columns that differ
select table_name, column_name, data_type, data_length, nullable
from all_tab_columns where owner = 'DEV_APP'
minus
select table_name, column_name, data_type, data_length, nullable
from all_tab_columns where owner = 'TEST_APP'
order by 1, 2;Code and DDL
Compare the source of stored code line by line in ALL_SOURCE, or take an object's whole DDL to compare it in a diff tool:
select dbms_metadata.get_ddl('PACKAGE_BODY', 'ORDER_PKG', 'DEV_APP') from dual;For schemas in two databases, the queries need a database link, or run them on each side and compare the results.
In Felix
Tools › Schema Compare compares two schemas of one connection, or of two saved connections, and lists what differs, what is only on one side, and what is identical: tables, code, scheduler objects and privileges. It shows the code side by side and builds the script that makes the target like the source.
More about it: Oracle schema compare in Felix.
Try it on your own database
Felix is a Windows IDE for Oracle SQL and PL/SQL, from 11g to 23ai. Every feature is in the free 30-day trial; no account needed.