# Database

> Snowflake databases cost nothing to exist, but each carries a DATA_RETENTION_TIME_IN_DAYS default (1 day unless changed, up to 90 on Enterprise edition) that every table created beneath it inherits for Time Travel storage. ZopNight inventories databases via SHOW DATABASES to structure storage attribution and roll table findings up to owners.

Source: https://zop.dev/integrations/snowflake/database
Updated: 2026-08-19

---

A Snowflake database is a container of schemas and tables with no meter of its own; it costs nothing to exist. What it does carry are defaults that every table created beneath it inherits: the Time Travel retention window and the permanent-versus-transient kind. Container-level settings are where table storage bills get decided in advance, one CREATE TABLE at a time.

## Retention flows downhill

`DATA_RETENTION_TIME_IN_DAYS` set on a database becomes the default for tables created inside it: 1 day unless someone changes it, extendable to 90 on Enterprise edition. Raise it to 30 at the database level and every new table silently retains a month of superseded data in Time Travel storage, a decision most table owners will never know was made for them.

## Kind is inherited too

A transient database makes its tables transient by default: no Fail-safe layer, and Time Travel capped at 1 day. For scratch schemas, staging areas, and anything rebuildable from source, that one property removes the most expensive retention layers wholesale, often the cheapest storage decision available, made once.

## What discovery keeps and drops

Inventory comes from `SHOW DATABASES`, with metadata capturing kind, `retention_time`, owner, and origin. Snowflake-provided shares, the `SNOWFLAKE` metadata database and `SNOWFLAKE_SAMPLE_DATA`, plus any imported share, identifiable by a non-empty origin, are excluded: read-only, not customer-owned, nothing actionable in them. Child objects living inside those shares are filtered out of discovery for the same reason.

## The rollup role

Databases are how storage cost gets an owner. Table-level findings roll up through their parent database, and tag enrichment from `TAG_REFERENCES` attaches team, cost-center, and environment context, turning a wall of table rows into per-owner numbers someone can act on.

## Audit your defaults

```sql
SHOW DATABASES;
```

Scan the `retention_time` column of the output. A database showing 30 or 90 propagates that window to every table created under it. Each of those tables then pays Time Travel storage for the full window, whether or not anyone ever needs the history.
