Kinetica provides a SQL interface for performing hot backups via full, incremental, & differential snapshots and restoration of schema objects and data. For information on full system backups, see System Backup instead.
The ability to manage backups is available using the following commands:
See Backing Up & Restoring the Cluster for details on backing up and restoring data.
CREATE BACKUP
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 | Description | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CREATE | Keyword indicating a backup should be created with an initial full snaphost. 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:
| ||||||||||||||||||||||
| OBJECTS | List of key/value pairs, each being an object type and an object name of that type, to back up. Important 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:
| ||||||||||||||||||||||
| WITH OPTIONS | Optional indicator that a comma-delimited list of backup option name/value assignments will follow. See Backup Options for the complete list of options. |
Backup Options
The following options can be specified to further modify a backup configuration.
| Option | Description |
|---|---|
| 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. Note 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 backup_schema with a full snapshot of schema example_backup, copying backup files to a target via data source backup_ds:
| |
To create an incremental snapshot based on the previous snapshot of the backup with the same name:
| |
To create a differential snapshot based on the previous full snapshot of the backup with the same name:
| |
ALTER BACKUP
Any of the following facets of a backup can be altered, via a given data sink:
- Backup snapshots can be merged into a single full snapshot.
- Backup snapshots can be individually deleted
- Backup options can be set
| |
| Parameters | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| <backup name> | Name of the backup to alter. | ||||||||
| <data sink name> | Name of the data sink used to alter the database backup files on the remote file store. | ||||||||
| MERGE | Merges all snapshots of a given backup into a single, full snapshot. An error will be reported if the backup contains only one full snapshot. | ||||||||
| PURGE | Deletes the snapshot identified with <backup id>. Only applicable to incremental and differential snapshots. | ||||||||
| SET | Sets the given list of properties to their given corresponding values. Note These settings will affect future snapshots of the given backup; existing snapshots will remain unchanged. Alterable properties include:
| ||||||||
| WITH OPTIONS | Optional indicator that a comma-delimited list of alteration option name/value assignments will follow. Alter options include:
|
Examples
For example, to merge all snapshots of a backup into a single full snapshot and add a comment to the merged backup:
| |
To purge a given snapshot by ID number:
| |
To set the maximum number of incremental snapshots of a backup to keep to 5:
| |
RESTORE BACKUP
Restores the given database objects & data from an existing full, incremental, or differential snapshot within a backup; retrieving the backed-up files at the location accessible through the given data source.
Each restored object is placed in its original schema.
| |
| Parameters | Description | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| <backup name> | Name of the backup from which objects will be restored. | ||||||||||||||||||||||
| <data source name> | Name of the data source to use to retrieve the database backup files from the remote file store. | ||||||||||||||||||||||
| OBJECTS | List of key/value pairs, each being an object type and an object name of that type, to restore. object type designations include:
| ||||||||||||||||||||||
| WITH OPTIONS | Optional indicator that a comma-delimited list of backup restoration option name/value assignments will follow. See Restore Options for the complete list of options. |
Restore Options
The following options can be specified to further modify a backup restoration.
| Option | Description | ||||||
|---|---|---|---|---|---|---|---|
| BACKUP_ID | ID of snapshot from which objects will be restored. The default is to use the most recent one. | ||||||
| CHECKSUM | Verify checksums calculated during back up process before restoring. The default (false) is to not verify checksums. | ||||||
| CREATE_SCHEMA_IF_NOT_EXIST | Whether to create the schema containing objects being restored if it doesn't exist. The default (true) is to create the schema if it doesn't exist. | ||||||
| DDL_ONLY | For any table, only restore its DDL; don't restore its data. The default (false) is to restore data and DDL. | ||||||
| DRY_RUN | Execute a dry run of a restoration without actually restoring any files. The default (false) is to not do a dry run. | ||||||
| RENAMED_OBJECTS_SCHEMA | If RESTORE_POLICY is rename, each existing database objects will be relocated to this schema if a restored database object would otherwise collide with it. If not specified, the schema name will be automatically generated, using the format: backup_<UUID>. | ||||||
| RESTORE_POLICY | Restoration scheme to use when restoring objects that already exist. The default policy is to abort the restoration and return an error. Other policy choices include:
|
Examples
For example, to restore the example_backup schema from a backup named backup_schema, copying data from a source via data source backup_ds:
| |
To restore individual tables from a backup named backup_schema, restoring tables that already exist into a new schema, example_backup_restore:
| |
DROP BACKUP
Deletes one or more backups and all associated files from the remote store accessible through the given data sink.
| |
| Parameters | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| <backup name> | Name of the backup(s) to delete that are accessible via the data sink given by <data sink name>. Use * at the end of the <backup name> to delete all backups that start with <backup name>. Use * instead of <backup name> to delete all backups. Note The DELETE_ALL_BACKUPS option must be set to true when using *. | ||||||||
| <data sink name> | Name of the data sink to use to delete the database backup files from the remote file store. | ||||||||
| WITH OPTIONS | Optional indicator that a comma-delimited list of deletion option name/value assignments will follow. Delete options include:
|
Examples
For example, to delete a backup, schema_backup, via a data sink, backup_ds, through which the backup files can be accessed:
| |
To delete all backups accessible via the backup_ds data sink that have a backup name starting with security:
| |
To delete all backups accessible via the backup_ds data sink:
| |
SHOW BACKUP
Outputs the DDL statement used to initially create one or more backups accessible via the given data source.
| |
Note
The response to SHOW BACKUP is a single-column result set with the DDL statement as the value in the DDL column.
| Parameters | Description |
|---|---|
| <backup name> | Name of the backup(s) to show that are accessible via the data source given by <data source name>. Use * at the end of the <backup name> to show all backups that start with <backup name>. Use * instead of <backup name> to show all backups. |
| <data source name> | Name of the data source to use to retrieve the database backup file information from the remote file store. |
Examples
For example, to output the DDL for a backup, schema_backup, via a data source, restore_ds, through which the backup files can be accessed:
| |
To output the DDL for all backups whose name starts with security that are accessible via the restore_ds data source:
| |
To output the DDL for all backups that are accessible via the restore_ds data source:
| |
DESCRIBE BACKUP
Outputs the detail of snapshots of one or more backups accessible via the given data source.
| |
Listing options:
Note
The response to DESCRIBE BACKUP is a 13-column result set:
- BACKUP_NAME - unique name for the backup file set
- BACKUP_ID - unique ID of the snapshot within the backup
- BACKUP_TYPE - type of the snapshot; see CREATE BACKUP for values
- TIME - timestamp at which the snapshot was initiated
- DURATION - duration, in milliseconds, of the snapshot processing
- CLUSTER_ID - identifier of the cluster backed-up, within an HA ring
- HOST_NAME - hostname of the server on which the snapshot was created
- HOST_ID - IP address of the server on which the snapshot was created
- OBJECTS - list of objects backed up and their respective types
- SIZE - size, in bytes, of the backed-up data files contained within the snapshot
- FILES - number of backed-up data files contained within the snapshot
- RECORDS - number of data records contained within the snapshot
- COMMENT - comment associated with the snapshot
| Parameters | Description |
|---|---|
| <backup name> | Name of the backup(s) to describe that are accessible via the data source given by <data source name>. Use * at the end of the <backup name> to describe all backups that start with <backup name>. Use * instead of <backup name> to describe all backups. |
| <data source name> | Name of the data source to use to retrieve the database backup file information from the remote file store. |
Examples
For example, to output the detail for a backup, schema_backup, via a data source, restore_ds, through which the backup files can be accessed:
| |
To output the detail for all backups whose name starts with security that are accessible via the restore_ds data source:
| |
To output the detail for all backups that are accessible via the restore_ds data source:
| |