Appearance
DROP BACKUP CHAIN
Drop a backup chain. Optionally, also drop its backup snapshots.
DROP BACKUP CHAIN 'chain_name' [ CASCADE ]
Use the CASCADE
option to drop the snapshots that belong to the specified backup chain. Typically, you should run the command with this option.
Run this command when you plan on no longer using a specific backup chain to take backups. When you drop a backup chain, the system reclaims space previously taken up by delete information that was pending the next backup. When a backup chain has been dropped, it can no longer be used for incremental or cumulative backups. Backups of the same database using other chains are not affected and can continue.
Run the command from the database that owns the chain. Chains are database-specific.
Although the ybbackupctl
client tool provides a command to delete physical backups, this command does not connect to the database and does not drop the referenced backup chain.
For example, the August2020
backup chain for database premdb
has the following snapshots:
premdb=# select * from sys.backup_snapshot;
database_id | backup_txid | backup_txsnap | snapshot_name | creation_time
-------------+-------------+------------------+------------------------------------------------+-------------------------------
16395 | 175440 | 0:175440:175440: | Aug21Full | 2020-08-21 13:20:37.795147-07
16395 | 177767 | 0:177767:177767: | Aug21Incr | 2020-08-21 13:22:09.254674-07
16395 | 177989 | 0:177989:177989: | Aug21IncrNew | 2020-08-21 13:24:38.32832-07
16395 | 175439 | 0:3:3: | ybd_cf861c56-0cf7-19a8-f459-3382036212c8_epoch | 2020-08-21 13:20:37.781983-07
(4 rows)
The following command drops the chain and all the associated snapshots:
premdb=# drop backup chain 'August2020' cascade;
DROP BACKUP CHAIN
premdb=# select * from sys.backup_chain;
database_id | chain_name | policy | oldest_backup_point_id | oldest_rollback_point_id | inprogress_backup_point_id | creation_time
-------------+------------+--------+------------------------+--------------------------+----------------------------+---------------
(0 rows)
premdb=# select * from sys.backup_snapshot;
database_id | backup_txid | backup_txsnap | snapshot_name | creation_time
-------------+-------------+---------------+---------------+---------------
(0 rows)