Versions Compared

Key

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

Table of Contents

Database Credentials

...

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

  • log - When set, the daticaldb.log 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. 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 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.

...

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


...

groovy

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

...

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

NOTES

To access Datical DB 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.

...

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


...

help

Show help on Datical DB hammer commands.

USAGE

help

help <command>|options

...

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

...

EXAMPLE

installLicense /home/daticalliquibase/datdb.lic

OPTIONS

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

NOTES

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

...

Linux: hammer licenseCounter ~/daticalliquibase
Windows: hammer.bat licenseCounter C:\DaticalLiquibase\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.  

...


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


...

releaseLocks

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

USAGE

        hammer releaseLocks <dbDef>

...

  • <dbdef> - Name of a DbDef in the current project.
  • <changesetId> - The author and id of a change set. Format: "id=createTable1,author=Datical 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> - Datical Liquibase tag name to which you wish to rollback. Requires that you tag the database in a previous change set.

...

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.

...

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

...

  • 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 

...

Display properties of the project and Datical DBLiquibase 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 Datical Liquibase support for diagnostics. 
  • databases - lists all the databases that are in the project.
  • dbprop - shows a database property in a project.

...

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

...

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

SEE ALSO

set command 


...

snapshot

...

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. 

...

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

...