RESTORE FROM ARCHIVE

Eon Mode only

Restores database objects from an in-database restore point saved in an archive. You can restore all objects saved in the restore point or a subset of those objects.

You cannot use an object-level restore point to revive a full database. To revive a database from a full-database restore point, use the revive_db command. For details, see Revive from a restore point.

Syntax

RESTORE FROM ARCHIVE archive-name
  [ INDEX restore-point-index ]
    [ MODE 'mode' ]
    [ SCHEMA PREFIX prefix ]
    [ OBJECTS ( object-inclusion-rules ) ]

Arguments

archive-name
Name of the archive that contains the restore point.
restore-point-index
Index of the restore point in the archive, where index 1 specifies the most recently saved restore point. If you omit INDEX, Vertica restores from the most recent restore point in the archive.
mode
One of the following restore modes:
  • CREATE: Create restored objects that do not already exist.
  • CREATE_OR_REPLACE: Create restored objects or replace existing objects with the restored versions.
  • COEXIST: Restore objects alongside existing objects.
prefix
Prefix to add to restored schema names when MODE 'COEXIST' is specified.
object-inclusion-rules
One or more rules that specify the objects to restore from the selected restore point. You can specify exact object names or use ILIKE patterns. You can also exclude objects from the included set. For example:
  • INCLUDE SCHEMA store
  • INCLUDE TABLE store.orders
  • INCLUDE TABLES ILIKE store.%
  • INCLUDE SCHEMA store, EXCLUDE TABLE store.stage_orders

Privileges

Superuser or archive owner

Examples

Restore the most recent restore point in the object_backup archive:

=> RESTORE FROM ARCHIVE object_backup;

Restore the store.orders table from the most recent restore point in the object_backup archive:

=> RESTORE FROM ARCHIVE object_backup OBJECTS ( INCLUDE TABLE store.orders );

Restore objects from the restore point with index 1, replacing existing objects with the restored versions:

=> RESTORE FROM ARCHIVE object_backup INDEX 1 MODE 'CREATE_OR_REPLACE' OBJECTS ( INCLUDE SCHEMA store );

See also