Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...

We strongly recommend to use runtime credentials because it is more secure than stored credentials (due to the possibility of the stored password being decoded).

See Securing the Database Credential ManagementConnection

Single-credential

Commands that work on a single database (dbdef) require the -un <username> and -pw <password> options to specify the database credentials.

...

Code Block
titleDatical DB CLI Help
collapsetrue
USAGE: hammer [OPTION]... [COMMAND] [OPTIONS]...
Use 'hammer help options' for available options
Use 'hammer help [COMMAND] for more help on a command

AVAILABLE COMMANDS:
     add-to-property: Add a path to a property.
         addContexts: Add contexts to change sets.
           addLabels: Add labels to change sets.
      assignMetadata: Assign metadata information to a label.
       changelogSync: Mark all changes as executed in the database.
        checkDrivers: Check that JDBC driver jars are installed or on the specified paths.
          checkRules: Compiles rules and reports any errors.
      clearCheckSums: Delete the checksums used to detect altered change sets from the tracking tables.
              dbshow: List all databases for a project, along with extra info about each.
              deploy: Deploy the changelog, updating the target database's schema to the latest version.
 deploy-autoRollback: Deploy the changelog to the target database; if an error occurs, rollback to the revision before the command was given.
                diff: Compares two databases and produces a report.
       diffChangelog: Compares two databases and produces a changelog.
      findChangeSets: Locates changesets based on label expression and script checksum
            forecast: Simulate unexecuted change sets against the specified database.
              groovy: Run a script that can use DaticalLiquibase DBEnterprise REPL commands using the Groovy script engine.
                help: Print help on available commands.
             history: Show the applied change set history of a database.
insertSavedAuditData: Insert all audit entries temporarily saved in the project into the user-configured DMC DB.
      installDrivers: Run the custom script 'installDrivers.groovy'.
      installLicense: Install a license file to allow continued use of DaticalLiquibase DBEnterprise.
     modifyChangeSet: Modify changeset attributes.
        releaseLocks: Unlock a locked environment so that Datical/Liquibase commands can be run against it.
      removeContexts: Remove contexts from change sets. 
        removeLabels: Remove labels from change sets.
            rollback: Roll the target database back to a previous state, using a variety of methods.
            runRules: Runs rules from the SQLRules folder on the specified SQL file or folder of SQL files.
         schemaStats: Display summary schema info.
                 set: Set properties, database definitions, etc. See 'set help' for more information and sub commands.
                show: Display project properties, database definitions, etc. See 'show help' for more information and sub commands.
            snapshot: Captures a snapshot of a database as either a persistent object file or as a Liquibase changelog.
              status: Show the deployment status of a database.
       statusDetails: Show detailed status for each of the changesets in the changelog.
         testConnect: Test the connection for one or more databases.
    uninstallDrivers: Run the custom script 'uninstallDrivers.groovy'.
 validateStoredLogic: Compiles stored logic and reports any validation errors.
    versionChangeLog: Upgrades project changelog to the current version.

...

There are several ways to configure Datical DB Liquibase Enterprise to use the JDBC drivers that communicate with the databases being managed. The preferred method is to install the drivers into the OSGi environment using the installDrivers command. Drivers can also be found by creating a properties file in the project and then either

...

Run the command from a valid Datical DB Liquibase Enterprise project directory.


...

clearCheckSums

...

Use only under the direction of a Datical Liquibase Support Engineer or if you are very experienced with Datical DB.Liquibase Enterprise

This command is helpful when you need to respond to a change to an existing object that is made outside of Datical DBLiquibase Enterprise. For example, someone uses a SQL script to change a database directly.  It allows you to update the change set that creates this object and clear the existing checksums to avoid validation errors. The checksums are recreated on the next deploy or changeLogSync command. 

...

Export and scrub sensitive data from files to be sent to Datical Liquibase support for debugging or troubleshooting.

...

deploy myAppDevDb --log=/home/user/dbadmin/daticallogsliquibaselogs/ --report=/home/user/dbadmin/daticalreports liquibasereports --context=dev,integration --labels="JUN AND (poolApp or beachApp)" --invalidsAction=fail

DATICAL SERVICE OPTIONS

Use these options to access a project that is stored on Datical Service. 

  • --daticalServer=<cluster-name> - The cluster name set for Datical Service. The cluster name is set during Datical Service installation. 
  • --daticalUsername=<user> - User name, must be configured in Datical Service. Use the DATICAL_PASSWORD environment variable to provide the password. 
  • --projectKey=<projectRef> - Project to use, specified <projectRef>,  a project name or project key. The project key is defined in Datical Service only. 

OPTIONS

...

OPTIONS

  • log - When set, the daticaldb.log file will be written to the directory specified. Log is written to Logs directory of project by default.
  • enableRowCount - exact | approximate | disabled, method for counting rows in tables. Default is disabled. 
    • Before v5.7 used true | false, with default as true. New default is disabled. Older projects are interpreted correctly and mapped to the new values. 
  • pipeline - Specifies the pipeline associated with the changelogSync for reporting purposes.
    • If not set and the dbDef is a member of only one pipeline, then that pipeline is used.
    • If not set and the dbDef is a member of multiple pipelines, then an error is returned.
  • report - When set, deploy report will be written to the directory specified. Log Report is written to Logs the Reports directory of project by default.
  • enableRowCount - exact | approximate | disabled, method for counting rows in tables. Default is disabled. 
    • Before v5.7 used true | false, with default as true. New default is disabled. Older projects are interpreted correctly and mapped to the new values. 
  • pipeline - Specifies the pipeline associated with the changelogSync for reporting purposes.
    • If not set and the dbDef is a member of only one pipeline, then that pipeline is used.
    • If not set and the dbDef is a member of multiple pipelines, then an error is returned.
  • report - When set, deploy report will be written to the directory specified. Report is written to the Reports directory by default.
  • context - When set, only change sets marked with the contexts specified will be executed. To run all contexts, specify $all.
  • labels - When set, only change sets marked with the label expression will be executed. To run all labels, specify $all.
  • mergeLabels - Label merge strategy, one of override (default), merge (AND), append (OR). Specifies how to combine labels set on the command line with labels set on the step. 
  • deployMode - Override the deployMode project setting, either full (default), which includes forecasting and rules checking, or quick.
  • limitForecast - Override the limitForecast project setting. Set to either false (default), where forecasting is done for all objects in the target database, or true, which limits forecasting to objects directly affected by the deployment. 
  • immutableProject - When running with Datical Service options, set to true to use the local project files rather than download the project information from Datical Service. Helpful in automated environments where project files are kept in artifact repositories. 
  • invalidsAction - Override the storedLogicValidityAction project setting for this deploy.
    • warn: Set to either warn (default), current behavior. New invalid stored logic will cause the Deploy to flag as deployment warning.
    • fail: New invalid stored logic will cause a deployment to be marked as a failure.
      Option would be applied when Stored Logic Validity Check is not disabled.

diff

Compare two databases and produce a report. Compares two database definitions in a project and produces a text report of the differences.

USAGE

diff <referenceDB> <targetDb> [--output=/path/to/report]

EXAMPLE

diff myAppDevDB myAppQaDB --output=<path>

OPTIONS

  • referenceDB - database that represents the desired state
  • targetDB - database that is out of synchronization and needs to be caught up to the state of referenceDB.
  • output - If present, specifies a file for the report. If not specified, the report is sent to STDOUT

diffChangelog

Compares two database definitions in a project and produces the change sets necessary to synchronize the databases.

USAGE

diffChangelog <referenceDB> <targetDb> [--output=<path>] [--assignLabels=<labels>] [--assignContexts=<contexts>] [–-scriptChecksum=<checksum>]

EXAMPLE

myAppDevDB myAppQaDB --output=/home/user/diffChangeLogsdir/diffChangeLog.xml --assignLabels=label1,label2 --assignContexts="(contextOne and contextTwo)" 

