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 |
|---|---|---|---|
| String | Name of the database to alter | Yes |
| Boolean | Only alter if the database exists using | No |
SET properties
Attribute | Type | Description |
|---|---|---|
| Integer | Days to retain data for Time Travel (0-90) |
| Integer | Maximum days Time Travel retention can be extended |
| String | Comment describing the database |
| String | Default collation for objects (e.g., |
| String | Default compute pool for CPU notebooks |
| String | Default compute pool for GPU notebooks |
| String | Logging level: |
| String | Metric collection level: |
| String | Trace level: |
| String | Catalog synchronization settings |
| String | Base location prefix for database |
| String | Classification profile for the database |
| String | External volume for the database |
| String | Catalog identifier for the database |
| String | Event table for the database |
| String | Default warehouse for Streamlit notebooks |
| Boolean | Replace invalid UTF-8 characters |
| Boolean | Enable automatic data compaction |
| Boolean |
|
| String | Storage format policy: |
| String | Object visibility setting: |
UNSET properties
Attribute | Type | Description |
|---|---|---|
| Boolean | Unset data retention time |
| Boolean | Unset max data extension time |
| Boolean | Unset comment |
| Boolean | Unset default DDL collation |
| Boolean | Unset external volume |
| Boolean | Unset catalog |
| Boolean | Unset event table |
| Boolean | Unset replace invalid characters |
| Boolean | Unset log level |
| Boolean | Unset metric level |
| Boolean | Unset trace level |
| Boolean | Unset storage serialization policy |
| Boolean | Unset object visibility |
| Boolean | Unset catalog sync |
| Boolean | Unset replicable with failover groups |
| Boolean | Unset base location prefix |
| Boolean | Unset default Streamlit notebook warehouse |
| Boolean | Unset default notebook compute pool CPU |
| Boolean | Unset default notebook compute pool GPU |
| Boolean | Unset classification profile |
| 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>