Skip to content

sys.restore_legacy

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

Column NameData TypeDescription
session_keytextUnique session key generated for the restore operation.
statetextCurrent state of the restore operation, such as RUNNING or DONE.
error_stringtextError message reported for a failed restore.
object_idbigintUnique ID of the database that was restored.
user_idbigintUnique ID of the database user.
session_idbigintUnique ID of the ybrestore session.
object_nametextName of the restored database (this may be an alias that was specified in the ybrestore command).
user_nametextName of the database user, as passed in on the ybrestore command line (or set with YBUSER).
client_hostnametextClient host name, if available.
client_usernametextOperating system user on the client system who is running the restore tool.
start_timetimestamptzWhen the ybrestore command started running.
last_activity_timetimestamptzWhen ybrestore activity was last logged.
transaction_idbigintUnique transaction ID for the restore.
backup_nametextName of the restored backup (as specified with --name in the ybbackup command).
directoriestextDirectory location where the backup is stored for this restore operation.
sent_bytesbigintNumber of bytes transferred over the network.
sent_bytes_per_seconddouble precisionNumber of bytes per second transferred over the network.
nodatabooleanWhether this restore was from a "nodata" backup (metadata only).
tables_completedbigintNumber of tables completely restored.
total_tablesbigintTotal number of tables to be restored.

Example

The following query reports the progress of a single restore operation.

premdb=# select * from sys.restore where start_time > '2018-12-04 13:25:00-07';
(0 rows)

premdb=# \watch 3
(0 rows)
...
Watch every 3s	Fri Dec  4 13:29:05 2018

-[ RECORD 1 ]---------+-----------------------------------------------------------------
session_key           | Cy8_loaiYoBkniu8T8kp2bIeDytL56RedlPioDCpCXMl8-BU363zB6cTnAbY4nv2
state                 | RUNNING
error_string          | [NULL]
object_id             | 16481
user_id               | 16399
session_id            | 16470
object_name           | newpremdb
user_name             | bobr
client_hostname       | localhost
client_username       | brumsby
start_time            | 2018-12-04 13:29:04-07
last_activity_time    | 2018-12-04 13:29:05-07
transaction_id        | 6688
backup_name           | dec04
directories           | [/home/brumsby/premdb_backups]
sent_bytes            | 2305
sent_bytes_per_second | 2305
nodata                | f
tables_completed      | 2
total_tables          | 6

...

Watch every 3s	Fri Dec  4 13:29:08 2018

-[ RECORD 1 ]---------+-----------------------------------------------------------------
session_key           | Cy8_loaiYoBkniu8T8kp2bIeDytL56RedlPioDCpCXMl8-BU363zB6cTnAbY4nv2
state                 | RUNNING
error_string          | [NULL]
object_id             | 16481
user_id               | 16399
session_id            | 16470
object_name           | newpremdb
user_name             | bobr
client_hostname       | localhost
client_username       | brumsby
start_time            | 2018-12-04 13:29:04-07
last_activity_time    | 2018-12-04 13:29:07-07
transaction_id        | 6688
backup_name           | dec04
directories           | [/home/brumsby/premdb_backups]
sent_bytes            | 267766
sent_bytes_per_second | 89255.3333333333
nodata                | f
tables_completed      | 5
total_tables          | 6

...

Watch every 3s	Fri Dec  4 13:29:53 2018

-[ RECORD 1 ]---------+-----------------------------------------------------------------
session_key           | Cy8_loaiYoBkniu8T8kp2bIeDytL56RedlPioDCpCXMl8-BU363zB6cTnAbY4nv2
state                 | DONE
error_string          | [NULL]
object_id             | 16481
user_id               | 16399
session_id            | 16470
object_name           | newpremdb
user_name             | bobr
client_hostname       | localhost
client_username       | brumsby
start_time            | 2018-12-04 13:29:04-07
last_activity_time    | 2018-12-04 13:29:35-07
transaction_id        | 6688
backup_name           | dec04
directories           | [/home/brumsby/premdb_backups]
sent_bytes            | 1246826127
sent_bytes_per_second | 40220197.6451613
nodata                | f
tables_completed      | 6
total_tables          | 6

Parent topic:System Views