Purpose
The ALTER SYSTEM VALIDATE statement is used to perform physical backup validation.
Limitations and considerations
Since validation tasks frequently access backup media to read data, which may compete with backup tasks for network resources, it is recommended to execute validation tasks when no backup tasks are running and the system is under low load.
When specifying the validation level for backup validation:
For backup sets and log archive pieces from versions earlier than V4.6.0, basic validation (file integrity check) is not supported.
For backup sets from versions earlier than V4.3.4, physical validation (data correctness and logical consistency check) is not supported.
Privilege requirements
The root user of the sys tenant (root@sys) must execute this statement.
Syntax
ALTER SYSTEM VALIDATE { BACKUP | BACKUPSET [= 'backup_set_id_list'] | ARCHIVELOG_PIECE [= 'piece_id_list'] }
[ DATA_BACKUP_DEST = 'data_backup_path' ]
[ LOG_ARCHIVE_DEST = 'log_archive_path' ]
[ LEVEL = { 'basic' | 'physical' } ]
[ TENANT = tenant_name ];
backup_set_id_list:
backup_set_id[,backup_set_id,...]
piece_id_list:
piece_id[,piece_id,...]
Parameters
| Parameter | Description |
|---|---|
| BACKUP | Validates all backup sets and log archive pieces under the entire backup path and archive path of the user tenant in the current cluster. It does not support specifying a validation path (DATA_BACKUP_DEST or LOG_ARCHIVE_DEST), i.e., it does not support cross-cluster or cold backup data scenarios. |
| BACKUPSET | Validates the specified backup set. If the backup_set_id of the backup set is not specified, all backup sets under the current backup path are validated.
NoticeIf the |
| ARCHIVELOG_PIECE | Validates the specified log archive piece. If the piece_id of the log archive piece is not specified, all log archive pieces under the current archive path are validated.
NoticeIf the |
| DATA_BACKUP_DEST | Optional. Specifies the data backup path to be validated. If this parameter is not specified, the system will validate all backup sets under the current backup path.
NoticeOceanBase Database does not support specifying multiple paths in a single command. Therefore, when specifying a path to validate an incremental backup set by using the |
| LOG_ARCHIVE_DEST | Optional. Specifies the log archive path to be validated. If this parameter is not specified, the system will validate all log archive pieces under the current archive path. |
| LEVEL | Optional. Specifies the validation level. Valid values:
If this parameter is not specified, the default value is |
| TENANT | Optional. Specifies the user tenant to be validated.
|
Examples
Validate all backup sets and archive pieces in the entire backup and archive path
The system tenant initiates a basic validation for all user tenants in the current backup and archive path.
obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE BACKUP LEVEL = 'basic';The system tenant initiates a physical validation for the specified user tenant
mysqltenantin the current backup and archive path.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE BACKUP LEVEL = 'physical' TENANT = mysqltenant;
Validate a specified backup set or archive piece
Validate a backup set
The system tenant initiates a basic validation for all user tenants in the current backup path.
obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE BACKUPSET LEVEL = 'basic';The system tenant initiates a basic validation for the user tenant
mysqltenantin the current backup path.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE BACKUPSET LEVEL = 'basic' TENANT = mysqltenant;The system tenant initiates a physical validation for the user tenant
mysqltenantin the current backup path for backup sets withbackup_set_idvalues of 1 and 2.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE BACKUPSET = '1,2' LEVEL = 'physical' TENANT = mysqltenant;The system tenant initiates a physical validation for all user tenants in the current backup path for backup sets with
backup_set_idvalues of 1 and 2.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE BACKUPSET = '1,2' LEVEL = 'physical';
Validate an archive piece
The system tenant initiates a basic validation for all user tenants in the current archive path.
obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE ARCHIVELOG_PIECE LEVEL = 'basic';The system tenant initiates a basic validation for the user tenant
mysqltenantin the current archive path.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE ARCHIVELOG_PIECE LEVEL = 'basic' TENANT = mysqltenant;The system tenant initiates a physical validation for the user tenant
mysqltenantin the current archive path for archive pieces withpiece_idvalues of 1 and 2.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE ARCHIVELOG_PIECE = '1,2' LEVEL = 'physical' TENANT = mysqltenant;The system tenant initiates a physical validation for all user tenants in the current archive path for archive pieces with
piece_idvalues of 1 and 2.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE ARCHIVELOG_PIECE = '1,2' LEVEL = 'physical';
Validate a specified backup set or archive piece in a specified path
Validate a backup set
The system tenant initiates a basic validation for the user tenant
mysqltenantin the specified backup path.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE BACKUPSET DATA_BACKUP_DEST = 'file:///data/nfs/backup/data' LEVEL = 'basic' TENANT = mysqltenant;The system tenant initiates a physical validation for the user tenant
mysqltenantin the specified backup path for backup sets withbackup_set_idvalues of 1 and 2.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE BACKUPSET = '1,2' DATA_BACKUP_DEST = 'file:///data/nfs/backup/data' LEVEL = 'physical' TENANT = mysqltenant;
Validate an archive piece
The system tenant initiates a basic validation for all user tenants 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 initiates a physical validation for all user tenants in the specified archive path for archive pieces with
piece_idvalues of 1 and 2.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE ARCHIVELOG_PIECE = '1,2' LOG_ARCHIVE_DEST = 'file:///data/nfs/backup/archive' LEVEL = 'physical' TENANT = tenant1;
