Appendix B. Snapshot Utilities

Documentation

Home » Documentation » Administrator's Guide

Appendix B. Snapshot Utilities

VoltDB provides two utilities for managing snapshot files. These utilities verify that a native snapshot is complete and usable and convert the snapshot contents to a text representation that can be useful for uploading or reloading data in case of severe errors.

It is possible, as the result of a design flaw or failed program logic, for a database application to become unusable. However, the data is still of value. In such emergency cases, it is desirable to extract the data from the database and possibly reload it. This is the function that save and restore performs within VoltDB.

But there may be cases when you want to use the data created by a VoltDB snapshot elsewhere. The goal of the utilities is to assist in that process. The snapshot utilities are:

  • SnapshotConverter converts a snapshot (or part of a snapshot) into text files, creating one file for each table in the snapshot.

  • SnapshotVerifier verifies that a VoltDB snapshot is complete and usable.

Unlike system procedures, that must be run within the context of an existing database connection, the snapshot utilities can be run from the command line without a running database present. However, the utilities are still dependent on the Java classes and library for VoltDB. So you must be sure to define your Java classpath and library path appropriately to invoke the classes.

To run either SnapshotVerifier or SnapshotConverter, use the Java command to invoke the class, specifying the appropriate classpath and library path based on where your VoltDB software is installed. For example, if VoltDB is installed in /opt/voltdb, the command to invoke SnapshotVerifier is as follows:

$ java -classpath "/opt/voltdb/voltdb/*" \ 
       -Djava.library.path=/opt/voltdb/voltdb \
       org.voltdb.utils.SnapshotVerifier 

You may find it easier to add an alias to your shell script startup file to abbreviate these commands:

$ alias snapshotverify="java -cp \"/opt/voltdb/voltdb/*\"  \
        -Djava.library.path=/opt/voltdb/voltdb \
         org.voltdb.utils.SnapshotVerifier "
$ alias snapshotconvert="java -cp \"/opt/voltdb/voltdb/*\"  \
        -Djava.library.path=/opt/voltdb/voltdb \ 
        org.voltdb.utils.SnapshotConverter " 

The following sections describing each command assume these aliases have been defined.

Each command accepts a different set of arguments. Use the --help argument to display a list the allowable arguments and qualifiers. For example:

$ snapshotverify --help