Appearance
sys.backup_legacy
This system view captures information about active backup (ybbackup
) operations that are run with pre-Version 4.0 legacy tools.
Column Name | Data Type | Description |
---|---|---|
session_key | text | Unique session key generated for the backup operation. |
state | text | Current state of the backup operation, such as RUNNING or DONE . |
error_string | text | Error 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_id | bigint | Unique ID of the database that was backed up. |
user_id | bigint | Unique ID of the database user. |
session_id | bigint | Unique ID of the ybbackup session. |
object_name | text | Name of the database that was backed up, as passed in on the ybbackup command line. |
user_name | text | Name of the database user, as passed in on the ybbackup command line (or set with YBUSER ). |
client_hostname | text | Client host name, if available. |
client_username | text | Operating system user on the client system who is running the backup tool. |
start_time | timestamptz | When the ybbackup command started running. |
last_activity_time | timestamptz | When ybbackup activity was last logged. |
transaction_id | bigint | Unique transaction ID for the backup. |
backup_name | text | Backup name as specified with the ybbackup --name option. |
directories | text | Directory location where the backup is stored. |
sent_bytes | bigint | Number of bytes transferred over the network. |
sent_bytes_per_second | double precision | Number of bytes per second transferred over the network. |
nodata | boolean | Whether this backup was a "nodata" backup (metadata only). |
groups_remaining | bigint | Number 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_groups | bigint | Total 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