Skip to content

sys.log_restore

This view records the history of restore (ybrestore) operations.

Column NameData TypeDescription
session_keytextUnique session key generated for the restore operation.

session_idbigintUnique ID of the ybrestore session.
client_hostnametextClient host name, if available.
client_usernametextOperating system user on the client system who is running the restore tool.
user_nametextName of the database user, as passed in on the ybrestore command line (or set with YBUSER).
user_idbigintUnique ID of the database user.
database_nametextName of the restored database.
database_idbigintUnique ID of the restored database.
statetextCurrent state of the restore operation, such as USER_DATA_RUNNING or DONE.
error_stringtextError message reported for a failed restore. For example, if a restore is canceled before it completes, the view may report an External data socket error.
start_timetimestamptzWhen the ybrestore command started running.
end_timetimestamptzWhen the ybrestore command completed.
elapsed_msbigintTime spent running the restore (in milliseconds).
remaining_msbigintTime remaining to complete the restore (in milliseconds).
received_bytesbigintNumber of bytes transferred over the network.
received_bytes_per_secdouble precisionNumber of bytes per second transferred over the network.
storage_bytesbigintNumber of bytes stored in the target location.
storage_bytes_per_secdouble precisionNumber of bytes per second being stored in the target location.
backup_point_idtextBackup name as specified with the ybbackup --name option.
chain_idtextName of the backup chain.
source_database_nametextName of the source database for the restore (not the restored database name in the case of a database being restored to an alias).
source_appliance_nametextName of the appliance or data warehouse instance where the database was backed up.
table_nametextName of the table. For database-level restores, this column is NULL.

Examples

The following query shows that the database restore operation occurred with premdb_restored as the target database.

sql
yellowbrick=# select * from sys.log_restore where database_name='premdb_restored';
-[ RECORD 1 ]----------+-----------------------------------------------------------------
session_key            | Dcli8wrwpy1WbsvrMNUzH9jPEjRdtLwpg8rBxGRRatRgN8BuOw7e2rMn3UYf7Xvs
session_id             | 54337
client_hostname        | localhost
client_username        | yellowbrick
username               | yellowbrick
user_id                | 16007
database_name          | premdb_restored
database_id            | 40619
state                  | DONE
error_string           | [NULL]
start_time             | 2021-06-22 14:37:56.185-07
end_time               | 2021-06-22 14:38:08.746-07
elapsed_ms             | 12561
remaining_ms           | 0
received_bytes         | 1040150443
received_bytes_per_sec | 82807932.728286
storage_bytes          | 1039832202
storage_bytes_per_sec  | 82782597.0862193
backup_point_id        | June22Full
chain_id               | premdbJune2021
source_database_name   | premdb
source_appliance_name  | localhost
table_name             | [NULL]
-[ RECORD 2 ]----------+-----------------------------------------------------------------
session_key            | CEyf1a9giaaA128eqmYHrdR35eo1mKybN4VliZkEcNhHWsvXf_nHJ2FrS_dUviPe
session_id             | 54449
client_hostname        | localhost
client_username        | yellowbrick
username               | yellowbrick
user_id                | 16007
database_name          | premdb_restored
database_id            | 40646
state                  | DONE
error_string           | [NULL]
start_time             | 2021-06-22 14:42:45.212-07
end_time               | 2021-06-22 14:42:47.389-07
elapsed_ms             | 2177
remaining_ms           | 0
received_bytes         | 62664469
received_bytes_per_sec | 28784781.3504823
storage_bytes          | 62647477
storage_bytes_per_sec  | 28776976.1139182
backup_point_id        | June22Full
chain_id               | premdbJune2021
source_database_name   | premdb
source_appliance_name  | localhost
table_name             | public.match_restored