Restore Backup

Restores database objects from a backup accessible via the data source specified by input parameter datasource_name.

Input Parameter Description

NameTypeDescription
backup_namestringName of the backup to restore from, which must refer to an existing backup. The default value is ''.
restore_objects_mapmap of string to strings

Map of database objects to be restored from the backup.

Supported Parameters (keys)Parameter Description
allAll object types and data contained in the given schema(s).
contextContext(s).
credentialCredential(s).
datasinkData sink(s).
datasourceData source(s).
function_environmentPython UDF function environment(s).
monitorTable monitor(s) / SQL stream(s).
resource_groupResource group(s).
roleRole(s), role members (roles or users, recursively), and associated permissions.
stored_procedureSQL procedure(s).
tableTable(s) and SQL view(s).
userUser(s) (internal and external) and associated permissions.
user_defined_functionUDF(s).
datasource_namestringData source through which the backup will be restored.
optionsmap of string to strings

Optional parameters. The default value is an empty map ( {} ).

Supported Parameters (keys)Parameter Description
backup_idID of the snapshot to restore. Leave empty to restore the most recent snapshot in the backup. The default value is ''.
checksum

Whether or not to verify checksums for backup files when restoring. The default value is false. The supported values are:

  • true
  • false
create_schema_if_not_exist

Behavior to apply when the schema containing any database object to restore does not already exist. The default value is true.

Supported ValuesDescription
trueIf the schema containing any restored object does not exist, create it automatically.
falseIf the schema containing any restored object does not exist, return an error.
ddl_only

Behavior to apply when restoring tables. The default value is false.

Supported ValuesDescription
trueRestore table DDL, but do not restore data.
falseRestore tables and their data.
dry_run

Whether or not to perform a dry run of the restoration operation. The default value is false. The supported values are:

  • true
  • false
reingest

Behavior to apply when restoring table data. The default value is false.

Supported ValuesDescription
trueRestore table data by re-ingesting it. This is the default behavior if the cluster topology differs from that of the contained backup.
falseRestore the persisted data files directly.
renamed_objects_schemaIf the restore_policy is rename, use this schema for relocated existing objects instead of the default generated one. The default value is ''.
restore_policy

Behavior to apply when any database object to restore already exists. The default value is none.

Supported ValuesDescription
noneIf an object to be restored already exists with the same name, abort and return error.
replaceIf an object to be restored already exists with the same name, replace it with the backup version.
renameIf an object to be restored already exists with the same name, move that existing one to the schema specified by renamed_objects_schema. This policy does not apply to non-schema objects.

Output Parameter Description

NameTypeDescription
backup_namestringValue of input parameter backup_name.
backup_idlongID of the snapshot that was restored.
restored_byteslongTotal size of data restored from backup.
restored_fileslongTotal number of files restored from backup.
restored_recordslongTotal number of records restored from backup.
restored_objectsmap of string to stringsDatabase objects that were successfully restored and their associated types.
renamed_objectsmap of string to stringsOriginal and new names of database objects that were successfully restored and their associated types.
failed_objectsmap of string to stringsDatabase objects that failed to be restored and their associated types.
infomap of string to stringsAdditional information.