OPTIONS

  • referenceDB - database that represents the desired state, either a dbdef in the project or a snapshot file. 
  • targetDB - database that is out of synchronization and needs to be caught up to the state of referenceDB, either a dbdef in the project or a snapshot file
  • output - if present, specifies the file for the generated changelog. Use file extension .xml. If not specified, output is written to  the Reports/DiffChangeLogs subdirectory under the project directory. If the file exists, the results of the command (changesets) are appended to the existing file. 
  • assignLabels - apply this set of labels applied to all changesets created. Accepts a comma separated list of labels.
  • assignContexts - apply this set of contexts to to all changesets created. Accepts a complex context expression.
  • scriptChecksum - SQL script checksum value

forecast

Simulate unexecuted change sets and run rules against the specified database.

USAGE

forecast <dbdef> [--log=/path/to/log]  [--enableRowCount=exact|approximate|disabled] [--report=/path/to/report] [--context=context1,context2] [--labels=<label expression>][--mergeLabels=override|merge|append][--limitForecast=true|false][--immutableProject=<true|false]

EXAMPLE

forecast myAppDevDb --log=/home/user/logs/ --report=/home/user/reports --context=dev,qa --labels="JUN AND (poolApp or beachApp)" --limitForecast=true

DATICAL SERVICE OPTIONS

Use these options to access a project that is stored on Datical Service. 

  • --daticalServer=<cluster-name> - The cluster name set for Datical Service. The cluster name is set during Datical Service installation. 
  • --daticalUsername=<user> - User name, must be configured in Datical Service. Use the DATICAL_PASSWORD environment variable to provide the password. 
  • --projectKey=<projectRef>Project to use, specified <projectRef>,  a project name or project key. The project key is defined in Datical Service only. 

OPTIONS

  • <dbdef> - project dbdef name of the database to use for forecasting
  • log - Location to write the daticaldb.log file. Log is written to Logs directory of project by default.
  • enableRowCount - exact | approximate | disabled, method for counting rows in tables. Default is disabled. 
    • Before v5.7 used true | false, with default as true. New default is disabled. Older projects are interpreted correctly and mapped to the new values. 
  • report - Location to write the forecast report. Report is written to the Reports directory by default.
  • context - Only change sets marked with the contexts specified are executed. To run all contexts, specify $all.
  • labels - When set, only change sets marked with the label expression are executed. To run all labels, specify $all.
  • mergeLabels - Label merge strategy, one of override (default), merge (AND), append (OR). Specifies how to combine labels set on the command line with labels set on the step. 
  • limitForecast - Override the limitForecast project setting. Set to either false (default), where forecasting is done for all objects in the target database, or true, which limits forecasting to objects directly affected by the potential deployment. 
  • immutableProject - When running with Datical Service options, set to true to use the local project files rather than download the project information from Datical Service. Helpful in automated environments where project files are kept in artifact repositories. 

groovy

Run a Groovy script. Runs a script of Datical DB commands using the Groovy script engine.  

USAGE

groovy <script-name> <script-options>

EXAMPLE

groovy myScript.groovy show(project, ["dbprop", "myProject", "enableStorageOptions"])

OPTIONS

  • <script-name> - path to a script name
  • <script-options> - Options to pass to the script

NOTES

To access Datical DB commands through the script, access them through the DaticalDb object. The parameters for a command are (project, List<String> <[parameters]>). Use the word "project" as shown below.

Exceptions: add-to-property is accessed by addToProperty and deploy-autoRollback is accessed by deploy-AutoRollback.

Examples:

help(project, [])

help(project, ["groovy"])

show(project, ["dbprop", "myProject", "enableStorageOptions"])

help

Show help on Datical DB commands.

USAGE

help

help <command>|options

set help

show help

EXAMPLE

help diff

OPTIONS

  • <command> - Name of the command you'd like to learn about.
  • options - list of options used by the commands

NOTES

When run without a command option, lists all available commands and a brief description of each.

SEE ALSO

The set and show commands. 

history

Show the applied changeset history of a database. Shows all changesets that have been applied to the specified DbDef.

USAGE

history <dbdef>

EXAMPLE

history QAdb

OPTIONS

  • <dbdef> - project dbdef name of the database to use.

insertSavedAuditData (deprecated)

Insert all audit entries temporarily saved in the project into the user-configured DMC DB.

USAGE

insertSavedAuditData --project=<path>
insertSavedAuditData

OPTIONS

  •   project - Path to the project directory to use for inserting saved DMC DB data.

NOTES

If run without an option, the command runs in the current directory. The command fails if the directory is not a valid project directory.

Sometimes an operation (like deploy) encounters a condition that prevents information from being written to the DMC database. In that case, the information is saved to a temporary on-disk database. Use this command to move the on-disk data to the configured DMC database once connectivity to the DMC database has been restored.

installDrivers

Run the custom script installDrivers.groovy. Installs OSGi packaged JDBC drivers from the specified update site

USAGE

hammer installDrivers <driver_update_site>

EXAMPLE

hammer installDrivers http://update.datical.com/drivers/updates/

NOTES

Update sites can be either HTTP URLs (as shown above) or directories on a file system.

Examples of <driver_update_site>:

  • Composite Archive (Windows and Linux):
       jar:file:/C:/Users/Pete/DaticalDBCompositeRepo-4.26.4467.zip
       jar:file:/home/Users/Pete/DaticalDBCompositeRepo-4.26.4467.zip
  • Extracted Archive (Windows and Linux):
       file:/C:/Users/Pete/DaticalDBCompositeRepo-4.26.4467/
       file:/home/Pete/DaticalDBCompositeRepo-4.26.4467/

installLicense

Install a license file to allow continued use of Datical DB. Once a license is installed on a machine once, it does not typically need to be installed again.

USAGE

installLicense <path>

EXAMPLE

installLicense /home/datical/datdb.lic

OPTIONS

  • <path> - Specifies where to find the file that contains the Datical DB product license.

NOTES

If you need to obtain or renew a license please email support@datical.com.

licenseCounter

Count the DbDefs in use for licensing validation.

USAGE

hammer licenseCounter <projects_dir> [ showDebug=true ]

EXAMPLE

Linux: hammer licenseCounter ~/datical
Windows: hammer.bat licenseCounter C:\Datical\Projects

OPTIONS

  • <projects_dir> - Specifies the top directory to begin scanning project files.  It can be a relative or absolute path. All project files in the file hierarchy under this directory are scanned. 
  • showDebug=true - Show additional detailed information as the command runs.  

NOTES

Output is sent to stdout. Redirect to a file to save it. 

modifyChangeSet

Modify changeset attributes

USAGE

modifyChangeSet --action=<action> --<modify-option>[=<value>, ...]... [--<search-option>=<value>, ...]...

EXAMPLE

hammer modifyChangeSet --action=ADD --modifyLabels=history --searchIgnore=true

hammer modifyChangeSet --action=REMOVE --modifyContext=QA4 --searchContexts=QA4

hammer modifyChangeSet --action=ADDALL --modifyContexts=DEV,PATCH01

hammer modifyChangeSet --action=REMOVEALL --modifyContexts=PATCH01

hammer modifyChangeSet --action=ADD --modifyIgnore --searchLabels=MyScriptName123.sql

hammer modifyChangeSet --action=ADD --modifyContexts=DEV,NEWCONTEXT --modifyLabels=MyTestSsisPackage --searchOrigFilePaths=ssis/MyTestSsisPackage

OPTIONS

Action

  • action - Specifies the action to perform, one of ADD, REMOVE, ADDALL, REMOVEALL
    • All actions require at least one modify option. 
    • If you specify ADD or REMOVE, you must also specify a search option. 
    • If you specify ADDALL or REMOVEALL, do not specify a search option. If you do, the command fails with an error. 

