---
sidebar_position: 1
title: CREATE SNAPSHOT
description: Create a snapshot of a MotherDuck database for recovery or read scaling.
---

The `CREATE SNAPSHOT` statement creates a snapshot of a single MotherDuck database. You can create an unnamed snapshot or provide a name to create a **named snapshot**.

Named snapshots can be looked up and restored later. Their names can be updated (or removed) using [`ALTER SNAPSHOT`](/sql-reference/motherduck-sql-reference/alter-snapshot). For retention and recovery behavior, see the [data recovery guide](/concepts/data-recovery).

## Syntax

```sql
CREATE SNAPSHOT [<snapshot_name>] OF <database_name>;
```

## Notes

- Only one database can be snapshotted per statement.
- If you omit a name, the snapshot is eligible for restore only while it remains within the database's `SNAPSHOT_RETENTION_DAYS` window. Use [`ALTER DATABASE`](/sql-reference/motherduck-sql-reference/alter-database) to configure retention.
- If you provide a name, the snapshot becomes a named snapshot and is retained until it is unnamed.
- `CREATE SNAPSHOT` waits for active write queries to finish and blocks new writes until the snapshot is created.
- MotherDuck also takes automatic snapshots in the background every minute when no write queries are running.

## Read scaling

Creating a snapshot will make the latest data available to read-scaling connections.

Each read-scaling instance picks up the latest available snapshot every minute. To minimize delays and ensure access to the latest data, use `CREATE SNAPSHOT` on the writer connection, followed by a `REFRESH DATABASE <name>` on the read scaling connection.

Learn more about [`REFRESH DATABASES`](/sql-reference/motherduck-sql-reference/refresh-database).

## Examples

Create a named snapshot:

```sql
CREATE SNAPSHOT prod_backup OF my_db;
```

Create an unnamed snapshot:

```sql
CREATE SNAPSHOT OF my_db;
```
