Restoring Individual Objects from a Full or Object-Level Backup

You can restore individual tables or schemas from a backup that contains those objects without restoring the entire backup. This option is useful if you only need to restore a few objects and want to avoid the overhead of a larger-scale restore. Your database must be running, and your nodes must be UP to restore individual objects.

For information about specifying the objects to include, see Including and Excluding Objects Using Wildcards.

When you restore an object, Vertica does not necessarily restore dependent objects. For example, if you restore a schema containing views, Vertica does not automatically restore the tables corresponding to those views.

You can specify how Vertica reacts to duplicate objects by configuring the objectRestoreMode setting in your vbr configuration file.

In Eon Mode you can restore objects only from a full backup. See Requirements for Eon Mode Databases for additional requirements.

In Enterprise Mode you can restore from any backup containing the objects you want to restore.

Restoring an Object from the Most Recent Backup

To restore individual objects from the most recent backup, add the --restore-objects parameter to the restore task and list the tables and/or schemas to restore:

$ vbr --task=restore --config-file=filename --restore-objects='objectname,objectname'

Identify tables by fully qualified schema and name. To restore multiple objects, use a comma as a delimiter. Alternatively, you can use wildcard patterns and include/exclude lists to identify objects to restore, as in the following example:

$ vbr --task=restore --config-file=db.ini --include-objects=salesschema --exclude-objects salesschema.cust*

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
Found Database port:  5433
[==================================================] 100%
All child processes terminated successfully.
All extract object child processes terminated successfully.
[==================================================] 100%
All child processes terminated successfully.
restore done!

Restoring an Object from an Archive

You can restore from an archive instead of the most recent backup by using the --archive parameter, as described in Restoring a Database from a Full Backup.

Additional Considerations for Eon Mode

Restoring objects to an Eon Mode database can leave unneeded files in S3. This does not affect the behavior of Vertica or the integrity of your database. However, you pay for the space you use in S3, so you might want to clean up unneeded files.

You can clean up these extra files by running CLEAN_COMMUNAL_STORAGE. This function requires that nodes be restarted, which is why vbr does not automatically do this cleanup. You can schedule this work for a maintenance window, or you can do rolling restarts so that your database remains up.

You can approximate the amount of space used by these unneeded files. You can use the AUDIT function to see how much space Vertica is using and compare it to the total space you are using in the S3 bucket containing your communal storage.

See Also