Modify Option

At least one modify option is required. It specifies what change to make. It can be one of the following:

  • modifyContexts - One or a comma-separated list of values for the context attribute.  
  • modifyIgnore - Change the value of the ignore attribute. It does not take a value. The ADD action sets ignore=true. The REMOVE action sets ignore=false.
  • modifyLabels - One or a comma-separated list of values for the label attribute.  

When a value is added to an attribute, it is added at the end of the existing list and the order of the list is preserved. If the value already exists, it is not added again. 

When a value is removed from an attribute, the order of the remaining values is preserved. 

When you specify more than one modify option, all modifications of the same type (context, ID, label) are put together and applied at one time. 

Search Option

The search options determine which changesets to modify. They select a list of changesets for the modify options to work on. 

Searches are not case-sensitive. 

  • Multiple values in one statement are OR'ed together. 
  • Multiple search option statements are ANDed together.

Search option statements take one or a comma-separated list of values. They are provided for changeset attributes as follows: 

  • searchIds - id
  • searchLabels - label
  • searchContexts - context
  • searchIgnore - ignore - true | false - Searches for false also return changesets where the ignore attribute is not set. true | false
  • searchOrigFilePaths - origFilePath
  • searchOrigFileNames - origFileName
  • searchVersion - version, an integer. 

OUTPUT

The command reports the number of changesets that met the search criteria. If no changesets meet the criteria, the command succeeds and reports that no changesets met the search criteria. 

ERRORS

The command fails and reports an error when:

  • No action is specified or an invalid value is specified.
  • An action is valid but no modify options are specified.
  • ADDALL or REMOVEALL is specified as an action and a search option is specified. 
  • ADD or REMOVE is specified as an action and a search option is not specified. 
  • An invalid value is specified for searchIgnore. It must be true or false.  

NOTES

The modifyChangeSet command is intended to make it easier to work with labels and contexts.

  • Searching - Make it easier to find a changeset: Search by criteria other than a label name, particularly criteria that can be unique (origFilePath, origFileName, ID).
  • Labels - Manage labels for a release, especially for later steps in a pipeline.
  • Contexts - Use context settings as a gating mechanism for deploying to a specified environment (context)

Context expressions and label expressions are not currently supported. Use comma-separated lists for multiple values. 

Starting with version 4.32, Use this command rather than the following commnds, which are deprecated and may be removed in a future release:

  • addLabels
  • removeLabels
  • addContexts
  • removeContexts

newDbDef

Creates a new dbDef based on the key/value pairs specified as arguments.

  • Oracle
    • Inline Credentials:  OracleDbDef
    • Run-Time Supplied Credentials:  DelayedCredentialOracleDbDef
  • SQL Server
    • Inline Credentials:  SqlServerDbDef
    • Run-Time Supplied Credentials:  DelayedCredentialSqlServerDbDef
  • Postgres Enterprise DB
    • Inline Credentials:  PostgresqlDbDef
    • Run-Time Supplied Credentials:  DelayedCredentialPostgresDbDef
  • DB2
    • Inline Credentials:  Db2DbDef
    • Run-Time Supplied Credentials:  DelayedCredentialDb2DbDef
  • (deprecated) MySQL Inline Credentials:  MysqlDbDef

...

newDbDef DbDefClass <value> name <value> hostname <value> port <value> username <value> password <value> database <value> ... <key> <value>

AVAILABLE KEYS

  • DbDefClass - Database Type. (OracleDbDef|Db2DbDef|MysqlDbDef|SqlServerDbDef|PostgresqlDbDef|DelayedCredentialOracleDbDef|DelayedCredentialSqlServerDbDef|DelayedCredentialPostgresDbDef|DelayedCredentialDb2DbDef)

  • name - The name for the dbDef. Used in the CLI and GUI as an alias for this connection.

  • hostname - The hostname/ip of the target database server.

  • port - The port number for JDBC connections to the target database server.

  • username - The database user name to use for the connection.

  • password - The password for the database user.

  • database - (MySQL|DB2|PostGRE) The name of the database to manage. Not applicable to Oracle databases.

  • databaseName - (SQLServer) The name of the database to manage.

  • instanceName - (SQLServer) The name of the instance to manage.

  • applicationName - (SQLServer) The name of the database application to manage.

  • sid - (Oracle) The name of the Oracle SID to manage.

  • serviceName - (Oracle) The name of the Oracle Service to manage.

  • tnsName - (Oracle) The TNS name for the Oracle host and service to manage. Requires the tnsnames.ora configuration file on the client.
  • defaultSchemaName - The name of the schema to manage.

  • defaultCatalogName - The name of the catalog to manage. 
  • contexts - A comma separated list of contexts.

  • labels - A comma separated list of labels. 
  • dbDefType - One of "standard" (default, for a managed database) or "dmcdb" for the Deployment Monitoring Console Database.
  • storageOptionCollectedAtSnapshot - (true/false) Collect storage options for database objects (table, index, etc.)

newProject

Creates a new empty project in the current directory.

USAGE

newProject [projectName]

EXAMPLE

newProject myProject

OPTIONS

  • projectName - Specifies the project name. If not specified, the name newProject is used.

NOTES

Create the project directory before creating the project. This command does NOT create a new directory for the project. 

releaseLocks

Reset the lock Datical creates in an environment to prevent concurrent Datical operations.

USAGE

        hammer releaseLocks <dbDef>

EXAMPLE

        hammer releaseLocks PROD_DB 

NOTES

        Typically this lock is cleared at the end of a deployment but a deployment that ends prematurely may leave this lock in place. Subsequent deployments to such an environment will fail until the lock is released.

removeContexts

Remove contexts from changesets. 

Info
titleNote
Starting with v4.32, please use the modifyChangeSet command. The removeContexts command is deprecated and support may be removed in the future. 

USAGE

removeContexts --lookupChangeset=<label-expression> --context=<contexts> [--scriptChecksum=][--matchAll=true|false]

OPTIONS

  • lookupChangesets - Label expression used to matchthe change sets (required)
  • context - Comma-separated list of contexts (required)
  • scriptChucksum - SQL script checksum value
  • matchAll - SQL Script checksums must match for change set lookup. Default value is true. 

NOTES

The value of the scriptChecksum parameter can be used to further qualify change sets that match the label expression. This is used primarily in the Deployment Packager to confirm that the change set was generated by the expected version of a script.

The value of the matchAll parameter impacts the matching behavior of the scriptChecksum parameter.

  • If matchAll is true, all change sets identified by the label expression must have a scriptChecksum attribute that matches the attribute passed on the command line.
  • If matchAll is false, only one change set returned by the label expression needs to have a matching scriptChecksum attribute.

removeLabels

Remove labels from changesets. 

Info
titleNote
Starting with v4.32, please use the modifyChangeSet command. The removeLabels command is deprecated and support may be removed in the future. 

USAGE

removeLabels --lookupChangeset=<label-expression> --context=<contexts> [--scriptChecksum=][--matchAll=true|false]

OPTIONS

  • lookupChangesets - Label expression used to matchthe change sets (required)
  • context - Comma-separated list of contexts (required)
  • scriptChucksum - SQL script checksum value
  • matchAll - SQL Script checksums must match for change set lookup. Default value is true. 

NOTES

The value of the scriptChecksum parameter can be used to further qualify change sets that match the label expression. This is used primarily in the Deployment Packager to confirm that the change set was generated by the expected version of a script.

The value of the matchAll parameter impacts the matching behavior of the scriptChecksum parameter.

  • If matchAll is true, all change sets identified by the label expression must have a scriptChecksum attribute that matches the attribute passed on the command line.
  • If matchAll is false, only one change set returned by the label expression needs to have a matching scriptChecksum attribute.

rollback

Roll back the target database to a specified revision, date or by number of steps.

USAGE

