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.

To restore individual objects, the source backup must be from the same version of Vertica as the destination database. Vertica does not support individual object restore across different versions.

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.

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.

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.

See Also