Purpose
oradiff can be used to find the difference between two Oracle database schemas.
Options
oradiff supports the following options:
connectstring1Oracle connectstring for the first database schema.
connectstring2Oracle connectstring for the second database schema.
-v,--verbose(false,no,0,true,yesor1)Produces output (on stderr) while the database is read.
-c,--color(yes,noorauto)Should the output (when the
-voption is used) be colored? Ifautois specified (the default) then the output is colored if stderr is a terminal.-m,--mode(brief,udifforfull)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 andfulloutputs 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(sqlorpysql)If
--modeisfull, this determines the output format: Plain SQL, or PySQL which can be piped intoll.pysql.-n,--context(integer)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,--keepjunk(false,no,0,true,yesor1)If true (the default), database objects that have
$orSYS_EXPORT_SCHEMA_in their name will be skipped (otherwise these objects will be included in the output).-b,--blank(literal,trail,lead,bothorcollapse)The
-boption specifies how whitespace in the database objects should be compared. Withliteralall whitespace is significant, withtrailtrailing whitespace will be ignore, withleadleading whitespace will be ignored, withbothtrailing and leading whitespace will be ignored and withcollapsetrailing and leading whitespace will be ignored and stretches of whitespace will be treated as a single space.
Example
Compare the schemas user@db and 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