rollback <dbdef> lastlabel
rollback <dbdef> changeid:<changesetId>
rollback <dbdef> count:<num>
rollback <dbdef> date:<date>
rollback <dbdef> tag:<tag_name>
rollback <dbdef> lastDeploy

Info
titleNote

If you are using a current packaging methodology (Deployment Packager with SCM), use only the lastDeploy option. Other options support older methodologies. 

EXAMPLE

rollback <dbdef> lastDeploy --pipeline=FeatureA

OPTIONS

  • lastlabel - Remove all changes associated with the last label deployed. Certain preconditions must be met for this mode to succeed.
  • changeid:<changesetID> - Roll back to the <changesetId> change set in the change log.
  • count:<num> - Roll back the last <num> change sets.
  • date:<date> - Roll back all change sets applied after <date>.
  • tag:<tag_name> - Roll back to <tag_name>. The tag <tag_name> must have been specified for a previous changeset.
  • lastDeploy - Remove all changes associated with the last deploy operation. 
  • pipeline - Specifies the pipeline associated with the changelogSync for reporting purposes.
    • If not set and the dbDef is a member of only one pipeline, then that pipeline is used.
    • If not set and the dbDef is a member of multiple pipelines, then an error is returned.

OPTION VALUES

...

runRules

Runs rules from the SQLRules folder on the specified SQL file or folder of SQL files.

USAGE

runRules [<SQL-file> | <SQL-file-folder>]

NOTES

Deployment Packager runs the runRules command as part of packaging.  You can use it to check SQL files before checking them in for packaging. 

The command must be run from a project directory: datical/<project>.

...

schemaStats

Display summary schema info. Shows summary info about the database model represented by the changelog.

USAGE

schemaStats

set

Set properties for the project and database. 

The set command provides help for the subcommands.

USAGE

set <property> <values>

set help

PROPERTIES

  • alternateSchema - Set the alternate schema for the project.

USAGE: set alternateSchema <schema name>

  • autoGenSQL – control whether or not SQL scripts are automatically generated during Forecast, Deploy, and Rollback operations.

USAGE: set autoGenSQL true|false

  • dbprop - Set a database property in a project.

USAGE: set dbprop [dbdef] [propertyName] [propertyValue]

  • dbdef - the name of a database definition in the current project.
  • propertyName - a property name. The only property currently supported is enableStorageOptions. This property controls whether or not storage options are collected for a specific database definition during the snapshot command. Storage Option information includes storage configuration, tablespace/filegroup assignments, large object storage parameters and partitioning information for tables and indexes. This defaults to false.
  • propertyValue - a property value (must be valid for the type of the property).

EXAMPLE: set dbProp QDdb enableStorageOptions true

  • deployMode – controls how much work is done during Deploy operations. 

USAGE: set deployMode quick|full

  • full - performs rules validation and runs a forecast before deploying the changes, subject to limitForecast.
  • quick - deploys the changes (no rules valildation or forecast)
  • deployThreshold – controls what happens when a full deploy detects errors or warnings in rules or in forecast.

USAGE: set deployThreshold stopOnError|stopOnWarn|deployAlways>

  • stopOnError - Deployment is not performed when errors are present in Pre-Deployment validation
  • stopOnWarn - Deployment is not performed when errors and/or Warnings are present in Pre-Deployment validation
  • deployAlways - Deploy proceeds regardless of validation results. NOT RECOMMENDED
  • enableRowCount - set method for counting rows in tables. 
  • Changed in v5.7 from true | false with default of true. New default is disabled. Older projects are interpreted correctly and mapped to the new values. 

    USAGE: set enableRowCount exact | approximate | disabled

    • exact - Uses a table scan to count the number of rows in each table. 
    • approximate - Uses database statistics to approximate the number of rows. 
    • disable - Does not count table rows. 
  • enableSqlParser - set use of SQL Parser to allow forecasting of DIRECT and DATA_DML scripts

USAGE: set enableSqlParser true | false

  • true -  use SQL Parser to parse DIRECT and DATA_DML scripts into the Daticals object model for subsequent validation with rules and forecast.
  • false - disable SQL Parser.  
  • externalStoredLogic - Set whether stored logic definitions (stored procedures, etc.) are stored in external files or within the project changelog.

USAGE: set externalStoredLogic <true|false>

  • forecastDML - For Oracle only, controls whether Datical DB attempts to forecast DML (Data Manipulation Language). 

USAGE: set forecastDML true | false 

  • true - forecasts predict whether a DML change will be successful
  • false - forecasts warn that any DML change encountered will not be forecast
  • help <property> - show more help about a property. 
  • invalidsCheck – controls how to check the validity of stored logic after deployment

USAGE: set invalidsCheck disabled|limited|local|global

  • disabled - do not perform the check
  • limited - only check objects targeted by a deployment and their dependencies
  • local - check the target schema only
  • global - check all schema in the database
  • invalidsAction – controls how to check the validity of stored logic after deployment

    USAGE: set invalidsAction warn|fail

    • warn - print a warning message if invalidsCheck does not pass. 
    • fail - print an error message if invalidsCheck does not pass for new stored logic objects. Print a warning if the check does not pass for objects that already exist in the database.  If set to fail and a package operation encounters the error during deployment to REF, the package operations fails and the database is restored to its state before the packaging operation was started. 
  • limitForecast - controls how Datical DB behaves during forecast operations. Forecast operations run faster if set to true, but some rules are not checked. 

USAGE: set limitForecast true|false

  • true - limit object profiling to those directly affected by the forecast 
  • false - profile all objects in the target database
  • property - Sets the specified property to a given value. The only property currently supported is drivers. This points to the directory where you've stored your JDBC drivers.

USAGE: set property [propertyName] [propertyValue]

EXAMPLE: set property drivers /path/to/driver/dir

  • requireOptions – controls whether or not labels or contexts are required for Forecast and Deploy

USAGE: set requireOptions true|false

  • runtimeCredentials - controls whether database credentials are stored or prompted at run time. Default: false. If set to true, all stored credentials are removed and you are prompted for database credentials during forecasting and deployment. If set to false, database credentials are encoded and stored in the project.   We strongly recommend to use runtime credentials because it is more secure than stored credentials (due to the possibility of the stored password being decoded).

USAGE set runtimeCredentials true|false 

  • true - all stored credentials (if any) are removed. You are prompted for database credentials during forecasting and deployment.
  • false - (default) database credentials are stored in the project.
  • scriptExecutionTimeout - sets a limit on how long Datical DB will wait for a script to run.  We recommend setting a value for this for all of your REF dbDefs, but only your REF dbDefs.

USAGE: set scriptExecutionTimeout <dbdefName> <seconds> 

...

USAGE: set storageOptionsScope <arg>

...

SEE ALSO

show command

show

Display properties of the project and Datical DB.

USAGE

show <property>

PROPERTIES

  • autoGenSQL - show whether the project automatically generates SQL when deploying
  • bundles - lists the OSGI bundles in the runtime environment. Used by Datical support for diagnostics. 
  • databases - lists all the databases that are in the project.
  • dbprop - shows a database property in a project.

USAGE: show dbprop [dbdef] [propertyName]

  • dbdef - the name of a database definition in the current project.
  • propertyName - a property name. Currently only enableStorageOptions is supported.
  • deployMode - full or quick
  • deployThreshold - stopOnError, stopOnWarn, or deployAlways
  • enableRowCount - exact | approximate | disabled, method for counting rows in tables. Default is disabled. 
    • Before v5.7 used true | false, with default as true. New default is disabled. Older projects are interpreted correctly and mapped to the new values. 
  • externalStoredLogic - true or false. If true, store external functions (like stored procedures) in external files. Otherwise they are stored in the changelog. 
  • help <property> - show more help about a property. 
  • invalidsCheck - global|local|limited|disabled - how to check stored logic validity during deployment: local - target schema (default), global - all schema in the target databaselimited - available with 5.3 or higher, only objects targeted by a deployment and their dependenciesdisabled - no validation check
  • invalidsAction - warn|fail
  • languages - lists all scripting languages that are supported by the current Java runtime
  • license - shows status of the license: whether it is installed, issue date, expiration date
  • limitForecast - true or false, limit object profiling to only affected. All objects are profiled if set to true.  
  • project - name and description of the current project.
  • properties - shows all the properties that have been set.
  • property - shows the value of the given propertyname.

