Restoring individual objects
You can use vbr
to restore individual tables and schemas from a full or object-level backup: qualify the restore
task with --restore-objects
, and specify the objects to restore as a comma-delimited list:
Important
If your Eon Mode database has multiple namespaces, you must specify the namespace to which the objects belong. Forvbr
tasks, namespace names are prefixed with a period. For example, .n.s.t
refers to table t
in schema s
in namespace n
. See Eon Mode database requirements for more information.
$ vbr --task restore --config-file=filename --restore-objects='objectname[,...]' [--archive=archive-id] [--target-namespace=namespace-name]
The following requirements and restrictions apply:
-
The database must be running, and nodes must be UP.
-
Tables must include their schema names.
-
Do not embed spaces before or after comma delimiters of the
--restore-objects
list; otherwise,vbr
interprets the space as part of the object name. -
Object-level restore is not supported for HDFS storage locations. To restore an HDFS storage location you must do a full restore.
If the schema has a disk quota and restoring the table would exceed the quota, the operation fails.
By default, --restore-objects
restores the specified objects from the most recent backup. You can restore from an earlier backup with the --archive parameter.
The --target-namespace
parameter is only valid for Eon Mode databases with multiple namespaces. The parameter specifies the namespace in the target cluster to which objects are restored. For more information, see Eon Mode database requirements.
The following example uses the db.ini
configuration file, which includes the database administrator's password:
> vbr --task restore --config-file=db.ini --restore-objects=salesschema,public.sales_table,public.customer_info
Preparing...
Found Database port: 5433
Copying...
[==================================================] 100%
All child processes terminated successfully.
All extract object child processes terminated successfully.
Copying...
[==================================================] 100%
All child processes terminated successfully.
restore done!
Object dependencies
When you restore an object, Vertica does not always restore dependent objects. For example, if you restore a schema containing views, Vertica does not automatically restore the tables of those views. One exception applies: if database tables are linked through foreign keys, you must restore them together, unless
drop_foreign_constraints
is set in the vbr
configuration file to true.
Note
You must also setobjectRestoreMode
to coexist
, otherwise Vertica ignores drop_foreign_constraints
.
Duplicate objects
You can specify how restore operations handle duplicate objects by configuring
objectRestoreMode
. By default, it is set to createOrReplace
, so if a duplicate object exists, the restore operation overwrites it with the archived version.
Interactions with data loaders
When doing a restore with objectRestoreMode
set to coexist
, vbr
creates new data loaders and their corresponding state tables, but does not change the table names in the loader COPY clauses. After the restore, you can use ALTER DATA LOADER to update the COPY statement in the restored data loader to use the new table name.
Eon Mode considerations
Restoring objects to an Eon Mode database can leave unneeded files in cloud storage. These files have no effect on database performance or data integrity. However, they can incur extra cloud storage expenses. To remove these files, restart the database and call CLEAN_COMMUNAL_STORAGE with an argument of true.