Restoring Individual Objects from a Full or Object-Level Backup

You can copy individual tables or schemas from any 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.

When you restore an object, Vertica does not automatically restore any 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.

This feature is available for Enterprise Mode databases only.

Restoring an Object from the Most-Recent Backup

To restore individual objects from the most recent backup, you use the vbr utility, just as you did to create the backup. Execute the command using the following form:

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

To restore an object, log in using the database administrator's account. You cannot run the utility as root.

To restore from the most recent backup, use the configuration file used to create the backup, specifying the restore vbr task. Be sure to include the --restore-objects parameter and the names of the objects that you want to restore. Identify tables by fully qualified schema.name. To restore multiple objects, use a comma as a delimiter. Alternatively, you can use wildcard patterns to identify objects to restore.

If your configuration file does not contain the database superuser password, the vbr utility prompts you to enter it at run time.

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!

Restoring an Object from an Archive

To restore individual objects from a specific archive, you use the same vbr utility that you used to create the backup. The command takes the following form:

> vbr --task=restore --config-file=filename --archive=date_time --restore-objects=objectname,objectname
      

Invoke the utility with the --task restore command, the configuration file with which you created the backup. Next, add the --archive parameter with the date_timestamp suffix of the directory name to identify which archive to restore.

The --archive parameter identifies the archive subdirectory, including date and time. For example, _archive20121111_205841 was created on date 11-11-2012 at time 20:58:41. You need specify only the date_time suffix because the configuration .ini file identifies the backup name of the subdirectory. Additionally, the OID identifier indicates the backup is an archive.

For example:

> vbr --task restore --config-file fullbak.ini --archive=20121111_205841 --restore-objects=salesdb.contacts
      

The vbr utility restores the backup.

Restore and Replicate Objects to a Newer Version of Vertica

Beginning with version 9.0.0-2, Vertica supports object replication and restoration to a target database up to one minor version later than the current database version. For example, you can replicate or restore objects from a version 9.0.0-2 database to a version 9.0.1 database. The restore or replication process from one version to another is the same as it is to the same version.

If your restored or replicated objects require a UDx library that is not present in the later version of your database, Vertica displays the following error:

ERROR 2858:  Could not find function definition

You can resolve this issue by installing compatible libraries in your target database.

See Also