oradiff can be used to find the difference between two Oracle database schemas.
oradiff supports the following options:
- -v <flag>, --verbose <flag>
Produces output (on stderr) while the database is read. (Valid flag values are
- -c <mode>, --color <mode>
Should the output (when the
-voption is used) be colored? If
autois specified (the default) then the output is colored if stderr is a terminal. Valid modes are
- -m <mode>, --mode <mode>
Specifies how the differences should be shown.
briefonly prints whether objects are different (or which ones exist in only one of the databases);
udiffoutputs the differences in “unified diff” format and
fulloutputs the object from the second schema if they differ (i.e. it outputs the script that must be executed to copy the differences from schema 2 to schema 1).
- --format <format>
- -n <context>, --context <context>
The number of context lines in unified diff mode (i.e. the number of unchanged lines above and below each block of changes; the default is 2)
- -k <flag>, --keepjunk <flag>
If false (the default), database objects that have
SYS_EXPORT_SCHEMA_in their name will be skipped (otherwise these objects will be included in the output). (Valid flag values are
- -b <mode>, --blank <mode>
-boption specifies how whitespace in the database objects should be compared. With
literalall whitespace is significant, with
trailtrailing whitespace will be ignore, with
leadleading whitespace will be ignored, with
bothtrailing and leading whitespace will be ignored and with
collapsetrailing and leading whitespace will be ignored and stretches of whitespace will be treated as a single space.
Compare the schemas
user2@db2, collapsing whitespace and
using unified diff mode with 5 context lines:
$ oradiff user/pwd@db user2/pwd2@db2 -bcollapse -mudiff -n5 -v >db.diff