mark-unused-not-drop

Last updated: October 24, 2025

--mark-unused-not-drop is a Boolean parameter that controls how Liquibase handles columns that would be dropped when generating changelogs from database comparisons. The default value is false. This parameter is available in Liquibase Secure and requires a valid license.

Uses

When you run diff-changelog to compare databases, Liquibase identifies columns that exist in the target database but not in the reference database. By default, Liquibase generates dropColumn changes to remove these columns. However, dropping columns can be risky in production environments because it permanently deletes data.

Oracle databases provide an alternative: the MARK UNUSED command. Instead of immediately dropping a column and its data, marking a column as unused:

  • Logically removes the column from the table structure

  • Makes the column inaccessible to queries

  • Preserves the underlying data temporarily

  • Allows for later physical removal during maintenance windows

When --mark-unused-not-drop=false (default):

  • Columns are dropped using dropColumn changes

  • Data is immediately and permanently deleted

  • Standard behavior for all databases

When --mark-unused-not-drop=true:

  • Columns are marked as unused instead of dropped (Oracle only)

  • Data is preserved but inaccessible

  • Generates markUnused changes instead of dropColumn changes

  • Physical column removal can be deferred to a maintenance window

You may want to set --mark-unused-not-drop to true in the following scenarios:

  • Production safety: You want to avoid immediate data loss in production environments where columns might be dropped accidentally

  • Reversible changes: You need the ability to "undo" column removals without data recovery procedures

  • Deferred maintenance: You want to defer the physical removal of columns to scheduled maintenance windows when table locks are acceptable

  • Risk mitigation: You're generating changelogs automatically and want a safety mechanism against unintended column drops

  • Compliance requirements: Your organization requires data preservation periods before permanent deletion

Keep the default value of false when:

  • Non-Oracle databases: You're working with databases other than Oracle (this feature is Oracle-specific)

  • Standard operations: You want standard column drop behavior

  • Immediate removal: You need columns and their data removed immediately

  • Non-production: You're working in development or test environments where data loss is acceptable

Note: This parameter only affects Oracle databases. For other databases, columns will be dropped normally regardless of this setting. The physical removal of unused columns in Oracle can be performed later using ALTER TABLE ... DROP UNUSED COLUMNS.

Syntax

You can set this parameter in the following ways:

Option

Syntax

Liquibase properties file (defaults file)

liquibase.markUnusedNotDrop: <true|false>

Global flow file argument

globalArgs: {mark-unused-not-drop: "<true|false>"}

Global CLI parameter

liquibase

--mark-unused-not-drop=<true|false>

diff-changelog

--changelog-file=mychangelog.xml

--url=<url>

--reference-url=<reference-url>

JVM system property(JAVA_OPTS environment variable)

Unix/Linux/Mac:

JAVA_OPTS=-Dliquibase.markUnusedNotDrop=<true|false>

Windows:

JAVA_OPTS=-D"liquibase.markUnusedNotDrop"=<true|false>

Liquibase environment variable

LIQUIBASE_MARK_UNUSED_NOT_DROP=<true|false>

For more information, see Working with command parameters.

Change history

Version

Changes

Liquibase Secure, version 5.0

Parameter changed from --pro-mark-unused-not-drop parameter to --mark-unused-not-drop.

Here are the previous values from when it was --pro-mark-unused-not-drop.

Liquibase properties file (defaults file) liquibase.pro.markUnusedNotDrop: <true|false>

Global flow file argument

globalArgs: {pro-mark-unused-not-drop:<true|false>}

Global CLI parameter

liquibase

--pro-mark-unused-not-drop=<true|false> update

--changelog-file=example-changelog.xml

JVM system property(JAVA_OPTS environment variable)

Unix:

JAVA_OPTS=-Dliquibase.pro.markUnusedNotDrop=<true|false>

Windows:

JAVA_OPTS=-D"liquibase.pro.markUnusedNotDrop"=<true|false>

Environment variable

LIQUIBASE_PRO_MARK_UNUSED_NOT_DROP