9.12.33 snapshot

Capture the current state of a target database.

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 INFO level (no debug flag).

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

-
-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