9.12.10 diff-changeLog

Compare two databases to produce changesets and write them to a changelog file.

Syntax

Liquibase|lb diff-changelog|dic {OPTIONS}

Options

Option Description Default
Required
-reference-password|-rep The reference database password. -
-reference-url|-reur The JDBC reference database connection URL. -
-reference-username|-reu The reference database username. -
Optional
-database-changelog-table-name|-dactn Name of table to use for tracking change history. -
-debug|-de Enable debug output. -
-default-schema-name|-desn The default schema name to use for the database connection. -
-defaults-file|-def Fully qualified path to the properties file you want to use. Example: -defaults-file/tmp/liquibase.properties -
-diff-types|-dit Types of objects to compare catalogs, tables, views, columns, indexes, foreignkeys, primarykeys, uniqueconstraints, data, storedprocedures, sequences{catalogs| tables| views| columns| indexes| foreignkeys| primarykeys| uniqueconstraints| data| storedprocedures| sequences}
-exclude-objects|-exo Objects to exclude from diff -
-include-objects|-ino Objects to include in diff -
-include-schema|-ins If true, the schema is included in generated changesets. False
-include-tablespace|-int Include the tablespace attribute in the changelog False
-liquibase-schema-name|-lbsn Schema to use for Liquibase objects. -
-liquibase-tablespace-name|-lbtn Tablespace to use for Liquibase objects. -
-log|-lo

Enable logging.

Standard logging is INFO level (no debug flag).

Debug logging is FINEST level (both log and debug flag).

-
-overwrite-files|-ovf Overwrite any existing files in the directory. This will not affect other files. -
-schemas|-sc Schemas to include in diff -
-search-path|-sep

Complete list of locations to search for files such as changelog files.

You can specify multiple paths by separating them with commas.

-
-secure-parsing|-scp

If true, remove functionality from file parsers that could be used insecurely.

An example is disabling remote XML entity support.

True
-output-default-schema|-ouds Controls whether names of objects in the default schema are fully qualified or not. If false, only objects outside the default schema are fully qualified. False
-output-file|-ouf The name of the file to write the output to. -

Examples

Create changelog to synchronize two databases.

-- Set default output path
SQL> cd <output-files-path>
-- Connect to target database
SQL> connect <db-connect-string> 
-- Compare to a reference database and create a changelog to synchronize them
SQL> lb diff-changelog  -changelog-file diff.xml -reference-url <db-url> -reference-username <db-user> -reference-password <db-password>

Create changelog to synchronize table excluding employees between two databases.

-- Set default output path
SQL> cd <output-files-path>
-- Connect to comparison database
SQL> connect <db-connect-string> 
-- Compare tables to a reference database
SQL> lb diff-changelog -changelog-file diff.xml -diffTypes=tables -exclude-objects employees -reference-url <db-url> 
-reference-username <db-user> -reference-password <db-password>