USAGE: show property <propertyName>

  • requireoptions - true or false, whether contexts and labels are required for Forecast and Deploy
  • runtimeCredentials - true or false, whether user is prompted at run time for database user credentials. Otherwise stored encoded credentials are used.  We strongly recommend to use runtime credentials because it is more secure than stored credentials (due to the possibility of a stored password being decoded).
  • scriptExecutionTimeout - number of seconds, 0 if unlimited.

USAGE: show scriptExecutionTimeout [dbdef] 

  • dbdef - name of a database definition in the current project
  • version - shows version information for the components of Datical DB

SEE ALSO

set command 

snapshot

Capture a snapshot of a database as either a persistent object file or a changelog

USAGE

snapshot <deploymentStep> [--format=dbobject|changelog][--output=][--ddExcludeList=<object-list>][--snapshotSchemaList=<schema-list]

EXAMPLE

snapshot DEVdb --output=/home/user/snapshots/

OPTIONS

  • format - Specifies the format of the output, dbobject (default) or changelog 
    • dbobject - object list that can be used by the diff and diffChangelog commands
    • changelog - XML file suitable for an initial project changelog
  • output=<path> - When present, the changelog generated is written to the directory specified by <path>. By default file is written to the Snapshots directory of the project.
  • ddExcludeList - comma-separated list of object types to exclude from the snapshot. Can be all, none, or a list containing any combination of procedure, function, package, packagebody, trigger, view
  • snapshotSchemaList - comma-separated list of schemas to include in the snapshot

NOTES

If the current project is set to externalize stored logic, the stored logic is written to a Resources subdirectory. See the set command for a subcommand to see the values for a subcommand. within the date stamped directory created by the snapshot process.

status

Show the deployment status of a database.

USAGE

status [dbdef]

EXAMPLE

status QAdb

hammer --daticalServer=dmc_server_url --daticalUsername=user_name status datical_project_name

DATICAL SERVICE OPTIONS

Use these options to access a project that is stored on Datical Service. 

  • --daticalServer=<cluster-name>  - The cluster name set for Datical Service. The cluster name is set during Datical Service installation. 
  • --daticalUsername=<user> - User name, must be configured in Datical Service. Use the DATICAL_PASSWORD environment variable to provide the password. 
  • status - keyword that identifies this as a status command
  • <projectRef>Project to use, specified <projectRef>,  a project name or project key. The project key is defined in Datical Service only. context - When set, only change sets marked with the contexts specified will be executed. To run all contexts, specify $all.
  • labels - When set, only change sets marked with the label expression will be executed. To run all labels, specify $all.
  • mergeLabels - Label merge strategy, one of override (default), merge (AND), append (OR). Specifies how to combine labels set on the command line with labels set on the step. 
  • deployMode - Override the deployMode project setting, either full (default), which includes forecasting and rules checking, or quick.
  • limitForecast - Override the limitForecast project setting. Set to either false (default), where forecasting is done for all objects in the target database, or true, which limits forecasting to objects directly affected by the deployment. 
  • invalidsAction - Override the storedLogicValidityAction project setting for this deploy.
    • warn: Set to either warn (default), current behavior. New invalid stored logic will cause the Deploy to flag as deployment warning.
    • fail: New invalid stored logic will cause a deployment to be marked as a failure.
      Option would be applied when Stored Logic Validity Check is not disabled.


...

diff

Compare two databases and produce a report. Compares two database definitions in a project and produces a text report of the differences.

USAGE

diff <referenceDB> <targetDb> [--output=/path/to/report]

EXAMPLE

diff myAppDevDB myAppQaDB --output=<path>

OPTIONS

  • referenceDB - database that represents the desired state
  • targetDB - database that is out of synchronization and needs to be caught up to the state of referenceDB.
  • output - If present, specifies a file for the report. If not specified, the report is sent to STDOUT


...

diffChangelog

Compares two database definitions in a project and produces the change sets necessary to synchronize the databases.

USAGE

diffChangelog <referenceDB> <targetDb> [--output=<path>] [--assignLabels=<labels>] [--assignContexts=<contexts>] [–-scriptChecksum=<checksum>]

EXAMPLE

myAppDevDB myAppQaDB --output=/home/user/diffChangeLogsdir/diffChangeLog.xml --assignLabels=label1,label2 --assignContexts="(contextOne and contextTwo)" 

OPTIONS

  • referenceDB - database that represents the desired state, either a dbdef in the project or a snapshot file. 
  • targetDB - database that is out of synchronization and needs to be caught up to the state of referenceDB, either a dbdef in the project or a snapshot file
  • output - if present, specifies the file for the generated changelog. Use file extension .xml. If not specified, output is written to  the Reports/DiffChangeLogs subdirectory under the project directory. If the file exists, the results of the command (changesets) are appended to the existing file. 
  • assignLabels - apply this set of labels applied to all changesets created. Accepts a comma separated list of labels.
  • assignContexts - apply this set of contexts to to all changesets created. Accepts a complex context expression.
  • scriptChecksum - SQL script checksum value

...

forecast

Simulate unexecuted change sets and run rules against the specified database.

USAGE

forecast <dbdef> [--log=/path/to/log]  [--enableRowCount=exact|approximate|disabled] [--report=/path/to/report] [--context=context1,context2] [--labels=<label expression>][--mergeLabels=override|merge|append][--limitForecast=true|false][--immutableProject=<true|false]

EXAMPLE

forecast myAppDevDb --log=/home/user/logs/ --report=/home/user/reports --context=dev,qa --labels="JUN AND (poolApp or beachApp)" --limitForecast=true

OPTIONS

  • <dbdef> - project dbdef name of the database to use for forecasting
  • log - Location to write the daticaldb.log file. Log is written to Logs directory of project by default.
  • enableRowCount - exact | approximate | disabled, method for counting rows in tables. Default is disabled. 
    • Before v5.7 used true | false, with default as true. New default is disabled. Older projects are interpreted correctly and mapped to the new values. 
  • report - Location to write the forecast report. Report is written to the Reports directory by default.
  • context - Only change sets marked with the contexts specified are executed. To run all contexts, specify $all.
  • labels - When set, only change sets marked with the label expression are executed. To run all labels, specify $all.
  • mergeLabels - Label merge strategy, one of override (default), merge (AND), append (OR). Specifies how to combine labels set on the command line with labels set on the step. 
  • limitForecast - Override the limitForecast project setting. Set to either false (default), where forecasting is done for all objects in the target database, or true, which limits forecasting to objects directly affected by the potential deployment. 


...

groovy

Run a Groovy script. Runs a script of Liquibase Enterprise commands using the Groovy script engine.  

USAGE

groovy <script-name> <script-options>

EXAMPLE

groovy myScript.groovy show(project, ["dbprop", "myProject", "enableStorageOptions"])

OPTIONS

  • <script-name> - path to a script name
  • <script-options> - Options to pass to the script

NOTES

To access Liquibase Enterprise commands through the script, access them through the DaticalDb object. The parameters for a command are (project, List<String> <[parameters]>). Use the word "project" as shown below.

Exceptions: add-to-property is accessed by addToProperty and deploy-autoRollback is accessed by deploy-AutoRollback.

Examples:

help(project, [])

help(project, ["groovy"])

show(project, ["dbprop", "myProject", "enableStorageOptions"])


...

