One of the questions that arise during the development process is if the database schéma I work on is an unaltered image of production. How do I know that another developer didn’t experiment with a new index or modified the structure of some table? Writing scripts to compare my current database with the ‘source of truth’ is time consuming! Luckily, Oracle SQL Developer has just the feature to help me!
This procedure can be used to compare database objects of two databases to ensure they are aligned between different environments.
- Run Oracle SQL Developer
- Menu -> Tools -> Database Diff
- Specify source and destination database
- Specify the type of objects you wish to compare, e.g. indexes etc.
- Specify the schema you want to compare, object types ans you may choose if you wish to compare all objects or just certain objects
- After clicking ‘Finish’, it may take a while according to the size of the schema and the number of objects to be compared:
- The report will list all objects which are missing/differ between the compared databases, DDL statements can be picked up in order to bring the database schemas in sync
- Repeat the steps for all schemas you want to compare