sys.backup_chain
This system view returns a list of all backup chains in the current database.
Column Name | Data Type | Description |
---|---|---|
database_id | bigint | The unique ID for the database. |
chain_name | text | Name of the backup chain. This view contains records for backup chains
associated with database replicas and/or defined with ybbackup
operations. In the replication case, the default chain name is the same as the
replica name. For backups, the chain name is as specified in the
ybbackup command. |
policy | text | Not currently in use; returns {} . |
oldest_backup_point_id | text | Unique ID for the oldest backup point for this database. |
oldest_rollback_point_id | text | Unique ID for the oldest backup point that this database can be rolled back to with the ROLLBACK DATABASE command. |
inprogress_backup_point_id | text | Unique ID for a backup that is in progress, if any. |
creation_time | timestamptz | When the backup chain was created. |
For example, here is an example from a system running regular
backups:
premdb=# select * from sys.backup_chain;
database_id | chain_name | policy | oldest_backup_point_id | oldest_rollback_point_id | created_time
-------------+--------------+--------+------------------------+--------------------------+-------------------------------
16391 | December2019 | {} | Dec17Full | [NULL] | 2019-12-17 18:03:01.511742-08
(1 row)
Here is an example from a system running database replication:
premdb=# select * from sys.backup_chain;
database_id | chain_name | policy | oldest_backup_point_id | oldest_rollback_point_id | created_time
-------------+-----------------------+--------+-----------------------------------------+-----------------------------------------+-------------------------------
16432 | premdb_local_replica1 | {} | premdb_local_replica1_20_01_14_00_50_56 | premdb_local_replica1_20_01_14_00_50_56 | 2020-01-13 16:06:55.880816-08
(1 row)