help

Show help on hammer commands.

USAGE

help

help <command>|options

set help

show help

EXAMPLE

help diff

OPTIONS

  • <command> - Name of the command you'd like to learn about.
  • options - list of options used by the commands

NOTES

When run without a command option, lists all available commands and a brief description of each.

SEE ALSO

The set and show commands. 


...

history

Show the applied changeset history of a database. Shows all changesets that have been applied to the specified DbDef.

USAGE

history <dbdef>

EXAMPLE

history QAdb

OPTIONS

  • <dbdef> - project dbdef name of the database to use.


...

insertSavedAuditData (deprecated)

Insert all audit entries temporarily saved in the project into the user-configured DMC DB.

USAGE

insertSavedAuditData --project=<path>
insertSavedAuditData

OPTIONS

  •   project - Path to the project directory to use for inserting saved DMC DB data.

NOTES

If run without an option, the command runs in the current directory. The command fails if the directory is not a valid project directory.

Sometimes an operation (like deploy) encounters a condition that prevents information from being written to the DMC database. In that case, the information is saved to a temporary on-disk database. Use this command to move the on-disk data to the configured DMC database once connectivity to the DMC database has been restored.


...

installDrivers

Run the custom script installDrivers.groovy. Installs OSGi packaged JDBC drivers from the specified update site

USAGE

hammer installDrivers <driver_update_site>

EXAMPLE

hammer installDrivers http://update.datical.com/drivers/updates/

NOTES

Update sites can be either HTTP URLs (as shown above) or directories on a file system.

Examples of <driver_update_site>:

  • Composite Archive (Windows and Linux):
       jar:file:/C:/Users/Pete/DaticalDBCompositeRepo-4.26.4467.zip
       jar:file:/home/Users/Pete/DaticalDBCompositeRepo-4.26.4467.zip
  • Extracted Archive (Windows and Linux):
       file:/C:/Users/Pete/DaticalDBCompositeRepo-4.26.4467/
       file:/home/Pete/DaticalDBCompositeRepo-4.26.4467/


...

installLicense

Install a license file to allow continued use of Liquibase Enterprise. Once a license is installed on a machine once, it does not typically need to be installed again.

USAGE

installLicense <path>

EXAMPLE

installLicense /home/liquibase/datdb.lic

OPTIONS

  • <path> - Specifies where to find the file that contains the Liquibase Enterprise product license.

NOTES

If you need to obtain or renew a license please email support@datical.com.


...

licenseCounter

Count the DbDefs in use for licensing validation.

USAGE

hammer licenseCounter <projects_dir> [ showDebug=true ]

EXAMPLE

Linux: hammer licenseCounter ~/liquibase
Windows: hammer.bat licenseCounter C:\Liquibase\Projects



OPTIONS

  • <projects_dir> - Specifies the top directory to begin scanning project files.  It can be a relative or absolute path. All project files in the file hierarchy under this directory are scanned. 
  • showDebug=true - Show additional detailed information as the command runs.  

NOTES

Output is sent to stdout. Redirect to a file to save it. 


...

modifyChangeSet

Modify changeset attributes


USAGE

modifyChangeSet --action=<action> --<modify-option>[=<value>, ...]... [--<search-option>=<value>, ...]...

EXAMPLE

hammer modifyChangeSet --action=ADD --modifyLabels=history --searchIgnore=true

hammer modifyChangeSet --action=REMOVE --modifyContext=QA4 --searchContexts=QA4

hammer modifyChangeSet --action=ADDALL --modifyContexts=DEV,PATCH01

hammer modifyChangeSet --action=REMOVEALL --modifyContexts=PATCH01

hammer modifyChangeSet --action=ADD --modifyIgnore --searchLabels=MyScriptName123.sql

hammer modifyChangeSet --action=ADD --modifyContexts=DEV,NEWCONTEXT --modifyLabels=MyTestSsisPackage --searchOrigFilePaths=ssis/MyTestSsisPackage

OPTIONS

Action

  • action - Specifies the action to perform, one of ADD, REMOVE, ADDALL, REMOVEALL
    • All actions require at least one modify option. 
    • If you specify ADD or REMOVE, you must also specify a search option. 
    • If you specify ADDALL or REMOVEALL, do not specify a search option. If you do, the command fails with an error. 

Modify Option

At least one modify option is required. It specifies what change to make. It can be one of the following:

  • modifyContexts - One or a comma-separated list of values for the context attribute.  
  • modifyIgnore - Change the value of the ignore attribute. It does not take a value. The ADD action sets ignore=true. The REMOVE action sets ignore=false.
  • modifyLabels - One or a comma-separated list of values for the label attribute.  

When a value is added to an attribute, it is added at the end of the existing list and the order of the list is preserved. If the value already exists, it is not added again. 

When a value is removed from an attribute, the order of the remaining values is preserved. 

When you specify more than one modify option, all modifications of the same type (context, ID, label) are put together and applied at one time. 

Search Option

The search options determine which changesets to modify. They select a list of changesets for the modify options to work on. 

Searches are not case-sensitive. 

  • Multiple values in one statement are OR'ed together. 
  • Multiple search option statements are ANDed together.

Search option statements take one or a comma-separated list of values. They are provided for changeset attributes as follows: 

  • searchIds - id
  • searchLabels - label
  • searchContexts - context
  • searchIgnore - ignore - true | false - Searches for false also return changesets where the ignore attribute is not set. true | false
  • searchOrigFilePaths - origFilePath
  • searchOrigFileNames - origFileName
  • searchVersion - version, an integer. 


OUTPUT

The command reports the number of changesets that met the search criteria. If no changesets meet the criteria, the command succeeds and reports that no changesets met the search criteria. 

ERRORS

The command fails and reports an error when:

  • No action is specified or an invalid value is specified.
  • An action is valid but no modify options are specified.
  • ADDALL or REMOVEALL is specified as an action and a search option is specified. 
  • ADD or REMOVE is specified as an action and a search option is not specified. 
  • An invalid value is specified for searchIgnore. It must be true or false.  


NOTES

The modifyChangeSet command is intended to make it easier to work with labels and contexts.

  • Searching - Make it easier to find a changeset: Search by criteria other than a label name, particularly criteria that can be unique (origFilePath, origFileName, ID).
  • Labels - Manage labels for a release, especially for later steps in a pipeline.
  • Contexts - Use context settings as a gating mechanism for deploying to a specified environment (context)

Context expressions and label expressions are not currently supported. Use comma-separated lists for multiple values. 

Starting with version 4.32, Use this command rather than the following commnds, which are deprecated and may be removed in a future release:

  • addLabels
  • removeLabels
  • addContexts
  • removeContexts




newDbDef

Creates a new dbDef based on the key/value pairs specified as arguments.

  • Oracle
    • Inline Credentials:  OracleDbDef
    • Run-Time Supplied Credentials:  DelayedCredentialOracleDbDef
  • SQL Server
    • Inline Credentials:  SqlServerDbDef
    • Run-Time Supplied Credentials:  DelayedCredentialSqlServerDbDef
  • Postgres Enterprise DB
    • Inline Credentials:  PostgresqlDbDef
    • Run-Time Supplied Credentials:  DelayedCredentialPostgresDbDef
  • DB2
    • Inline Credentials:  Db2DbDef
    • Run-Time Supplied Credentials:  DelayedCredentialDb2DbDef
  • (deprecated) MySQL Inline Credentials:  MysqlDbDef


USAGE

newDbDef DbDefClass <value> name <value> hostname <value> port <value> username <value> password <value> database <value> ... <key> <value>

