9.12.9 diff
Compare two databases.
Syntax
Liquibase|lb diff|di {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-|-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
<exclude-objects> |
Objects to exclude from diff. | - |
-include-objects|-ino
<include-objects> |
Objects to include in diff. | - |
-include-schema|-ins
<include-schema> |
If true, the schema will be included in generated changesets. | False |
-include-tablespace|-int
<include-tablespace> |
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 Debug logging is |
- |
-overwrite-files|-ovf |
Overwrite any existing files in directory. This will not affect other files. | - |
-search-path|-sep
<search-path> |
Complete list of locations to search for files such as changelog files. 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. | - |
-reference-default-schema-name|-redsn |
The reference default schema name to use for the database connection. | - |
-schemas|-sc |
Schemas to include operation. | - |
Examples
Compare two databases and spool output.
-- Set default output path
SQL> cd <output-files-path>
SQL> spool diff.sql
-- Connect to target database
SQL> connect <db-connect-string>
-- Compare to a reference database
SQL> lb diff -reference-url <reference-db-url> -reference-username <reference-db-user> -reference-password <reference-db-password>
SQL> spool off
Compare tables, indexes and views between two databases.
-- Set default output path
SQL> cd <output-files-path>
SQL> spool diff.sql
-- Connect to comparison database
SQL> connect <db-connect-string>
-- Compare to a reference database
SQL> lb diff -diff-types tables,indexes,views -reference-url <db-url>
-reference-username <db-user> -reference-password <db-password>