liquibase-tablespace-name parameter

The liquibase-tablespace-name global parameter is a string that sets which tablespace Liquibase uses to store objects that are being deployed to your database.

liquibase-tablespace-name only affects objects managed by Liquibase, the DATABASECHANGELOG and DATABASECHANGELOGLOCK tracking tables.

Uses

Each type of database allocates its own default tablespaces in memory, such as SYSTEM and SYSAUX in Oracle. You can set liquibase-tablespace-name to one of these values. Alternatively, you can create an additional tablespace and set it as the value of liquibase-tablespace-name.

Setting the liquibase-tablespace-name parameter

You can set liquibase-tablespace-name in four ways:

  • As a JVM system property
  • In your liquibase.properties file
  • As a global parameter in the CLI
  • As an environment variable (Liquibase Pro)

Java system property

You can set liquibase-tablespace-name as a Java system property by using the JAVA_OPTS Environment Variable in your command line. The syntax on Mac/Linux is as follows:

JAVA_OPTS=-Dliquibase.liquibaseTablespaceName=YOUR_STRING && liquibase update --changelog-file=dbchangelog.xml

The syntax on Windows requires the set command:

set JAVA_OPTS=-Dliquibase.liquibaseTablespaceName=YOUR_STRING && liquibase update --changelog-file=dbchangelog.xml

a liquibase.properties parameter

In Liquibase 4.1+, you can set liquibase-tablespace-name by adding the following to your liquibase.properties file:

liquibase.liquibaseTablespaceName: YOUR_STRING

CLI global parameter

You can use liquibase-tablespace-name as a global parameter in your command line with a single Liquibase command, such as update:

liquibase --liquibase-tablespace-name=YOUR_STRING update --changelog-file=dbchangelog.xml

Environment variable (Liquibase Pro)

If you use Liquibase Pro, you can set liquibase-tablespace-name as an environment variable. The syntax on Mac/Linux is as follows:

LIQUIBASE_LIQUIBASE_TABLESPACE_NAME=YOUR_STRING

The syntax on Windows requires the set command:

set LIQUIBASE_LIQUIBASE_TABLESPACE_NAME=YOUR_STRING

Note: The commands shown above only apply to the current shell. If you need to pass an environment variable to a child process without affecting the parent process, you can use the export command on Mac/Linux or the setx command on Windows.

Related links