Appearance
sys.log_restore
This view records the history of restore (ybrestore
) operations.
Column Name | Data Type | Description |
---|---|---|
session_key | text | Unique session key generated for the restore operation. |
session_id | bigint | Unique ID of the ybrestore session. |
client_hostname | text | Client host name, if available. |
client_username | text | Operating system user on the client system who is running the restore tool. |
user_name | text | Name of the database user, as passed in on the ybrestore command line (or set with YBUSER ). |
user_id | bigint | Unique ID of the database user. |
database_name | text | Name of the restored database. |
database_id | bigint | Unique ID of the restored database. |
state | text | Current state of the restore operation, such as USER_DATA_RUNNING or DONE . |
error_string | text | Error 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_time | timestamptz | When the ybrestore command started running. |
end_time | timestamptz | When the ybrestore command completed. |
elapsed_ms | bigint | Time spent running the restore (in milliseconds). |
remaining_ms | bigint | Time remaining to complete the restore (in milliseconds). |
received_bytes | bigint | Number of bytes transferred over the network. |
received_bytes_per_sec | double precision | Number of bytes per second transferred over the network. |
storage_bytes | bigint | Number of bytes stored in the target location. |
storage_bytes_per_sec | double precision | Number of bytes per second being stored in the target location. |
backup_point_id | text | Backup name as specified with the ybbackup --name option. |
chain_id | text | Name of the backup chain. |
source_database_name | text | Name 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_name | text | Name of the appliance or data warehouse instance where the database was backed up. |
table_name | text | Name 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