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
dropColumnchangesData 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
markUnusedchanges instead ofdropColumnchangesPhysical 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) |
|
Global flow file argument |
|
Global CLI parameter |
|
JVM system property(JAVA_OPTS environment variable) | Unix/Linux/Mac:
Windows:
|
Liquibase environment variable |
|
For more information, see Working with command parameters.
Change history
Version | Changes |
Liquibase Secure, version 5.0 | Parameter changed from Here are the previous values from when it was Liquibase properties file (defaults file) Global flow file argument
Global CLI parameter
JVM system property(JAVA_OPTS environment variable) Unix:
Windows:
Environment variable
|