Parameters
CREATE
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>
<backup name>
Name of the backup to create.
<data sink name>
<data sink name>
Name of the data sink to use to send the database backup
files to the remote file store.
TYPE
TYPE
Type of snapshot to create.Snapshot type designations include:
| Snapshot Type | Description |
|---|---|
full | Create a full snapshot of the specified database objects. This is the default when CREATE is specified. |
incremental | Create 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. |
differential | Create a snapshot of the changes to the specified database objects since the most recent full snapshot was created. |
OBJECTS
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 Type | Description |
|---|---|
ALL | Schema, and all the objects & data it contains |
CONTEXT | SQL-GPT context |
CREDENTIAL | Credential |
DATA SINK | Data sink |
DATA SOURCE | Data source |
DIRECTORY | KiFS directory |
FUNCTION | UDF |
FUNCTION ENVIRONMENT | UDF environment |
GRAPH | Graph. Source tables, if applicable, are required in order to restore it. |
PROCEDURE | SQL procedure |
RESOURCE GROUP | Resource group |
ROLE | User role |
STREAM | Stream |
TABLE | Table or view |
USER | User |
WITH OPTIONS
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_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
CHECKSUM
Calculate and store a checksum of all backed-up objects. The default (
false) is to not create
checksums.COMMENT
COMMENT
Comment to associate with the snapshot.
DDL_ONLY
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
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
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
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
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 namedschema_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
CREATE BACKUP (Incremental Snapshot) Example
CREATE BACKUP (Differential Snapshot) Example