@SnapshotStatus — Lists information about the most recent snapshots created from the current database.
@SnapshotStatus
The @SnapshotStatus system procedure is being deprecated and may be removed in future versions. Please use the @Statistics "SNAPSHOTSTATUS" selector, which returns the same results, to retrieve information about recent snapshots.
The @SnapshotStatus system procedure provides information about up to ten of the most recent snapshots performed on the current database. The information provided includes the directory path and prefix for the snapshot, when it occurred and how long it took, as well as whether the snapshot was completed successfully or not.
@SnapshotStatus provides status of any snapshots, including both native and CSV snapshots, as well as manual, automated, and command log snapshots.
Note that @SnapshotStatus does not tell you whether the snapshot files still exist, only that the snapshot was performed. You can use the procedure @SnapshotScan to determine what snapshots are available.
Also, the status information is reset each time the database is restarted. In other words, @SnapshotStatus only provides information about the most recent snapshots since the current database instance was started.
Returns one VoltTable with a row for every snapshot file in the recent snapshots performed on the cluster.
Name | Datatype | Description |
---|---|---|
TIMESTAMP | BIGINT | The timestamp when the snapshot was initiated (in milliseconds). |
HOST_ID | INTEGER | Numeric ID for the host node. |
HOSTNAME | STRING | Server name of the host node. |
TABLE | STRING | The name of the database table whose data the file contains. |
PATH | STRING | The directory path where the snapshot file resides. |
FILENAME | STRING | The file name. |
NONCE | STRING | The unique identifier for the snapshot. |
TXNID | BIGINT | The transaction ID of the snapshot. |
START_TIME | BIGINT | The timestamp when the snapshot began (in milliseconds). |
END_TIME | BIGINT | The timestamp when the snapshot was completed (in milliseconds). |
SIZE | BIGINT | The total size, in bytes, of the file. |
DURATION | BIGINT | The length of time (in milliseconds) it took to complete the snapshot. |
THROUGHPUT | FLOAT | The average number of bytes per second written to the file during the snapshot process. |
RESULT | STRING | String value indicating whether the writing of the snapshot file was successful ("SUCCESS") or not ("FAILURE"). |
The following example uses @SnapshotStatus to display information about the most recent snapshots performed on the current database:
$ sqlcmd 1> exec @SnapshotStatus;
The following code example demonstrates how to perform the same function programmatically:
VoltTable[] results = null; try { results = client.callProcedure("@SnapshotStatus").getResults(); } catch (Exception e) { e.printStackTrace(); } for (VoltTable t: results) { System.out.println(t.toString()); }