AVAILABLE KEYS

  • DbDefClass - Database Type. (OracleDbDef|Db2DbDef|MysqlDbDef|SqlServerDbDef|PostgresqlDbDef|DelayedCredentialOracleDbDef|DelayedCredentialSqlServerDbDef|DelayedCredentialPostgresDbDef|DelayedCredentialDb2DbDef)

  • name - The name for the dbDef. Used in the CLI and GUI as an alias for this connection.

  • hostname - The hostname/ip of the target database server.

  • port - The port number for JDBC connections to the target database server.

  • username - The database user name to use for the connection.

  • password - The password for the database user.

  • database - (MySQL|DB2|PostGRE) The name of the database to manage. Not applicable to Oracle databases.

  • databaseName - (SQLServer) The name of the database to manage.

  • instanceName - (SQLServer) The name of the instance to manage.

  • applicationName - (SQLServer) The name of the database application to manage.

  • sid - (Oracle) The name of the Oracle SID to manage.

  • serviceName - (Oracle) The name of the Oracle Service to manage.

  • tnsName - (Oracle) The TNS name for the Oracle host and service to manage. Requires the tnsnames.ora configuration file on the client.
  • defaultSchemaName - The name of the schema to manage.

  • defaultCatalogName - The name of the catalog to manage. 
  • contexts - A comma separated list of contexts.

  • labels - A comma separated list of labels. 
  • dbDefType - One of "standard" (default, for a managed database) or "dmcdb" for the Deployment Monitoring Console Database.
  • storageOptionCollectedAtSnapshot - (true/false) Collect storage options for database objects (table, index, etc.)



newProject

Creates a new empty project in the current directory.

USAGE

newProject [projectName]

EXAMPLE

newProject myProject

OPTIONS

  • projectName - Specifies the project name. If not specified, the name newProject is used.

NOTES

Create the project directory before creating the project. This command does NOT create a new directory for the project. 


...

releaseLocks

Reset the lock created in an environment to prevent concurrent liquibase operations.

USAGE

        hammer releaseLocks <dbDef>

EXAMPLE

        hammer releaseLocks PROD_DB 

NOTES

        Typically this lock is cleared at the end of a deployment but a deployment that ends prematurely may leave this lock in place. Subsequent deployments to such an environment will fail until the lock is released.


...

removeContexts

Remove contexts from changesets. 

Info
titleNote
Starting with v4.32, please use the modifyChangeSet command. The removeContexts command is deprecated and support may be removed in the future. 

USAGE

removeContexts --lookupChangeset=<label-expression> --context=<contexts> [--scriptChecksum=][--matchAll=true|false]

OPTIONS

  • lookupChangesets - Label expression used to matchthe change sets (required)
  • context - Comma-separated list of contexts (required)
  • scriptChucksum - SQL script checksum value
  • matchAll - SQL Script checksums must match for change set lookup. Default value is true. 

NOTES

The value of the scriptChecksum parameter can be used to further qualify change sets that match the label expression. This is used primarily in the Deployment Packager to confirm that the change set was generated by the expected version of a script.

The value of the matchAll parameter impacts the matching behavior of the scriptChecksum parameter.

  • If matchAll is true, all change sets identified by the label expression must have a scriptChecksum attribute that matches the attribute passed on the command line.
  • If matchAll is false, only one change set returned by the label expression needs to have a matching scriptChecksum attribute.


...

removeLabels

Remove labels from changesets. 

Info
titleNote
Starting with v4.32, please use the modifyChangeSet command. The removeLabels command is deprecated and support may be removed in the future. 

USAGE

removeLabels --lookupChangeset=<label-expression> --context=<contexts> [--scriptChecksum=][--matchAll=true|false]

OPTIONS

  • lookupChangesets - Label expression used to matchthe change sets (required)
  • context - Comma-separated list of contexts (required)
  • scriptChucksum - SQL script checksum value
  • matchAll - SQL Script checksums must match for change set lookup. Default value is true. 

NOTES

The value of the scriptChecksum parameter can be used to further qualify change sets that match the label expression. This is used primarily in the Deployment Packager to confirm that the change set was generated by the expected version of a script.

The value of the matchAll parameter impacts the matching behavior of the scriptChecksum parameter.

  • If matchAll is true, all change sets identified by the label expression must have a scriptChecksum attribute that matches the attribute passed on the command line.
  • If matchAll is false, only one change set returned by the label expression needs to have a matching scriptChecksum attribute.


...

rollback

Roll back the target database to a specified revision, date or by number of steps.

USAGE

rollback <dbdef> lastlabel
rollback <dbdef> changeid:<changesetId>
rollback <dbdef> count:<num>
rollback <dbdef> date:<date>
rollback <dbdef> tag:<tag_name>
rollback <dbdef> lastDeploy


Info
titleNote

If you are using a current packaging methodology (Deployment Packager with SCM), use only the lastDeploy option. Other options support older methodologies. 


EXAMPLE

rollback <dbdef> lastDeploy --pipeline=FeatureA


OPTIONS

  • lastlabel - Remove all changes associated with the last label deployed. Certain preconditions must be met for this mode to succeed.
  • changeid:<changesetID> - Roll back to the <changesetId> change set in the change log.
  • count:<num> - Roll back the last <num> change sets.
  • date:<date> - Roll back all change sets applied after <date>.
  • tag:<tag_name> - Roll back to <tag_name>. The tag <tag_name> must have been specified for a previous changeset.
  • lastDeploy - Remove all changes associated with the last deploy operation. 
  • pipeline - Specifies the pipeline associated with the changelogSync for reporting purposes.
    • If not set and the dbDef is a member of only one pipeline, then that pipeline is used.
    • If not set and the dbDef is a member of multiple pipelines, then an error is returned.

OPTION VALUES

  • <dbdef> - Name of a DbDef in the current project.
  • <changesetId> - The author and id of a change set. Format: "id=createTable1,author=Liquibase User"
  • <num> - Number of change sets to revert.
  • <date> - Date boundary used to determine which change sets will be reverted. Format: yyyy-MM-dd
  • <tag_name> - Liquibase tag name to which you wish to rollback. Requires that you tag the database in a previous change set.

...

runRules

Runs rules from the SQLRules folder on the specified SQL file or folder of SQL files.

USAGE

runRules [<SQL-file> | <SQL-file-folder>]

NOTES

Deployment Packager runs the runRules command as part of packaging.  You can use it to check SQL files before checking them in for packaging. 

The command must be run from a project directory: datical/<project>.

In the workspace (datical), the SQLRules directory is under the Rules directory in a project: datical/<project-name>/Rules/SQLRules.

...

schemaStats

Display summary schema info. Shows summary info about the database model represented by the changelog.

USAGE

schemaStats


...

set

Set properties for the project and database. 

The set command provides help for the subcommands.

USAGE

set <property> <values>

set help

PROPERTIES

  • alternateSchema - Set the alternate schema for the project.

USAGE: set alternateSchema <schema name>

  • autoGenSQL – control whether or not SQL scripts are automatically generated during Forecast, Deploy, and Rollback operations.

USAGE: set autoGenSQL true|false

  • dbprop - Set a database property in a project.

USAGE: set dbprop [dbdef] [propertyName] [propertyValue]

  • dbdef - the name of a database definition in the current project.
  • propertyName - a property name. The only property currently supported is enableStorageOptions. This property controls whether or not storage options are collected for a specific database definition during the snapshot command. Storage Option information includes storage configuration, tablespace/filegroup assignments, large object storage parameters and partitioning information for tables and indexes. This defaults to false.
  • propertyValue - a property value (must be valid for the type of the property).

EXAMPLE: set dbProp QDdb enableStorageOptions true

  • deployMode – controls how much work is done during Deploy operations. 

USAGE: set deployMode quick|full

  • full - performs rules validation and runs a forecast before deploying the changes, subject to limitForecast.
  • quick - deploys the changes (no rules valildation or forecast)
  • deployThreshold – controls what happens when a full deploy detects errors or warnings in rules or in forecast.

