After a physical backup is successful, you can validate all backup sets and archive pieces of user tenants in the current backup and archive paths. You can validate all user tenants in the cluster or a single tenant.
Limitations and considerations
This topic only describes how to validate all backup sets and archive pieces in the
DATA_BACKUP_DESTandLOG_ARCHIVE_DESTpaths of the current cluster. If you want to validate a specified backup set or archive piece in the current backup or archive path, see Validate a specified backup set or archive piece.In addition, if you want to validate data in the original backup or archive path after the backup destination or archive destination has been changed, see Validate a specified backup set or archive piece.
Since validation tasks frequently access backup media to read data, they may occupy network resources of backup tasks. We recommend that you execute validation tasks when no backup tasks are being executed and the system load is low.
When you specify the validation level:
For backup sets and archive pieces of versions earlier than V4.6.0, the basic validation is not supported. In other words, file integrity check is not supported.
For backup sets of versions earlier than V4.3.4, the physical validation is not supported. In other words, physical data correctness and logical consistency check are not supported.
Initiate a backup validation for the entire backup path and archive path of user tenants
Log in to the
systenant of the cluster as therootuser.The following example shows how to connect to the database. Please replace the actual environment variables.
obclient -h10.xx.xx.xx -P2883 -uroot@sys#obdemo -p***** -AExecute the following command to initiate a backup validation.
The statement is as follows:
ALTER SYSTEM VALIDATE BACKUP [LEVEL= { 'basic' | 'physical' }] [TENANT = tenant_name];The parameters are described as follows:
LEVEL: an optional parameter that specifies the validation level. The default value isphysical. Valid values:basicandphysical.basicvalidation: only checks the integrity of the file list.physicalvalidation: checks the correctness of physical data and logical consistency.
TENANT: an optional parameter that specifies the user tenant to be validated. If you do not specify this parameter, all user tenants in the cluster are validated.
Here are some examples:
The system tenant initiates a basic validation for all backup sets and archive pieces of all user tenants in the current backup and archive paths.
obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE BACKUP LEVEL = 'basic';The system tenant initiates a physical validation for all backup sets and archive pieces of the
mysqltenantuser tenant in the current backup and archive paths.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE BACKUP LEVEL = 'physical' TENANT = mysqltenant;
After the statement is executed successfully, you can view the status, progress, and execution result of the validation task from the
CDB_OB_BACKUP_VALIDATE_JOBS,CDB_OB_BACKUP_VALIDATE_TASKS,CDB_OB_BACKUP_VALIDATE_JOB_HISTORY, andCDB_OB_BACKUP_VALIDATE_TASK_HISTORYviews.For more information about how to view the backup validation progress, see View the backup validation progress.
For more information about how to view the backup validation result, see View the backup validation result.
Initiate a backup validation for the entire backup path and archive path of the current tenant
Log in to the database as the tenant administrator.
Note
The administrator of a MySQL tenant is the
rootuser. The administrator of an Oracle tenant is theSYSuser.The following example shows how to connect to the database. Please replace the actual environment variables.
obclient -h10.xx.xx.xx -P2883 -uroot@mysql001#obdemo -p***** -AExecute the following command to initiate a backup validation.
The statement is as follows:
ALTER SYSTEM VALIDATE BACKUP [LEVEL = { 'basic' | 'physical' }];In the statement,
LEVELis an optional parameter that specifies the validation level. The default value isphysical. Valid values:basicandphysical.basicvalidation: only checks the integrity of the file list.physicalvalidation: checks the correctness of physical data and logical consistency.
The following example shows how to initiate a basic validation for all backup sets and archive pieces of the current tenant in the current backup and archive paths.
obclient> ALTER SYSTEM VALIDATE BACKUP LEVEL = 'basic';After the statement is executed successfully, you can view the status, progress, and execution result of the validation task from the
DBA_OB_BACKUP_VALIDATE_JOBS,DBA_OB_BACKUP_VALIDATE_TASKS,DBA_OB_BACKUP_VALIDATE_JOB_HISTORY, andDBA_OB_BACKUP_VALIDATE_TASK_HISTORYviews.For more information about how to view the backup validation progress, see View the backup validation progress.
For more information about how to view the backup validation result, see View the backup validation result.
