OceanBase Database supports validating backup sets or log archive pieces in a specified path. This method is suitable for validating cross-cluster backup data or cold backup data.
Limitations and considerations
Since validation tasks frequently access backup media to read data, thereby competing for network resources of backup tasks, it is recommended to execute validation tasks when user tenants are not running backup tasks and the system load is low.
When specifying the backup validation level:
For V4.4.2, backup sets and log archive pieces from versions earlier than V4.4.2 BP2 (excluding V4.4.2 BP2) do not support Basic validation, meaning file integrity validation is not supported.
For backup sets from versions earlier than V4.3.4 (excluding V4.3.4), Physical validation is not supported, meaning validation of physical data correctness and logical consistency is not supported.
When the specified backup set to be validated contains incremental backup sets, at the Physical validation level, the specified path must include the full backup set on which the incremental backup set depends; otherwise, validation fails.
Validate backup sets in a specified path
Initiate backup validation for backup sets in a specified path of a user tenant from the system tenant (sys tenant)
Log in to the cluster as the
rootuser of the system tenant (systenant).The following is a sample connection command. Use the actual environment parameters when connecting to the database.
obclient -h10.xx.xx.xx -P2883 -uroot@sys#obdemo -p***** -AExecute the following command to initiate validation for backup sets in a specified path of the user tenant.
The statement is as follows:
ALTER SYSTEM VALIDATE BACKUPSET [= 'backup_set_id[,backup_set_id,...]'] DATA_BACKUP_DEST = 'data_backup_path' [LEVEL = { 'basic' | 'physical' }] TENANT = tenant_name;The parameters in the statement are described as follows:
BACKUPSET: Specifies the backup set to be validated. You can validate all backup sets in a specified backup path of the tenant or a list of specified backup sets. When specifying a list of backup sets, separate thebackup_set_idvalues with commas. If thebackup_set_idof a backup set is not specified, all backup sets in the specified backup path of the tenant are validated by default.In cross-cluster or cold backup scenarios, you can obtain the
backup_set_idfrom the file name in the backup directory. For more information about the backup directory structure, see Data backup directory in Physical backup and restore.Note
If you do not specify
backup_set_id, the system will obtain all backup sets under the currently configured backup path for validation, which will result in a large number of validation tasks and take a long time. If you are sure you do not need to validate all backup sets, it is recommended to specifybackup_set_idin the validation command.DATA_BACKUP_DEST: Specifies the storage path of the backup set.Note
OceanBase Database does not currently support specifying multiple paths in a single command. Therefore, when validating incremental backup sets in a specified path by specifying
backup_set_id, an error with code 9159 may be returned because information about other backup sets on which the incremental backup set depends cannot be read.LEVEL: Optional. Specifies the validation level. If not specified, the default value isphysical. Valid values:basic: Verifies only the integrity of the file list.physical: Verifies the correctness of physical data and logical consistency.
TENANT: Specifies the user tenant to validate.
Examples:
The system tenant (
systenant) initiates Basic validation for all backup sets in the specified backup path of user tenantmysqltenant.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE BACKUPSET DATA_BACKUP_DEST = 'file:///data/nfs/backup/data' LEVEL = 'basic' TENANT = mysqltenant;The system tenant (
systenant) initiates Physical validation for backup sets withbackup_set_id1 and 2 in the specified backup path of user tenantmysqltenant.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE BACKUPSET = '1,2' DATA_BACKUP_DEST = 'file:///data/nfs/backup/data' LEVEL = 'physical' TENANT = mysqltenant;
After the statement is executed successfully, you can view the status, progress, and execution results of the validation task through the
CDB_OB_BACKUP_VALIDATE_JOBS,CDB_OB_BACKUP_VALIDATE_TASKS,CDB_OB_BACKUP_VALIDATE_JOB_HISTORY, andCDB_OB_BACKUP_VALIDATE_TASK_HISTORYviews.For detailed operations and information on viewing backup validation progress, see View backup validation progress.
For detailed operations and information on viewing backup validation results, see View backup validation results.
User tenant initiates backup validation for backup sets in a specified path of the current tenant
Log in to the database as the administrator of the user tenant.
Note
For a MySQL-compatible tenant, the administrator user is the
rootuser. For an Oracle tenant, it is theSYSuser.The following is a sample connection command. Use the actual environment parameters when connecting to the database.
obclient -h10.xx.xx.xx -P2883 -uroot@mysql001#obdemo -p***** -AExecute the following command to initiate validation for backup sets in a specified path.
The statement is as follows:
ALTER SYSTEM VALIDATE BACKUPSET [= 'backup_set_id[,backup_set_id,...]'] DATA_BACKUP_DEST = 'data_backup_path' [LEVEL = { 'basic' | 'physical' }];The relevant parameters in the statement are described as follows:
BACKUPSET: Specifies the backup set to be validated. You can validate all backup sets in a specified backup path of the tenant or a specified list of backup sets. When specifying a list of backup sets, separate multiplebackup_set_idvalues with commas. If thebackup_set_idof a backup set is not specified, all backup sets in the specified backup path of the tenant are validated by default.In cross-cluster or cold backup scenarios, you can obtain the
backup_set_idfrom the file name in the backup directory. For more information about the backup directory structure, see Data backup directory in Physical backup and restore.Note
If you do not specify
backup_set_id, the system will obtain all backup sets under the currently configured backup path for validation, which will result in a large number of validation tasks and take a long time. If you are sure you do not need to validate all backup sets, it is recommended to specifybackup_set_idin the validation command.DATA_BACKUP_DEST: Specifies the storage path of the backup set.Notice
OceanBase Database does not currently support specifying multiple paths in a single command. Therefore, when validating incremental backup sets in a specified path by specifying
backup_set_id, an error with code 9159 may be returned because information about other backup sets on which the incremental backup set depends cannot be read.LEVEL: Optional. Specifies the validation level. If not specified, the default value isphysical. Valid values:basic: Verifies only the integrity of the file list.physical: Verifies the correctness of physical data and logical consistency.
Examples:
The user tenant initiates Basic validation for all backup sets in the specified backup path of the current tenant.
obclient> ALTER SYSTEM VALIDATE BACKUPSET DATA_BACKUP_DEST = 'file:///data/nfs/backup/data' LEVEL = 'basic';The user tenant initiates Physical validation for backup sets with
backup_set_id1 and 2 in the specified backup path of the current tenant.obclient> ALTER SYSTEM VALIDATE BACKUPSET = '1,2' DATA_BACKUP_DEST = 'file:///data/nfs/backup/data' LEVEL = 'physical';
After the statement is executed successfully, you can view the status, progress, and execution results of the validation tasks through views such as
DBA_OB_BACKUP_VALIDATE_JOBS,DBA_OB_BACKUP_VALIDATE_TASKS,DBA_OB_BACKUP_VALIDATE_JOB_HISTORY, andDBA_OB_BACKUP_VALIDATE_TASK_HISTORY.For detailed operations and information on viewing backup validation progress, see View backup validation progress.
For detailed operations and information on viewing backup validation results, see View backup validation results.
Validate log archive pieces in a specified path
Initiate backup validation for log archive pieces in a specified path of a user tenant from the system tenant (sys tenant)
Log in to the cluster as the
rootuser of the system tenant (systenant).The following is a sample connection command. Use the actual environment parameters when connecting to the database.
obclient -h10.xx.xx.xx -P2883 -uroot@sys#obdemo -p***** -AExecute the following command to initiate validation for log archive pieces in a specified path of the user tenant.
The statement is as follows:
ALTER SYSTEM VALIDATE ARCHIVELOG_PIECE [= 'piece_id[,piece_id,...]'] LOG_ARCHIVE_DEST = 'log_archive_path' [LEVEL = { 'basic' | 'physical' }] TENANT = tenant_name;The relevant parameters in the statement are described as follows:
ARCHIVELOG_PIECE: Specifies the log archive piece to be validated. You can validate all archive pieces in a specified archive path of the tenant or a specified list of archive pieces. When specifying a list of archive pieces, separate multiplepiece_idvalues with commas. If nopiece_idis specified, all log archive pieces in the specified archive path of the tenant are validated by default.In cross-cluster or cold backup scenarios, you can obtain the
piece_idof a log archive piece from the file name in the archive directory. For more information about the archive directory structure, see Log archive directory in Physical backup and restore.Note
If you do not specify
piece_id, the system will obtain all archive pieces in the specified archive path for validation, which will result in a large number of validation tasks and take a long time. If you are sure you do not need to validate all archive pieces, it is recommended to specifypiece_idin the validation command.LOG_ARCHIVE_DEST: Specifies the storage path of the log archive piece.LEVEL: Optional. Specifies the validation level. If not specified, the default value isphysical. Valid values:basic: Verifies only the integrity of the file list.physical: Verifies the correctness of physical data and logical consistency.
TENANT: Specifies the user tenant to validate.
Examples:
The system tenant (
systenant) initiates Basic validation for all archive pieces in the specified archive path.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE ARCHIVELOG_PIECE LOG_ARCHIVE_DEST = 'file:///data/nfs/backup/archive' LEVEL = 'basic' TENANT = tenant1;The system tenant (
systenant) initiates Physical validation for log archive pieces withpiece_id1 and 2 in the specified archive path.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE ARCHIVELOG_PIECE = '1,2' LOG_ARCHIVE_DEST = 'file:///data/nfs/backup/archive' LEVEL = 'physical' TENANT = tenant1;
After the statement is executed successfully, you can view the status, progress, and execution results of the validation task through the
CDB_OB_BACKUP_VALIDATE_JOBS,CDB_OB_BACKUP_VALIDATE_TASKS,CDB_OB_BACKUP_VALIDATE_JOB_HISTORY, andCDB_OB_BACKUP_VALIDATE_TASK_HISTORYviews.For detailed operations and information on viewing backup validation progress, see View backup validation progress.
For detailed operations and information on viewing backup validation results, see View backup validation results.
User tenant initiates backup validation for log archive pieces in a specified path of the current tenant
Log in to the database as the administrator of the user tenant.
Note
For a MySQL-compatible tenant, the administrator user is the
rootuser. For an Oracle tenant, it is theSYSuser.The following is a sample connection command. Use the actual environment parameters when connecting to the database.
obclient -h10.xx.xx.xx -P2883 -uroot@mysql001#obdemo -p***** -AExecute the following command to initiate validation for log archive pieces in a specified path.
The statement is as follows:
ALTER SYSTEM VALIDATE ARCHIVELOG_PIECE [= 'piece_id[,piece_id,...]'] LOG_ARCHIVE_DEST = 'log_archive_path' [LEVEL = { 'basic' | 'physical' }];The relevant parameters in the statement are described as follows:
ARCHIVELOG_PIECE: Specifies the log archive piece to be validated. You can validate all archive pieces under the current archive path of the tenant or a specified list of archive pieces. When specifying a list of archive pieces, separate multiplepiece_idvalues with commas. If nopiece_idis specified, all log archive pieces under the current archive path of the tenant are validated by default.In cross-cluster or cold backup scenarios, you can obtain the
piece_idof a log archive piece from the file name in the archive directory. For more information about the archive directory structure, see Log archive directory in Physical backup and restore.Note
If you do not specify
piece_id, the system will obtain all archive pieces in the specified archive path for validation, which will result in a large number of validation tasks and take a long time. If you are sure you do not need to validate all archive pieces, it is recommended to specifypiece_idin the validation command.LOG_ARCHIVE_DEST: Specifies the storage path of the log archive piece.LEVEL: Optional. Specifies the validation level. If not specified, the default value isphysical. Valid values:basic: Verifies only the integrity of the file list.physical: Verifies the correctness of physical data and logical consistency.
Examples:
The user tenant initiates Basic validation for all archive pieces in the specified archive path of the current tenant.
obclient> ALTER SYSTEM VALIDATE ARCHIVELOG_PIECE LOG_ARCHIVE_DEST = 'file:///data/nfs/backup/archive' LEVEL = 'basic';The user tenant initiates Physical validation for log archive pieces with
piece_id1 and 2 in the specified archive path of the current tenant.obclient> ALTER SYSTEM VALIDATE ARCHIVELOG_PIECE = '1,2' LOG_ARCHIVE_DEST = 'file:///data/nfs/backup/archive' LEVEL = 'physical';
After the statement is executed successfully, you can view the status, progress, and execution results of the validation task through the
DBA_OB_BACKUP_VALIDATE_JOBS,DBA_OB_BACKUP_VALIDATE_TASKS,DBA_OB_BACKUP_VALIDATE_JOB_HISTORY, andDBA_OB_BACKUP_VALIDATE_TASK_HISTORYviews.For detailed operations and information on viewing backup validation progress, see View backup validation progress.
For detailed operations and information on viewing backup validation results, see View backup validation results.
