Purpose
You can use this statement to verify the backup or secondary backup of data or logs.
Note
This statement can be executed only in the sys tenant.
Syntax
Verify backup data in a cluster
Verify all backup sets and the corresponding logs in the current cluster
ALTER SYSTEM VALIDATE DATABASE;Verify a specified backup set in the current cluster
ALTER SYSTEM VALIDATE BACKUPSET backup_set_id;Verify specified logs in the current cluster
ALTER SYSTEM VALIDATE BACKUPPIECE backup_piece_id;Note
The syntax with the
VALIDATE BACKUPPIECEkeyword applies only to scenarios where logs are split into pieces.
Verify backup data in a specified path in a cluster
Verify all backup data or secondary backup data backed up from the specified path in the cluster
ALTER SYSTEM VALIDATE DATABASE backup_dest='backup_url';Verify the backup sets or the secondary backup sets backed up from the specified path in the cluster
ALTER SYSTEM VALIDATE BACKUPSET backup_set_id backup_dest ='backup_url';Verify the log backups and secondary log backups backed up from the specified path in the cluster
ALTER SYSTEM VALIDATE BACKUPPIECE backup_piece_id backup_dest ='backup_url';Note
The syntax with the
VALIDATE BACKUPPIECEkeyword applies only to scenarios where logs are split into pieces.
Verify backup data in a specified path across clusters
Verify all backup data or all secondary backup data
ALTER SYSTEM VALIDATE DATABASE backup_dest ='backup_url' WITH 'backup_cluster_name=cluster_name&backup_cluster_id=cluster_id';Verify a specified backup set or secondary backup set
ALTER SYSTEM VALIDATE BACKUPSET backup_set_id backup_dest ='backup_url' WITH 'backup_cluster_name=cluster_name&backup_cluster_id=cluster_id';Verify a specified log backup of a backup or secondary backup
ALTER SYSTEM VALIDATE BACKUPPIECE backup_piece_id backup_dest = 'backup_url' WITH 'backup_cluster_name=cluster_name&backup_cluster_id=cluster_id';Note
The syntax with the
VALIDATE BACKUPPIECEkeyword applies only to scenarios where logs are split into pieces.
Parameters
| Parameter | Description |
|---|---|
| BACKUPPIECE | Performs secondary backup on log backups. After you initiate log archive, the kernel automatically archives logs generated in a period of time to the path specified by the corresponding system parameter. |
| BACKUPSET | Performs secondary backup on data backups. Secondary backup data is a data backup obtained from a full or incremental data backup. |
| backup_piece_id | The piece ID of the log backup or the piece ID of the secondary log backup. |
| backup_dest | The path where backup data is to be stored. |
| backup_set_id | The backup set ID or secondary backup set ID. |
| backup_cluster_name | The name of the cluster where the backup data is located. You can log on to this cluster and view the cluster name in the oceanbase.v$ob_cluster view. |
| backup_cluster_id | The ID of the cluster where the backup data is located. You can log on to this cluster and view the cluster name in the oceanbase.v$ob_cluster view. |
Examples
Verify the backup data in a cluster
Verify all backup sets and the corresponding logs of the current cluster
ALTER SYSTEM VALIDATE DATABASE;Verify a specified backup set in the current cluster
ALTER SYSTEM VALIDATE BACKUPSET 1;Verify specified logs in the current cluster
ALTER SYSTEM VALIDATE BACKUPPIECE 2;
Verify backup data generated from the specified path in the cluster
Verify all backup data or secondary backup data backed up from the specified path in the cluster
ALTER SYSTEM VALIDATE DATABASE backup_dest = 'file:///data/nfs/physical_backup_dir';Verify the backup sets or the secondary backup sets backed up from the specified path in the cluster
ALTER SYSTEM VALIDATE BACKUPSET 1 backup_dest = 'file:///data/nfs/physical_backup_dir';Verify the log backups and secondary log backups backed up from the specified path in the cluster
ALTER SYSTEM VALIDATE BACKUPPIECE 2 backup_dest = 'file:///data/nfs/physical_backup_dir';
Verify the backup data generated from the specified path in another cluster
Verify all backup data or all secondary backup data
ALTER SYSTEM VALIDATE DATABASE backup_dest = 'file:///data/nfs/physical_backup_dir' with 'backup_cluster_name=obcluster101&backup_cluster_id=101';Verify a specified backup set or secondary backup set
ALTER SYSTEM VALIDATE BACKUPSET 1 backup_dest = 'file:///data/nfs/physical_backup_dir' WITH 'backup_cluster_name=obcluster101&backup_cluster_id=101';Verify a specified log backup of a backup or secondary backup
ALTER SYSTEM VALIDATE BACKUPPIECE 2 backup_dest = 'file:///data/nfs/physical_backup_dir' WITH 'backup_cluster_name=obcluster101&backup_cluster_id=101';