Skip to content

sys.backup_legacy

This system view captures information about active backup (ybbackup) operations that are run with pre-Version 4.0 legacy tools.

Column NameData TypeDescription
session_keytextUnique session key generated for the backup operation.
statetextCurrent state of the backup operation, such as RUNNING or DONE.
error_stringtextError message reported for a failed backup. For example, if a backup is cancelled before it completes, the view may report an External data socket error.
object_idbigintUnique ID of the database that was backed up.
user_idbigintUnique ID of the database user.
session_idbigintUnique ID of the ybbackup session.
object_nametextName of the database that was backed up, as passed in on the ybbackup command line.
user_nametextName of the database user, as passed in on the ybbackup command line (or set with YBUSER).
client_hostnametextClient host name, if available.
client_usernametextOperating system user on the client system who is running the backup tool.
start_timetimestamptzWhen the ybbackup command started running.
last_activity_timetimestamptzWhen ybbackup activity was last logged.
transaction_idbigintUnique transaction ID for the backup.
backup_nametextBackup name as specified with the ybbackup --name option.
directoriestextDirectory location where the backup is stored.
sent_bytesbigintNumber of bytes transferred over the network.
sent_bytes_per_seconddouble precisionNumber of bytes per second transferred over the network.
nodatabooleanWhether this backup was a "nodata" backup (metadata only).
groups_remainingbigintNumber of backup "groups" remaining to be processed. When a backup starts, the data that needs to be backed up is batched into some number of groups. Although the data is logically organized into groups, a group is not equivalent to a table. The number of groups remaining drops as the backup proceeds.
total_groupsbigintTotal number of groups for this backup operation.

Examples

yellowbrick=# select * from sys.backup;
-[ RECORD 1 ]---------+-----------------------------------------------------------------
session_key           | Dmct_TYz45AEyl35aWYjXW7bs_x54zRv2_-bYTaRzpy04oHULShYFlB3WPveWPoY
state                 | DONE
error_string          | [NULL]
object_id             | 16456
user_id               | 16445
session_id            | 16413
object_name           | premdb
user_name             | yb100
client_hostname       | localhost
client_username       | brumsby
start_time            | 2018-12-10 17:56:41-08
last_activity_time    | 2018-12-10 17:56:43-08
transaction_id        | 6145
backup_name           | dec10
directories           | [/home/yb100/yb100_backups]
sent_bytes            | 5028997
sent_bytes_per_second | 2514498.5
nodata                | f
groups_remaining      | 0
total_groups          | 1
-[ RECORD 2 ]---------+-----------------------------------------------------------------
session_key           | AUJCoeuc7kxJI-KkRJfwQ7gKIrYk5vD9q5Cmx7Epz3g_RxIh1IKEGOoZ8EtipQ08
state                 | DONE
error_string          | [NULL]
object_id             | 16384
user_id               | 16445
session_id            | 16413
object_name           | premdb
user_name             | yb100
client_hostname       | localhost
client_username       | brumsby
start_time            | 2018-12-10 17:32:17-08
last_activity_time    | 2018-12-10 17:32:24-08
transaction_id        | 3688
backup_name           | dec10
directories           | [/home/yb100/yb100_backups]
sent_bytes            | 112814
sent_bytes_per_second | 16116.2857142857
nodata                | f
groups_remaining      | 0
total_groups          | 5

The following queries track the progress of a single backup operation.

premdb=# select * from sys.backup;
(0 rows)

premdb=# \watch 3
(0 rows)

Watch every 3s	Wed Dec  2 16:31:32 2018

-[ RECORD 1 ]---------+-----------------------------------------------------------------
session_key           | B2QQzmMmFBqMDnLhda1Ds14flpztGp38ib6uyTDYBxpSqFkNeUrIDRwJ5TaC_Mld
state                 | RUNNING
error_string          | [NULL]
object_id             | 16423
user_id               | 16434
session_id            | 16772
object_name           | premdb
user_name             | bobr
client_hostname       | localhost
client_username       | yb100
start_time            | 2018-12-02 16:31:29-07
last_activity_time    | 2018-12-02 16:31:31-07
transaction_id        | 46230
backup_name           | dec2018
directories           | [/home/ybdata/premdb_backups]
sent_bytes            | 0
sent_bytes_per_second | 0
nodata                | f
groups_remaining      | 9
total_groups          | 9
...
-[ RECORD 1 ]---------+-----------------------------------------------------------------
session_key           | B2QQzmMmFBqMDnLhda1Ds14flpztGp38ib6uyTDYBxpSqFkNeUrIDRwJ5TaC_Mld
state                 | DONE
error_string          | [NULL]
object_id             | 16423
user_id               | 16434
session_id            | 16772
object_name           | premdb
user_name             | bobr
client_hostname       | localhost
client_username       | yb100
start_time            | 2018-12-02 16:31:29-07
last_activity_time    | 2018-12-02 16:31:38-07
transaction_id        | 46230
backup_name           | dec2018
directories           | [/home/ybdata/premdb_backups]
sent_bytes            | 154559519
sent_bytes_per_second | 17173279.8888889
nodata                | f
groups_remaining      | 0
total_groups          | 9
...

Parent topic:System Views