alterDatabaseProperties

Alters properties on an existing database in Snowflake. Supports setting and unsetting configuration options including data retention, collation, logging levels, and storage policies.

Note: This change type does not support automatic rollback or database inspection features (snapshot, diff, diff-changelog, and generate-changelog commands).

Available attributes

Attribute

Type

Description

Required

databaseName

String

Name of the database to alter

Yes

ifExists

Boolean

Only alter if the database exists using IF EXISTS

No

SET properties

Attribute

Type

Description

dataRetentionTimeInDays

Integer

Days to retain data for Time Travel (0-90)

maxDataExtensionTimeInDays

Integer

Maximum days Time Travel retention can be extended

comment

String

Comment describing the database

defaultDdlCollation

String

Default collation for objects (e.g., en_US)

defaultNotebookComputePoolCpu

String

Default compute pool for CPU notebooks

defaultNotebookComputePoolGpu

String

Default compute pool for GPU notebooks

logLevel

String

Logging level: OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE

metricLevel

String

Metric collection level: NONE, ALL

traceLevel

String

Trace level: OFF, ON_EVENT, ALWAYS

catalogSync

String

Catalog synchronization settings

baseLocationPrefix

String

Base location prefix for database

classificationProfile

String

Classification profile for the database

externalVolume

String

External volume for the database

catalog

String

Catalog identifier for the database

eventTable

String

Event table for the database

defaultStreamlitNotebookWarehouse

String

Default warehouse for Streamlit notebooks

replaceInvalidCharacters

Boolean

Replace invalid UTF-8 characters

enableDataCompaction

Boolean

Enable automatic data compaction

replicableWithFailoverGroups

Boolean

true sets to YES, false sets to NO

storageSerializationPolicy

String

Storage format policy: COMPATIBLE or OPTIMIZED

objectVisibility

String

Object visibility setting: PRIVILEGED or identifier

UNSET properties

Attribute

Type

Description

unsetDataRetentionTimeInDays

Boolean

Unset data retention time

unsetMaxDataExtensionTimeInDays

Boolean

Unset max data extension time

unsetComment

Boolean

Unset comment

unsetDefaultDdlCollation

Boolean

Unset default DDL collation

unsetExternalVolume

Boolean

Unset external volume

unsetCatalog

Boolean

Unset catalog

unsetEventTable

Boolean

Unset event table

unsetReplaceInvalidCharacters

Boolean

Unset replace invalid characters

unsetLogLevel

Boolean

Unset log level

unsetMetricLevel

Boolean

Unset metric level

unsetTraceLevel

Boolean

Unset trace level

unsetStorageSerializationPolicy

Boolean

Unset storage serialization policy

unsetObjectVisibility

Boolean

Unset object visibility

unsetCatalogSync

Boolean

Unset catalog sync

unsetReplicableWithFailoverGroups

Boolean

Unset replicable with failover groups

unsetBaseLocationPrefix

Boolean

Unset base location prefix

unsetDefaultStreamlitNotebookWarehouse

Boolean

Unset default Streamlit notebook warehouse

unsetDefaultNotebookComputePoolCpu

Boolean

Unset default notebook compute pool CPU

unsetDefaultNotebookComputePoolGpu

Boolean

Unset default notebook compute pool GPU

unsetClassificationProfile

Boolean

Unset classification profile

unsetEnableDataCompaction

Boolean

Unset enable data compaction

<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
  xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
  xmlns:pro-snowflake="http://www.liquibase.org/xml/ns/pro-snowflake"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
        http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
        http://www.liquibase.org/xml/ns/pro-snowflake
        http://www.liquibase.org/xml/ns/pro-snowflake/liquibase-pro-snowflake-latest.xsd">
  <!-- Set numeric properties -->
  <changeSet id="alter-database-set-numeric" author="examples">
    <pro-snowflake:alterDatabaseProperties
            databaseName="MY_DATABASE"
            ifExists="true"
            dataRetentionTimeInDays="7"
            maxDataExtensionTimeInDays="14"/>
  </changeSet>
  <!-- Set string and enum properties -->
  <changeSet id="alter-database-set-strings" author="examples">
    <pro-snowflake:alterDatabaseProperties
            databaseName="MY_DATABASE"
            comment="Production database"
            defaultDdlCollation="en_US"
            logLevel="INFO"
            traceLevel="ON_EVENT"/>
  </changeSet>
  <!-- Set boolean and keyword properties -->
  <changeSet id="alter-database-set-boolean" author="examples">
    <pro-snowflake:alterDatabaseProperties
            databaseName="MY_DATABASE"
            replaceInvalidCharacters="true"
            storageSerializationPolicy="OPTIMIZED"/>
  </changeSet>
  <!-- Unset multiple properties -->
  <changeSet id="alter-database-unset" author="examples">
    <pro-snowflake:alterDatabaseProperties
            databaseName="MY_DATABASE"
            unsetComment="true"
            unsetDefaultDdlCollation="true"
            unsetLogLevel="true"/>
  </changeSet>
</databaseChangeLog>