USAGE: set deployThreshold stopOnError|stopOnWarn|deployAlways>

  • stopOnError - Deployment is not performed when errors are present in Pre-Deployment validation
  • stopOnWarn - Deployment is not performed when errors and/or Warnings are present in Pre-Deployment validation
  • deployAlways - Deploy proceeds regardless of validation results. NOT RECOMMENDED
  • enableRowCount - set method for counting rows in tables. 
  • Changed in v5.7 from true | false with default of true. New default is disabled. Older projects are interpreted correctly and mapped to the new values. 

    USAGE: set enableRowCount exact | approximate | disabled

    • exact - Uses a table scan to count the number of rows in each table. 
    • approximate - Uses database statistics to approximate the number of rows. 
    • disable - Does not count table rows. 
  • enableSqlParser - set use of SQL Parser to allow forecasting of DIRECT and DATA_DML scripts

USAGE: set enableSqlParser true | false

  • true -  use SQL Parser to parse DIRECT and DATA_DML scripts into the object model for subsequent validation with rules and forecast.
  • false - disable SQL Parser.  
  • externalStoredLogic - Set whether stored logic definitions (stored procedures, etc.) are stored in external files or within the project changelog.

USAGE: set externalStoredLogic <true|false>

  • forecastDML - For Oracle only, controls whether Liquibase Enterprise attempts to forecast DML (Data Manipulation Language). 

USAGE: set forecastDML true | false 

  • true - forecasts predict whether a DML change will be successful
  • false - forecasts warn that any DML change encountered will not be forecast
  • help <property> - show more help about a property. 
  • invalidsCheck – controls how to check the validity of stored logic after deployment

USAGE: set invalidsCheck disabled|limited|local|global

  • disabled - do not perform the check
  • limited - only check objects targeted by a deployment and their dependencies
  • local - check the target schema only
  • global - check all schema in the database
  • invalidsAction – controls how to check the validity of stored logic after deployment

    USAGE: set invalidsAction warn|fail

    • warn - print a warning message if invalidsCheck does not pass. 
    • fail - print an error message if invalidsCheck does not pass for new stored logic objects. Print a warning if the check does not pass for objects that already exist in the database.  If set to fail and a package operation encounters the error during deployment to REF, the package operations fails and the database is restored to its state before the packaging operation was started. 
  • limitForecast - controls how Datical DB behaves during forecast operations. Forecast operations run faster if set to true, but some rules are not checked. 

USAGE: set limitForecast true|false

  • true - limit object profiling to those directly affected by the forecast 
  • false - profile all objects in the target database
  • property - Sets the specified property to a given value. The only property currently supported is drivers. This points to the directory where you've stored your JDBC drivers.

USAGE: set property [propertyName] [propertyValue]

EXAMPLE: set property drivers /path/to/driver/dir

  • requireOptions – controls whether or not labels or contexts are required for Forecast and Deploy

USAGE: set requireOptions true|false

  • runtimeCredentials - controls whether database credentials are stored or prompted at run time. Default: false. If set to true, all stored credentials are removed and you are prompted for database credentials during forecasting and deployment. If set to false, database credentials are encoded and stored in the project.   We strongly recommend to use runtime credentials because it is more secure than stored credentials (due to the possibility of the stored password being decoded).

USAGE set runtimeCredentials true|false 

  • true - all stored credentials (if any) are removed. You are prompted for database credentials during forecasting and deployment.
  • false - (default) database credentials are stored in the project.
  • scriptExecutionTimeout - sets a limit on how long Datical DB will wait for a script to run.  We recommend setting a value for this for all of your REF dbDefs, but only your REF dbDefs.

USAGE: set scriptExecutionTimeout <dbdefName> <seconds> 

  • dbdefName - name of the dbdef where the limit is applied
  • seconds - number of seconds. If set to 0, there is no timeout limit. The default value is 0. 

  • storageOptionsScope - Specifies what storage information to use in snapshot and diff operations for all steps/dbdefs in the project. For <arg>, specify one of all, lob, tablespace, tablespaceAndLob.  The default is all. This setting works only for steps/dbdefs that have enableStorageSettings set to true

USAGE: set storageOptionsScope <arg>

    • <arg> - one of  all, lob, tablespace, or tablespaceAndLob

SEE ALSO

show command


...

show

Display properties of the project and Liquibase Enterprise.

USAGE

show <property>

PROPERTIES

  • autoGenSQL - show whether the project automatically generates SQL when deploying
  • bundles - lists the OSGI bundles in the runtime environment. Used by Liquibase support for diagnostics. 
  • databases - lists all the databases that are in the project.
  • dbprop - shows a database property in a project.

USAGE: show dbprop [dbdef] [propertyName]

  • dbdef - the name of a database definition in the current project.
  • propertyName - a property name. Currently only enableStorageOptions is supported.
  • deployMode - full or quick
  • deployThreshold - stopOnError, stopOnWarn, or deployAlways
  • enableRowCount - exact | approximate | disabled, method for counting rows in tables. Default is disabled. 
    • Before v5.7 used true | false, with default as true. New default is disabled. Older projects are interpreted correctly and mapped to the new values. 
  • externalStoredLogic - true or false. If true, store external functions (like stored procedures) in external files. Otherwise they are stored in the changelog. 
  • help <property> - show more help about a property. 
  • invalidsCheck - global|local|limited|disabled - how to check stored logic validity during deployment: local - target schema (default), global - all schema in the target databaselimited - available with 5.3 or higher, only objects targeted by a deployment and their dependenciesdisabled - no validation check
  • invalidsAction - warn|fail
  • languages - lists all scripting languages that are supported by the current Java runtime
  • license - shows status of the license: whether it is installed, issue date, expiration date
  • limitForecast - true or false, limit object profiling to only affected. All objects are profiled if set to true.  
  • project - name and description of the current project.
  • properties - shows all the properties that have been set.
  • property - shows the value of the given propertyname.

USAGE: show property <propertyName>

  • requireoptions - true or false, whether contexts and labels are required for Forecast and Deploy
  • runtimeCredentials - true or false, whether user is prompted at run time for database user credentials. Otherwise stored encoded credentials are used.  We strongly recommend to use runtime credentials because it is more secure than stored credentials (due to the possibility of a stored password being decoded).
  • scriptExecutionTimeout - number of seconds, 0 if unlimited.

USAGE: show scriptExecutionTimeout [dbdef] 

  • dbdef - name of a database definition in the current project
  • version - shows version information for the components of Liquibase Enterprise

SEE ALSO

set command 


...

snapshot

Capture a snapshot of a database as either a persistent object file or a changelog

USAGE

snapshot <deploymentStep> [--format=dbobject|changelog][--output=][--ddExcludeList=<object-list>][--snapshotSchemaList=<schema-list]

EXAMPLE

snapshot DEVdb --output=/home/user/snapshots/

OPTIONS

  • format - Specifies the format of the output, dbobject (default) or changelog 
    • dbobject - object list that can be used by the diff and diffChangelog commands
    • changelog - XML file suitable for an initial project changelog
  • output=<path> - When present, the changelog generated is written to the directory specified by <path>. By default file is written to the Snapshots directory of the project.
  • ddExcludeList - comma-separated list of object types to exclude from the snapshot. Can be all, none, or a list containing any combination of procedure, function, package, packagebody, trigger, view
  • snapshotSchemaList - comma-separated list of schemas to include in the snapshot

NOTES

If the current project is set to externalize stored logic, the stored logic is written to a Resources subdirectory. See the set command for a subcommand to see the values for a subcommand. within the date stamped directory created by the snapshot process.


...

status

Show the deployment status of a database.

USAGE

status [dbdef]

EXAMPLE

status QAdb

hammer status liquibase_project_name

OPTIONS

  • dbdef - Name of a database definition in the project. 

...

uninstallLicense

Removes any installed DaticalDB Liquibase Enterprise licenses. 

USAGE

uninstallLicense

...