3.4 Supported Liquibase Commands in SQLcl
You can invoke the Liquibase commands in SQLcl with
liquibase
or lb
.
The SQLcl Liquibase commands that were initially launched in SQLcl release 19.2 has deprecated. In this release, the SQLcl plug-in has been updated to synchronize with the new command format introduced by Liquibase.
Syntax
Liquibase|lb COMMAND {OPTIONS}
To see the help for Liquibase in SQLcl, type :
help Liquibase
To only view the examples in help, type:
help liquibase examples
<OPTIONS>: The list of options for each Liquibase command is provided in the following sections.
Database Diff Commands
New Command | Description |
---|---|
diff | Writes description of differences between two databases to standard out. |
diff-changeLog | Adds any differences between the databases specified to a changelog. Can append in any of the supported changelog formats. |
Database Rollback Commands
New Command | Description |
---|---|
rollback | Rolls back the database to the state it was in when the tag was applied. |
rollback-sql | A helper command that produces the raw SQL Liquibase would run when using the rollbackByTag command. |
rollback-to-date | Rolls back the database to the state it was in at the given date/time. |
rollback-to-date-sql | A helper command that allows you to inspect the SQL Liquibase will run while using the rollback-to-date command. |
rollback-count | Rolls back the last <value> changesets. |
rollback-count-sql | Writes SQL to roll back the last <value> changesets to STDOUT. |
future-rollback-sql | Writes SQL to roll back the database to the current state after the changes in the changelog have been applied. |
future-rollback-count-sql | Generates the SQL that Liquibase would use to sequentially revert the number of changes associated with undeployed changesets, which are added to a changelog file. |
future-rollback-from-tag-sql | Produces the raw SQL Liquibase would need to roll back all undeployed changes made up to the specified tag. |
Database Snapshot Commands
New Command | Description |
---|---|
data | Generate changelogs for the data. |
generate-apex-object | Generate apex objects from a database |
generate-controlfile | Generate an empty control file that you can use to start a new changelog. |
generate-db-object | Generate database objects from a database |
generate-ords-module, generate-ords-schema | Generate ords objects from a database |
generate-schema | Generate all supported objects in a schema and controller file. |
generate-changelog | Generate a changelog from a database when adding Liquibase to a new project. This is synonymous with snapshot with the exception of saving the output as XML in the changelog. |
snapshot | Gathers the current database schema and displays that information to STDOUT. With options, can save the schema in JSON format, and that JSON snapshot can serve as a comparison database. |
update-to-tag-sql | A helper command that inspects the SQL code Liquibase will run when using the update-to-tag <tag> command. |
Database Update Commands
New Command | Description |
---|---|
update | Updates the database to the current version. |
update-sql | A helper command that enables you to inspect the SQL code that Liquibase will run when using the update command. |
update-count | Applies the next <value> changesets. |
update-count-sql | Writes SQL to apply the next <value> changesets to STDOUT. |
update-testing-rollback | Updates the database, then rolls back changes before updating again. |
update-to-tag | Applies sequential changes to your database from the newest changeset to the changeset with the tag you specified and applied earlier. |
update-to-tag-sql | A helper command that inspects the SQL code Liquibase will run when using the update-to-tag <tag> command. |
Documentation Commands
New Command | Description |
---|---|
db-doc | Generates Javadoc-like documentation based on current database and changelog. |
Maintenance Commands
New Command | Description |
---|---|
calculate-checksum | Calculates and prints a checksum for the changeset with the specified id in the following format: filepath::id::author. |
changelog-sync | Marks all changes as executed in the database. |
changelog-sync-sql | Writes SQL to mark all changes as executed in the database to STDOUT. |
changelog-sync-to-tag | Marks all undeployed changesets from your changelog up to and including the specified tag as executed in your database. |
changelog-sync-to-tag-sql | Produces the raw SQL that Liquibase would run when using the changelog-sync-to-tag command to mark all undeployed changesets associated with the specified tag as executed in your database. |
clear-checksums | Removes current checksums from database. On next update changesets that have already been deployed will have their checksums recomputed, and changesets that have not been deployed will be deployed. |
drop-all | Drops all database objects owned by the user. |
list-locks | Lists who currently has locks on the database changelog. |
mark-next-changeset-ran | Mark the next changeset as executed in the database. |
mark-next-changeset-ran-sql | Inspects the SQL Liquibase will run while using the mark-next-changeset-ran command. |
release-locks | Releases all locks on the database changelog. |
tag | "Tags" the current database state for future rollback. |
tag-exists | Checks whether the given tag already exists. |
unexpected-changesets | Produces a list of changesets that were run in the database but do not exist in the current changelog. |
validate | Checks the changelog for errors. |
3.4.1 calculate-checksum
filepath::id::author.
.Syntax
Liquibase|lb calculate-checksum|cac {OPTIONS}
The calculate-checksum command is typically used to compute an MD5
checksum, which serves as a unique identifier for the changeset. As a result, you
can see whether the changeset has been changed and whether it has to be deployed
differently. The MD5SUM column in the DATABASECHANGELOG
table
contains a checksum of the changeset and any change made in the changeset will
result in a different checksum.
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
-changeset-identifier|-chi |
Changeset ID identifier of form filepath::id::author. | - |
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 |
- |
-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 |
- |
-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, which can 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 |
Example
Calculate a checksum for changeset:
SQL> lb calculate-checksum --changelog-file countries_table.xml --changeset-identifier
countries_table.xml::382e51cedfbfc7ba59568dd09dcd4e110b9fbeca::(USER)-Generated
SQL> liquibase calculate-checksum changelog.oracle.sql::myID_123::Steve
3.4.2 changelog-sync
Syntax
Liquibase|lb changelog-sync|chs {OPTIONS}
Uses include:
- Creating a new baseline database.
- Excluding objects from a database.
- Marking a change as executed. The change was created manually.
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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
<defaults-file> {FILE} |
Fully qualified path to the properties file you want
to use. Example:
-defaults-file/tmp/liquibase.properties |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-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 |
Example
Mark changes as executed in the database:
-- Set default output path
SQL> cd <output-files-path>
-- Connect to target and execute command
SQL> connect <db-connect-string>
SQL> lb changelog-sync -changelog-file countries_table.xml
3.4.3 changelog-sync-sql
Syntax
Liquibase|lb changelog-sync-sql|chss {OPTIONS}
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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 |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-output-default-schema|-ouds |
Control 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. | - |
-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, which can be used insecurely. An example is disabling remote XML entity support. |
True |
Example
Generate SQL to mark changes as executed in the database:
-- Set default output path
SQL> cd <output-files-path>
-- Connect to target and execute command
SQL> connect <db-connect-string>
SQL> lb changelog-sync-sql -changelog-file countries_table.xml -outputfile countries_synch.sql
3.4.4 changelog-sync-to-tag
Syntax
Liquibase|lb changelog-sync-to-tag|chstt {OPTIONS}
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
-tag|-ta <tag> |
The tag to be used during the execution of command. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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
<defaults-file> {FILE} |
Fully qualified path to the properties file you want
to use. Example:
-defaults-file/tmp/liquibase.properties |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-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, which can 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 |
Example
Mark changes as executed in the database up to and including tag.
cd <lb-changes-directory>
-- Edit changelog file and add tagDatabase entries for versions.
-- Execute command using a tag specified in tagDatabase in the changelog file.
SQL> lb changelog-sync-to-tag -tag version1 -changelog-file controller.xml
3.4.5 changelog-sync-to-tag-sql
Syntax
Liquibase|lb changelog-sync-to-tag-sql|chstts {OPTIONS}
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
-tag|-ta <tag> |
The tag to be used during the execution of the command. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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
<defaults-file> {FILE} |
Fully qualified path to the properties file you want
to use. Example:
-defaults-file/tmp/liquibase.properties |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-output-default-schema|-ouds |
Control whether names of objects in the default schema are fully qualified or not. If true they are qualified. 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. | - |
-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, which can be used insecurely. An example is disabling remote XML entity support. |
True |
Example
Mark changes as executed in database up to and including tag.
cd <lb-changes-directory>
-- Edit changelog file and add tagDatabase entries for versions.
-- Execute command using a tag specified in tagDatabase in the changelog file.
SQL> lb changelog-sync-to-tag-sql -tag version1 -changelog-file controller.xml -outputfile synch.sql
3.4.6 clear-checksums
DATABASECHANGELOG
table so that they will be recomputed on the next
database update.Syntax
Liquibase|lb clear-checksums|clc {OPTIONS}
Options
Option | Description | Default |
---|---|---|
-database-changelog-table-name|-dactn |
Name of table to use for tracking change history. | - |
-debug|-de |
Enable debug output. | - |
-default-schema-name|-desn
<default-schema-name> |
The default schema name to use for the database connection. | - |
-defaults-file|-def
<defaults-file> {FILE} |
Fully qualified path to the properties file you want
to use. Example:
-defaults-file/tmp/liquibase.properties |
- |
-liquibase-schema-name|-lbsn
<liquibase-schema-name> |
Schema to use for Liquibase objects. | - |
-liquibase-tablespace-name|-lbtn
<liquibase-tablespace-name> |
Tablespace to use for Liquibase objects. | - |
-log|-lo |
Enable logging. Standard logging is Debug logging is |
- |
-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 |
Control 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 |
Example
Clear checksums:
-- Connect to target and execute command.
SQL> connect <db-connect-string>
SQL> clear-checksums
3.4.7 data
Syntax
Liquibase|lb data|da {OPTIONS}
Options
Option | Description | Default |
---|---|---|
-data-output-directory|-daod
<data-output-directory> |
Directory to write data to, only applicable when <DIFF_TYPE> includes data. | - |
-database-changelog-table-name|-dactn
<database-changelog-table-name> |
Name of table to use for tracking change history. | - |
-debug|-de |
Enable debug output. | - |
-default-schema-name|-desn
<default-schema-name> |
The default schema name to use for the database connection. | - |
-defaults-file|-def
<defaults-file> {FILE} |
Fully qualified path to the properties file you want
to use. Example:
-defaults-file/tmp/liquibase.properties |
- |
-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 is included in generated changesets. | False |
-include-tablespace|-int
<include-tablespace> |
Include the tablespace attribute in the changelog. | False |
-liquibase-schema-name|-lbsn
<liquibase-schema-name> |
Schema to use for Liquibase objects. | - |
-liquibase-tablespace-name|-lbtn
<liquibase-tablespace-name> |
Tablespace to use for Liquibase objects. | |
-log|-lo |
Enable logging. Standard logging is Debug logging is |
- |
-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
<output-file> |
The name of the file to write the output to. | - |
-overwrite-files|-ovf |
Overwrite any existing files in directory. This will not affect other files. | - |
-schemas|-sc
<schemas> |
Schemas to include operation. | - |
-search-path|-sep
<search-path> |
Complete list of locations to search for files such as changelog files. Multiple paths can be specified by separating them with commas. | - |
-secure-parsing|-scp
<secure-parsing> |
Keep functionality from file parsers which could be used insecurely. Examples include (but not limited to) disabling remote XML entity support. | True |
3.4.8 db-doc
Syntax
Liquibase|lb db-doc|dbd {OPTIONS}
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf
<changelog-file> |
The root changelog file. | - |
-output-directory|-oud
<output-directory> |
The directory where the documentation is generated. | - |
Optional | ||
-database-changelog-table-name|-dactn
<database-changelog-table-name> |
Name of table to use for tracking change history. | - |
-debug|-de |
Enable debug output. | - |
-default-schema-name|-desn
<default-schema-name> |
The default schema name to use for the database connection. | - |
-defaults-file|-def
<defaults-file> {FILE} |
Fully qualified path to the properties file you want
to use. Example:
-defaults-file/tmp/liquibase.properties |
- |
-liquibase-schema-name|-lbsn
<liquibase-schema-name> |
Schema to use for Liquibase objects. | - |
-liquibase-tablespace-name|-lbtn
<liquibase-tablespace-name> |
Tablespace to use for Liquibase objects. | - |
-log|-lo |
Enable logging. Standard logging is Debug logging is |
- |
-search-path|-sep
<search-path> |
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
<secure-parsing> |
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
<output-default-schema> |
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 |
Example
Generate db documentation:
-- Set default output path
SQL> cd <output-files-path>
-- Generate doc
SQL> lb db-doc -output-directory ./dbdoc -changelog-file controller.xml
3.4.9 diff
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>
3.4.10 diff-changeLog
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 Debug logging is |
- |
-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>
3.4.11 drop-all
Syntax
Liquibase|lb drop-all|dra {OPTIONS}
Options
Option | Description | Default |
---|---|---|
-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 |
- |
-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 |
- |
-output-default-schema|-ouds |
Control whether names of objects in the default schema are fully qualified or not. If true they are qualified. If false, only objects outside the default schema are fully qualified. | False |
-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, which can be used insecurely. An example is disabling remote XML entity support. |
True |
-schemas|-sc |
Schemas to include operation. | - |
Example
To drop all database objects owned by the user, enter:
SQL> lb drop-all
3.4.12 future-rollback-count-sql
Syntax
Liquibase|lb future-rollback-count-sql|furcs {OPTIONS}
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
-count|-cu |
The number of changes to roll back. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-database-changelog-table-name|-dactn |
Name of table to use for tracking change history. | - |
-debug|-de |
Enable debug output. | False |
-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 |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-output-default-schema|-ouds |
Control whether names of objects in the default schema are fully qualified or not. If true, they are qualified. 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. | - |
-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. |
- |
-overwrite-files|-ovf |
Overwrite any existing files in the directory. This will not affect other files. | - |
-secure-parsing|-scp |
If true, remove functionality from file parsers, which can be used insecurely. An example is disabling remote XML entity support. |
True |
Example
Generate SQL to roll back the specified number of undeployed changes.
-- Set default output path
SQL> cd <output-files-path>
-- Connect to target
SQL> connect <db-connect-string>
-- Generate SQL to roll back 1 undeployed change
SQL> lb future-rollback-count-sql -count 1 -changelog-file controller.xml
3.4.13 future-rollback-from-tag-sql
Syntax
Liquibase|lb future-rollback-from-tag-sql|furfts {OPTIONS}
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
-tag|-ta |
Generic 'tag to apply action to'. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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 |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-output-default-schema|-ouds |
Control whether names of objects in the default schema are fully qualified or not. If true, they are qualified. 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. | - |
-overwrite-files|-ovf |
Overwrite any existing files in the directory. This will not affect other files. | - |
-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, which can be used insecurely. An example is disabling remote XML entity support. |
True |
Example
Generate SQL to roll back undeployed changes to tag.
-- Set default output path
SQL> cd <output-files-path>
-- Connect to target
SQL> connect <db-connect-string>
-- Generate SQL to roll back 1 undeployed change
SQL> lb future-rollback-count-sql -count 1 -changelog-file controller.xml
-- Edit changelog file and add tagDatabase entries for versions
-- Generate SQL to roll undeployed changes back to version1
SQL> lb future-rollback-from-tag-sql -tag version1 -changelog-file controller.xml
3.4.14 future-rollback-sql
Syntax
Liquibase|lb future-rollback-sql|furs {OPTIONS}
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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 |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-output-default-schema|-ouds |
Control whether names of objects in the default schema are fully qualified or not. If true, they are qualified. 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. | - |
-overwrite-files|-ovf |
Overwrite any existing files in the directory. This will not affect other files. | - |
-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 |
Example
Generate SQL to roll back undeployed changes.
-- Set default output path
SQL> cd <output-files-path>
-- Connect to target
SQL> connect <db-connect-string>
-- Generate SQL to roll back 1 undeployed change
SQL> lb future-rollback-count-sql -count 1 -changelog-file controller.xml
-- Generate SQL to rollback all undeployed changes
SQL> lb future-rollback-sql -changelog-file controller.xml
3.4.15 generate-apex-object
Syntax
Liquibase|lb generate-apex-object|geao {OPTIONS}
Options
Option | Description | Default |
---|---|---|
-applicationid|-api |
ID for application to be exported. | - |
-changesby|-chb |
Expects string parameter. Limit -list values to changes by the given user. | - |
-changessince|-chs |
Expects date parameter (YYYY-MM-DD). Limit -list values to changes since the given date. | - |
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-debug|-de |
{true|false} Enable debug output. |
- |
-deploymentsystem|-desy |
Deployment system for exported feedback. | - |
-dir|-di |
Save all files in the given directory. Example:
-dir some/sub/directory |
- |
-exporiginalids|-dxoi |
Export will not emit ids as they were when the application was imported. | - |
-runalways|-ra |
{true|false} Set runAlways attribute to true in changelog. |
False |
-expaclassignments|-exacl |
Export ACL user role assignments. | - |
-expcomments|-exco |
Export developer comments. | - |
-expcomponents|-exc |
- | - |
-expfeedback|-exfe |
Export team development feedback for all workspaces or identified by -workspaceid. | - |
-expfeedbacksince|-exfs |
Export team development feedback since date in the format YYYYMMDD. | - |
-expfiles|-exfi |
Export all workspace files identified by -workspaceid. | - |
-expirnotif|-exir |
Export all interactive report notifications. | - |
-expminimal|-exmi |
Only export workspace definition, users, and groups. | - |
-expnosubscriptions|-exns |
Do not export references to subscribed components. | - |
-exppubreports|-exre |
Export all user saved public interactive reports. | - |
-expsavedreports|-exsr |
Export all user saved interactive reports. | - |
-expsupportingobjects|-exso |
Pass (Y)es, (N)o or (I)nstall to override the default. | - |
-expteamdevdata|-exte |
Export team development data for all workspaces or identified by -workspaceid. | - |
-exptranslations|-extr |
Export the translation mappings and all text from the translation repository | - |
-exptype|-exty |
Comma delimited list of export types to perform:
|
|
-expworkspace|-exwo |
Export workspace identified by -workspaceid or all workspaces if -workspaceid not specified. | - |
-fail-on-error|-foe |
{true|false} Set failonError attribute to true in changelog. |
False |
-instance|-in |
Export all applications. | - |
-skipexportdate|-ked |
Include export date in application export files. | - |
-labels|-la |
Label expression to use for filtering which changes to operate on. | - |
-list|-li |
Lists applications installed in the database. | - |
-log|-lo |
{true|false} Enable logging. Standard logging is Debug logging is |
- |
-nochecksum|-noch |
Overwrite existing files even if the contents have not changed. | - |
-overwrite-files|-ovf |
Overwrite any existing files in the directory. This will not affect other files. | = |
-split|-sp |
{true|false} This makes the export split the files into directories based on the object types. |
False |
-workspaceid|-woi |
Workspace ID to export all applications to or the workspace to be exported. | - |
Example
Generate APEX object:
-- Set default output path
SQL> cd <output-files-path>
-- Generate XML files
SQL> lb generate-apex-object
3.4.16 generate-changelog
Syntax
Liquibase|lb generate-changelog|gec {OPTIONS}
Options
Option | Description | Default |
---|---|---|
-data-output-directory|-daod |
Directory to write data to. | - |
-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. | - |
-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 Debug logging is |
- |
-output-default-schema|-ouds |
Control whether names of objects in the default schema are fully qualified or not. If true they are qualified. If false, only objects outside the default schema are fully qualified. | False |
-output-file|-ouf
<output-file> |
The name of the file to write the output to. | - |
-overwrite-files|-ovf |
Overwrite any existing files in the directory. This will not affect other files. | - |
-defaults-file|-def |
Fully qualified path to the properties file you want
to use. Example:
-defaults-file/tmp/liquibase.properties |
- |
-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|cp |
If true, remove functionality from file parsers that could be used insecurely. An example is disabling remote XML entity support. |
True |
Examples
Generate XML files for a database.
-- Set default output path
SQL> cd <output-files-path>
-- Generate xml files
SQL> lb generate-changelog
SQL> lb generate-changelog -schemas hr,sales
3.4.17 generate-controlfile
Syntax
Liquibase|lb generate-controlfile {OPTIONS}
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
Optional | ||
-debug|-de |
Enable debug output. | - |
-log|-lo |
Enable logging. Standard logging is Debug logging is |
- |
Example
Generate control file:
--Set default output path
SQL> cd <output-files-path>
SQL> lb generate-controlfile
3.4.18 generate-db-object
Syntax
lb generate-db-object|geo {OPTIONS}
Options
Option | Description | Default |
---|---|---|
-database-changelog-table-name|-dactn
<database-changelog-table-name> |
Name of table to use for tracking change history. | - |
-debug|-de |
Enable debug output | - |
-default-schema-name|-desn
<default-schema-name> |
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 |
- |
-fail-on-error|-foe |
Set failonError attribute to true in changelog. | False |
-liquibase-schema-name|-lbsn
<liquibase-schema-name> |
Schema to use for Liquibase objects. | - |
-liquibase-tablespace-name|-lbtn
<liquibase-tablespace-name> |
Tablespace to use for Liquibase objects. | - |
-log|-lo |
Enable logging | - |
-object-name|-obn |
Name of the object. | - |
-object-type| -obt |
Type of object. | - |
-output-default-schema|-ouds
<output-default-schema> |
Control 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 |
-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, which can be used insecurely. An example is disabling remote XML entity support. |
True |
-sql|-sq |
Generate a sql file along with the changelog showing the DDL for the object. This sql is not intended to be used for anything other than review. | - |
-replace|-re |
Set replaceIfExists attribute to true in changelog. | - |
-runalways|-ra |
Set runAlways attribute to false in changelog | - |
-runonchange|-rc |
Set runOnChange attribute to true in changelog. | - |
Example
Generate the XML file for a specific object.
-- Set default output path
SQL> cd <output-files-path>
-- Generate xml files
SQL> lb generate-object -object-type table -object-name employees
3.4.19 generate-ords-module
Syntax
Liquibase|lb generate-ords-module|geom {OPTIONS}
Options
Option | Description | Default |
---|---|---|
Required | ||
-module-name|-mon |
The module name for which to generate code. | - |
Optional | ||
-debug|-de |
Enable debug output. | - |
-exclude-enable-schema|-exes |
Dictates whether the enable_schema call will be included in the export. | - |
-exclude-privs|-exp |
Dictates whether privileges will be included in the export. | - |
-log|-lo |
Enable logging. Standard logging is Debug logging is |
- |
-overwrite-files|-ovf |
Overwrite any existing files in the directory. This will not affect other files. | - |
Example
Generate ORDS module object:
-- Set default output path
SQL> cd <output-files-path>
-- Generate XML files
SQL> lb generate-ords-module
3.4.20 generate-ords-schema
Syntax
Liquibase|lb generate-ords-schema|geos {OPTIONS}
Options
Option | Description | Default |
---|---|---|
-debug|-de |
Enable debug output. | - |
-exclude-enable-schema|-exes |
Dictates whether the enable_schema call is included in the export. | - |
-exclude-privs|-exp |
Dictates whether privileges will be included in the export. | - |
-log|-lo |
Enable logging. Standard logging is Debug logging is |
- |
-overwrite-files|-ovf |
Overwrite any existing files in the directory. This will not affect other files. | - |
3.4.21 generate-schema
Syntax
Liquibase|lb generate-schema|ges {OPTIONS}
This command uses custom extension functionality. XML files are generated defining
the DDL for each object in the database. A controller XML file is created or updated
identifying the individual XML files generated. The files are used to deploy using
UPDATE
commands.
Options
Option | Description | Default |
---|---|---|
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-database-changelog-table-name|-dactn |
Name of table to use for tracking change history | DATABASECHANGELOG |
-debug|-de |
Enable debug output. |
- |
-fail-on-error|-foe |
{true|false} Set failonError attribute to true in changelog. |
False |
-filter|-fi |
The filter value is the right-hand side of a SQL comparison, that is, a SQL comparison operator (=,!=, and so on) and the value compared against. The value must contain parentheses and quotation marks where appropriate. For example: "IN ('DEPT','EMP')" The filter value is combined with the object attribute corresponding to the object name to produce a WHERE condition in the query that fetches the objects. In the preceding example, objects named DEPT and EMP are retrieved. By default, all named objects of object_type are selected. | - |
-grants|-gr |
Export Object, System and Role grants. |
- |
-labels|-la |
Label expression to use for filtering which changes to operate on. | - |
-log|-lo |
Enable logging. Standard logging is Debug logging is |
- |
-overwrite-files|-ovf |
Overwrite any existing files in the directory. This will not affect other files. | - |
|
Setting this flag will cause all functions, procedures and packages to undergo a complete parse to determine dependencies. This addistional processesing will cause the generation to take more time. This flag should only be used when there is a sorting issue in functions, procedures or packages. | - |
-replace|-re |
Set replaceIfExists attribute to true in changelog. |
- |
-runalways|-ra |
Set runAlways attribute to false in changelog. |
- |
-runonchange|-rc |
Set runOnChange attribute to true in changelog. |
- |
-split|-sp |
This makes the export split the files into directories based on the object types. |
- |
-sql|-sq |
Generate a SQL file along with the changelog showing the DDL for the object. This SQL is not intended for anything other than review. |
- |
-synonyms|-sy |
Export public synonymns. |
- |
Examples
Generate XML files into separate directories.
-- Set default output path
SQL> cd <output-files-path>
-- Generate xml files
SQL> lb generate-schema -split
Generate XML files using a filter to include specific object types.
SQL> lb generate-schema -filter "IN ('DEPARTMENTS','EMPLOYEES')"
3.4.22 history
Syntax
Liquibase|lb history|hi {OPTIONS}
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
Optional | ||
-contexts|-co
<contexts> |
Context string to use for filtering the changes to operate on. | - |
-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 |
- |
-labels|-la
<labels> |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-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, which can 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 |
Example
Show the deployment history.
-- Connect to target
SQL> connect <db-connect-string>
SQL> lb history
3.4.23 list-locks
Syntax
Liquibase|lb list-locks|lil {OPTIONS}
The DATABASECHANGELOGLOCK
table is read to show lock details based
on the connection.
Options
Option | Description | Default |
---|---|---|
-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 |
- |
-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 |
- |
-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 |
3.4.24 mark-next-changeset-ran
Syntax
Liquibase|lb mark-next-changeset-ran|mancr {OPTIONS}
The mark-next-changeset-ran
command is used when deploy errors occur
due to Liquibase not being synchronized with changes made outside of Liquibase.
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
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 |
- |
-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 |
- |
-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 |
3.4.25 mark-next-changeset-ran-sql
Syntax
Liquibase|lb mark-next-changeset-ran-sql|mancrs {OPTIONS}
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
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 |
- |
-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 |
- |
-output-default-schema|-ouds |
Control whether names of objects in the default schema are fully qualified or not. If true, they are qualified. If false, only objects outside the default schema are fully qualified. | False |
-overwrite-files|-ovf |
Overwrite any existing files in the directory. This will not affect other files. | - |
-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. |
- |
-output-file|-ouf |
The name of the file to write the output to. | - |
3.4.26 release-locks
DATABASECHANGELOG
table.Syntax
Liquibase|lb release-locks|rel {OPTIONS}
Options
Option | Description | Default |
---|---|---|
-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 |
- |
-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 |
- |
-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, which can 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 |
3.4.27 rollback
Syntax
Liquibase|lb rollback|rb {OPTIONS}
The rollback command is used to revert all changes that were made to the database
after a defined tag. All deployed changes are rolled back until the tag row in the
DATABASECHANGELOG
table.
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
-tag|-ta |
The tag to use during the execution of the command. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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 |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-rollback-script|-ros |
Rollback script to execute. | - |
-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, which can 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 |
Example
Roll back changes to tag.
-- Set default output path
SQL> cd <output-files-path>
-- Connect to target
SQL> connect <db-connect-string>
-- Apply update for versions adding new tag for each version
SQL> lb update -changelog-file controller.xml
SQL> lb tag -tag version1
SQL> lb update -changelog-file controller.xml
SQL> lb tag -tag version2
-- Roll back to version1
SQL> lb rollback-sql -tag version1 -changelog-file controller.xml
3.4.28 rollback-count
Syntax
Liquibase|lb rollback-count|rbc {OPTIONS}
The rollback-count
command is used to revert the
specified number of changes to the database starting from the most recent
changes.
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
-count|-cu |
The number of changes to apply. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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 |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-rollback-script|-ros |
Rollback script to execute. | - |
-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 |
Example
Roll back the specified number of changes.
-- Set default output path
SQL> cd <output-files-path>
-- Connect to target
SQL> connect <db-connect-string>
-- Apply update for versions adding new tag for each version
SQL> lb update -changelog-file controller.xml
SQL> lb update -changelog-file controller.xml
-- Roll back to version1
SQL> lb rollback-count -count 1 -changelog-file controller.xml
3.4.29 rollback-count-sql
Syntax
Liquibase|lb rollback-count-sql|rbcs {OPTIONS}
The rollback-count
command is used to revert the
specified number of changes to the database starting from the most recent
changes.
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
-count|-cu |
The number of changes to apply. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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 |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-output-default-schema|-ouds |
Control whether names of objects in the default schema are fully qualified or not. If true they are qualified. 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. | - |
-overwrite-files|-ovf |
Overwrite any existing files in the directory. This will not affect other files. | - |
-rollback-script|-ros |
Rollback script to execute. | - |
-search-path|-sep
<search-path> |
Complete list of locations to search for files such as changelog files in. 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. |
- |
Example
Generate SQL to roll back the specified number of changes.
-- Set default output path
SQL> cd <output-files-path>
-- Connect to target
SQL> connect <db-connect-string>
-- Apply update for versions
SQL> lb update -changelog-file controller.xml
SQL> lb update -changelog-file controller.xml
-- Roll back to version1
SQL> lb rollback-count-sql -count1 -changelog-file controller.xml
3.4.30 rollback-sql
Syntax
Liquibase|lb rollback-sql|rbs {OPTIONS}
The SQL will contain all deployed changes being rolled back until the
tag row in the DATABASECHANGELOG
table.
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
-tag|-ta |
The tag to use during the execution of the command. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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 |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-output-default-schema|-ouds |
Control whether names of objects in the default schema are fully qualified or not. If true they are qualified. 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. | - |
-overwrite-files|-ovf |
Overwrite any existing files in the directory. This will not affect other files. | - |
-rollback-script|-ros |
Rollback script to execute. | - |
-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 |
Example
Generate SQL to roll back the specified number of changes.
-- Set default output path
SQL> cd <output-files-path>
-- Connect to target
SQL> connect <db-connect-string>
-- Apply update for versions adding new tag for each version
SQL> lb update -changelog-file controller.xml
SQL> lb tag -tag version1
SQL> lb update -changelog-file controller.xml
SQL> lb tag -tag version2
-- Roll back to version1
SQL> lb rollback-sql -tag version1 -changelog-file controller.xml
3.4.31 rollback-to-date
Syntax
Liquibase|lb rollback-to-date|rbtd {OPTIONS}
The rollback-to-date command is used to revert changes from today's date to the specified date and time..
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
-date|-da [ |
Date to use when determining what changes to apply. The date format is YYYY-MM-DD HH:MM:SS. If including time, enclose the entire date/time in double quotes. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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 |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-rollback-script|-ros |
Rollback script to execute. | - |
-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 |
Example
Roll back to the specified date and time.
-- Set default output path
SQL> cd <output-files-path>
-- Connect to target
SQL> connect <db-connect-string>
-- Apply update update on 2022-09-01
SQL> lb update -changelog-file controller.xml
-- Apply update on 2022-09-02
SQL> lb update -changelog-file controller.xml
-- Apply update on 2022-09-03
SQL> lb update -changelog-file controller.xml
-- Roll back to version1
SQL> lb rollback-to-date -date 2022-09-02 -changelog-file controller.xml
3.4.32 rollback-to-date-sql
Syntax
Liquibase|lb rollback-to-date-sql|rbtds {OPTIONS}
The rollback-to-date-sql
command is used to generate
SQL to revert changes from today's date to the specified date and time.
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
-date|-da [ |
Date to use when determining what changes to apply. The date format is YYYY-MM-DD HH:MM:SS. If including time, enclose the entire date/time in double quotes. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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 |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-output-default-schema|-ouds |
Control whether names of objects in the default schema are fully qualified or not. If true they are qualified. 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. | - |
-overwrite-files|-ovf |
Overwrite any existing files in the directory. This will not affect other files. | - |
-rollback-script|-ros |
Rollback script to execute. | - |
-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, which can be used insecurely. An example is disabling remote XML entity support. |
True |
Example
Generate SQL to roll back the specified date.
-- Set default output path
SQL> cd <output-files-path>
-- Connect to target
SQL> connect <db-connect-string>
-- Apply update on 2022-09-01
SQL> lb update -changelog-file controller.xml
-- Apply update on 2022-09-02
SQL> lb update -changelog-file controller.xml
-- Apply update on 2022-09-03
SQL> lb update -changelog-file controller.xml
-- Roll back to version1
SQL> lb rollback-to-date-sql -date 2022-09-02 -changelog-file controller.xml
3.4.33 snapshot
Syntax
Liquibase|lb snapshot|sn {OPTIONS}
The snapshot command is used to:
- Review and track changes in your target database
- Compare a previous database state to an online database
- Compare a previous database state to another snapshot
Options
Option | Description | Default |
---|---|---|
-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 |
- |
-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 |
- |
-output-file|-ouf |
The name of the file to write the output to. | - |
-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 |
-snapshot-format|-snf |
Output format to use (JSON, YAML, or TXT) | - |
-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 |
Example
Generate a snapshot capturing the current state of a database.
-- Set default output path
SQL> cd <output-files-path>
-- Connect to target
SQL> connect <db-connect-string>
-- Take a snapshot
SQL> lb snapshot -snapshot-format json -outputfile snaptgt20220901.json
3.4.34 status
Syntax
Liquibase|lb status|st {OPTIONS}
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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 |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-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 |
-verbose|-ve |
Verbose flag | 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 |
Example
Report the number of undeployed changesets and identify them.
-- Set default output path
SQL> cd <output-files-path>
-- Check the status
SQL> lb status -verbose -changelog-file controller.xml
3.4.35 tag
Syntax
Liquibase|lb tag|ta {OPTIONS}
For example, you can use the tag to mark the current database state for version,
release, and so on. The tag is added to the last row in the
DATABASECHANGELOG
table.
Options
Option | Description | Default |
---|---|---|
Required | ||
-tag|-ta |
The tag to use during the execution of the command. | - |
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 |
- |
-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 |
- |
-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 |
Example
Create initial tag and version tags.
-- Set default output path
SQL> cd <output-files-path>
-- Connect to target and add base tag
SQL> connect <db-connect-string>
SQL> lb tag -tag baseversion1
-- Apply update for version adding and add new tag for each version
SQL> lb update -changelog-file controller.xml
SQL> lb tag -tag version1
3.4.36 tag-exists
Syntax
Liquibase|lb tag-exists|tae {OPTIONS}
Options
Option | Description | Default |
---|---|---|
Required | ||
-tag|-ta |
The tag to use during the execution of the command. | - |
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 |
- |
-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 |
- |
-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 |
3.4.37 unexpected-changesets
Syntax
Liquibase|lb unexpected-changesets|unc {OPTIONS}
This command detects and compares the changes between the
DATABASECHANGELOG
table and the current changelog and
reports:
- Changesets in the
DATABASECHANGELOG
table that do not exist in the current changelog. - Previously deployed changesets that were deleted from your current changelog.
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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
<defaults-file> {FILE} |
Fully qualified path to the properties file you want
to use. For example, defaults-file
/tmp/liquibase.properties |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-output-default-schema|-ouds |
Control whether names of objects in the default schema are fully qualified or not. If true they are qualified. 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. | - |
-overwrite-files|-ovf |
Overwrite any existing files in the directory. This will not affect other files. | - |
-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, which can be used insecurely. An example is disabling remote XML entity support. |
True |
-verbose |-ve |
Verbose flag | True |
Example
Report unexpected changesets.
-- Set default output path
SQL> cd <output-files-path>
-- Connect to target and run command
SQL> connect <db-connect-string>
SQL> lb unexpected-changesets -changelog-file controller.xml
3.4.38 update
Syntax
Liquibase|lb update|up {OPTIONS}
When you run the update command, the changesets in the changelog file
are read sequentially. The unique identifiers (file::id::author) in the file are
compared to those stored in the DATABASECHANGELOG
table.
- If the unique identifiers do not exist, Liquibase will apply the changeset to the database.
-
If the unique identifiers exist, the MD5Sum of the changeset is compared to the one in the database.
If they are different, Liquibase will produce an error message that someone has changed it unexpectedly.
If the status of the runOnChange or runAlways changeset attribute is set to TRUE, Liquibase will re-apply the changeset. Example: <changeSet id="2" author="bob" runAlways="true">
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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 |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-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 |
-show-summary|-shs
<show-summary> {OFF|SUMMARY|VERBOSE}
|
Produces a summary list of any changesets skipped and why they were skipped. Valid values are OFF, SUMMARY, and VERBOSE. | SUMMARY |
-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 |
-override-app-alias|-ovaa |
Override value to be used for the APEX application alias. | - |
-override-app-id|-ovai |
Override value to be used for the APEX application id. | - |
-override-app-schema|-ovas |
Override value to be used for the APEX workspace schema. | - |
-override-app-workspace|-ovaw |
Override value to be used for the APEX application workspace. | - |
3.4.39 update-count
Syntax
Liquibase|lb update-count|upc {OPTIONS}
The update-count
command applies changes and updates
changesets sequentially, starting from the top of the changelog file until the
number specified is reached.
- If the unique identifiers do not exist, Liquibase will apply the changeset to the database.
-
If the unique identifiers exist, the MD5Sum of the changeset is compared to the one in the database.
If they are different, Liquibase will produce an error message that someone has changed it unexpectedly.
If the status of the runOnChange or runAlways changeset attribute is set to TRUE, Liquibase will re-apply the changeset. Example: <changeSet id="2" author="bob" runAlways="true">
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
-count|-cu |
The number of changes to apply. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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 |
- |
-labels|l- |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-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 |
-show-summary|-shs
<show-summary> {OFF|SUMMARY|VERBOSE}
|
Produces a summary list of any changesets skipped and why they were skipped. Valid values are OFF, SUMMARY, and VERBOSE. | SUMMARY |
-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 |
Example
Update database with the specified number of changesets in the changelog file.
SQL> cd <lb-changes-directory>
SQL> lb update -changelog-file controller.xml -count 2
3.4.40 update-count-sql
Syntax
Liquibase|lb update-count-sql|upcs {OPTIONS}
Liquibase uses the raw SQL to apply database changes you have added to the changelog file.
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
-count|-cu |
The number of changes to apply. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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 |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-output-default-schema|-ouds |
Control whether names of objects in the default schema are fully qualified or not. If true they are qualified. 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. | - |
-overwrite-files|-ovf |
Overwrite any existing files in the directory. This will not affect other files. | - |
-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 |
3.4.41 update-sql
update
command.Syntax
Liquibase|lb update-sql|ups {OPTIONS}
Liquibase uses the raw SQL to apply database changes you have added to the changelog file.
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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 |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-output-default-schema|-ouds |
Control whether names of objects in the default schema are fully qualified or not. If true they are qualified. 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. | - |
-overwrite-files|-ovf |
Overwrite any existing files in the directory. This will not affect other files. | - |
-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 |
-override-app-alias|-ovaa |
Override value to be used for the APEX application alias. | - |
-override-app-id|-ovai |
Override value to be used for the APEX application id. | - |
-override-app-schema|-ovas |
Override value to be used for the APEX workspace schema. | - |
-override-app-workspace|-ovaw |
Override value to be used for the APEX application workspace. | - |
3.4.42 update-testing-rollback
Syntax
Liquibase|lb update-testing-rollback|uptr {OPTIONS}
Use only when all pending changelogs have been verified as ready to be deployed.
update changeset1; update changeset2; update changeset3\
rollback changeset3; rollback changeset2; rollback changeset1
update changeset1; update changeset2; update changeset3
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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 |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-output-default-schema|-ouds |
Control whether names of objects in the default schema are fully qualified or not. If true they are qualified. 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. | - |
-overwrite-files|-ovf |
Overwrite any existing files in the directory. This will not affect other files. | - |
-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. |
- |
3.4.43 update-to-tag
Syntax
Liquibase|lb update-to-tag|uptt OPTIONS
The update-to-tag command will deploy changes only when you have
previously added a tag Database Change Type in your changelog file. You cannot use
the update-to-tag command with the reference to a tag created in the
DATABASECHANGELOG
table using the tag command. An update-to-tag-sql
should always be run to review the SQL before running update-to-tag.
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
-tag|-ta |
The tag to use during the execution of the command. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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 |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-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. |
- |
-show-summary|-shs
<show-summary> {OFF|SUMMARY|VERBOSE}
|
Produces a summary list of any changesets skipped and why they were skipped. Valid values are OFF, SUMMARY, and VERBOSE. | SUMMARY |
-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 |
Example
Update database with the changesets up to and including the changeset with the specified database tag.
SQL> cd <lb-changes-directory>
-- Edit changelog file and add tagDatabase entries for versions
-- Execute an update-to-tag using a tag specified in tagDatabase in the changelog file
SQL> lb update-to-tag -tag version1 -changelog-file controller.xml
3.4.44 update-to-tag-sql
Syntax
Liquibase|lb update-to-tag-sql|uptts {OPTIONS}
An update-to-tag-sql should always be run to review the SQL before
running update-to-tag The update-to-tag-sql
command will generate
SQL when you have previously added a tag Database Change Type in your changelog
file. You cannot use the update-to-tag command with the reference to a tag created
in the DATABASECHANGELOG
table using the tag cde command.
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
-tag|-ta |
The tag to use during the execution of the command. | - |
Optional | ||
-contexts|-co |
Context string to use for filtering which changes to operate on. | - |
-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 |
- |
-labels|-la |
Label expression to use for filtering the changes to operate on. | - |
-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 |
- |
-output-default-schema|-ouds |
Control whether names of objects in the default schema are fully qualified or not. If true they are qualified. 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. | - |
-overwrite-files|-ovf |
Overwrite any existing files in the directory. This will not affect other files. | - |
-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 |
Example
Update database with the changesets up to and including the changeset with the specified database tag.
SQL> cd <lb-changes-directory>
-- Edit changelog file and add tagDatabase entries for version1
SQL> lb update-to-tag-sql -tag version1 -changelog-file controller.xml
3.4.45 validate
UPDATE
to fail.Syntax
Liquibase|lb validate|va {OPTIONS}
The following checks are done:
- XML, YAML, JSON, and SQL structure
- Referenced files exist
- Required or prohibited attributes are correct for your database
- Duplicated id, author, and file combinations
- Checksum errors
Options
Option | Description | Default |
---|---|---|
Required | ||
-changelog-file|-chf |
The root changelog file. | - |
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 |
- |
-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 |
- |
-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 |
Example
Validate before running UPDATE.
-- Set default output path
SQL> cd <output-files-path>
-- Connect to target and validate
SQL> connect <db-connect-string>
SQL> lb validate -changelog-file controller.xml