Skip to main content
Creates a new full, incremental, or differential snapshot of the given database objects and data; storing the backup files at the location accessible through the given data sink.

Parameters

CREATE

Keyword indicating a backup should be created with an initial full snapshot. If omitted, an incremental snapshot will be created, using the most recent full or incremental snapshot as the baseline.

<backup name>

Name of the backup to create.

<data sink name>

Name of the data sink to use to send the database backup files to the remote file store.

TYPE

Type of snapshot to create.Snapshot type designations include:
Snapshot TypeDescription
fullCreate a full snapshot of the specified database objects. This is the default when CREATE is specified.
incrementalCreate a snapshot of the changes to the specified database objects since the most recent snapshot of any kind was created. This is the default when CREATE is omitted.
differentialCreate a snapshot of the changes to the specified database objects since the most recent full snapshot was created.

OBJECTS

List of key/value pairs, each being an object type and an object name of that type, to back up.
The OBJECTS clause should only be specified for full snapshots. Both incremental & differential snapshots will operate on the objects specified during the original full snapshot associated with the backup name specified for them.
object type designations include:
Object TypeDescription
ALLSchema, and all the objects & data it contains
CONTEXTSQL-GPT context
CREDENTIALCredential
DATA SINKData sink
DATA SOURCEData source
DIRECTORYKiFS directory
FUNCTIONUDF
FUNCTION ENVIRONMENTUDF environment
GRAPHGraph. Source tables, if applicable, are required in order to restore it.
PROCEDURESQL procedure
RESOURCE GROUPResource group
ROLEUser role
STREAMStream
TABLETable or view
USERUser

WITH OPTIONS

Optional indicator that a comma-delimited list of backup option name/value assignments will follow.See Options for the complete list of options.

Options

The following options can be specified to further modify a backup configuration.

BLOCK_TABLE_MUTATIONS

Block all data mutations on the tables being backed up, for the duration of the back up. Blocked mutations are rejected with an error; they are not queued. The default (false) is to allow mutations, blocking them on a given table only at the point a disk eviction of that table’s data is necessary.
Alterations to the type or attributes of a table are blocked for the duration of any back up, whether or not this option is used; this option governs data mutations specifically.

CHECKSUM

Calculate and store a checksum of all backed-up objects. The default (false) is to not create checksums.

COMMENT

Comment to associate with the snapshot.

DDL_ONLY

For any table, only back up its DDL; don’t back up its data. The default (false) is to back up data and DDL.
In this mode, subsequent incremental & differential snapshot attempts will return a warning and create no additional snapshot if only data has changed since the last snapshot.

DELETE_INTERMEDIATE_BACKUPS

For differential snapshot types only, delete all prior intermediate differential & incremental snapshots between the last full snapshot and this one for the given backup name. The default (false) is to not delete intermediate snapshots.

DRY_RUN

Execute a dry run of a back up without actually backing up any files. The default (false) is to not do a dry run.

MAX_INCREMENTAL_BACKUPS_TO_KEEP

Maximum number of incremental snapshots to keep for the given backup name; if creating this incremental snapshot will cause the total number to exceed this maximum, the oldest incremental snapshot will be removed. The default is unlimited.

RECREATE

For full snapshot types only, replace the existing backup with a new backup, if it exists. The default (false) is to not replace the existing backup and return an error, if one exists.

Examples

For example, to create a backup named schema_backup with a full snapshot of schema example_backup, copying backup files to a target via data source backup_ds:
CREATE BACKUP (Full Snapshot) Example
To create an incremental snapshot based on the previous snapshot of the backup with the same name:
CREATE BACKUP (Incremental Snapshot) Example
To create a differential snapshot based on the previous full snapshot of the backup with the same name:
CREATE BACKUP (Differential Snapshot) Example