Purpose
The ALTER SYSTEM VALIDATE statement is used to perform physical backup verification.
Limitations and considerations
For V4.4.2, the
ALTER SYSTEM VALIDATEstatement is supported starting from V4.4.2 BP2.Since verification tasks frequently access backup media to read data, thereby competing for network resources with backup tasks, it is recommended to run verification tasks when no user tenant is performing a backup task and the system load is low.
When specifying the verification level for backup verification:
For version V4.4.2, backup sets and log archive pieces prior to V4.4.2 BP2 (excluding V4.4.2 BP2) do not support basic verification, meaning file integrity verification is not supported.
Backup sets earlier than V4.3.4 do not support physical verification, meaning correctness and logical consistency checks for physical data are not supported.
Privilege requirements
This statement must be executed by the root user of the sys tenant (root@sys).
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 | Verify all backup sets and log archive pieces under the entire backup path and archive path in user tenants within the current cluster. Specifying a verification path is not supported.DATA_BACKUP_DESTorLOG_ARCHIVE_DEST), meaning it does not support cross-cluster or cold standby scenarios. |
| BACKUPSET | Verify the specified backup set. If the backup set is not specified,backup_set_id, it verifies all backup sets under the current backup path.
NoticeIf you do not specify |
| ARCHIVELOG_PIECE | Verify the specified log archive piece. If the archive piece is not specified,piece_id, then verify all log archive pieces in the current archive path.
NoteIf you do not specify |
| DATA_BACKUP_DEST | Optional. Specifies the backup path of the data to be verified. If this parameter is not specified, the backup path configured for the current tenant backup is verified by default.
NoticeOceanBase Database does not support specifying multiple paths in a single command. Therefore, when verifying an incremental backup set under a specified path by specifying the |
| LOG_ARCHIVE_DEST | Optional. Specifies the log archive path to be verified. If this parameter is not specified, the system will verify the archive path configured for the current tenant by default. |
| LEVEL | Specifies the verification level. Valid values:
If this parameter is not specified, the default value is |
| TENANT | Specifies the user tenant for which the verification task is to be executed. Valid values:
|
Examples
Verify all backup sets and log archive pieces under the entire backup path and archive path
The system tenant performs a basic verification on all backup sets and archive pieces under the current backup and archive paths for all user tenants in the cluster.
obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE BACKUP LEVEL = 'basic';The system tenant initiates a physical verification for all backup sets and archive pieces under the current backup and archive paths of the specified user tenant
mysqltenant.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE BACKUP LEVEL = 'physical' TENANT = mysqltenant;
Verify a specified backup set or log archive piece
Verify the backup set
The system tenant initiates a basic verification for all backup sets under the current backup path of all user tenants.
obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE BACKUPSET LEVEL = 'basic';The system tenant initiates a basic verification for all backup sets of user tenant
mysqltenantunder the current backup path.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE BACKUPSET LEVEL = 'basic' TENANT = mysqltenant;The system tenant initiates a physical verification for the backup sets with
backup_set_id1 and 2 of user tenantmysqltenantunder the current backup path.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE BACKUPSET = '1,2' LEVEL = 'physical' TENANT = mysqltenant;The system tenant initiates a physical verification for backup sets with
backup_set_id1 and 2 under the current backup path for all user tenants.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE BACKUPSET = '1,2' LEVEL = 'physical';
Verify log archive pieces
The system tenant initiates a basic verification for all archived pieces under the current archive path of all user tenants.
obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE ARCHIVELOG_PIECE LEVEL = 'basic';The system tenant initiates a basic verification for all archive pieces of the user tenant
mysqltenantunder the current archive path.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE ARCHIVELOG_PIECE LEVEL = 'basic' TENANT = mysqltenant;The system tenant initiates a physical verification for the log archive pieces with
piece_id1 and 2 of user tenantmysqltenantunder the current archive path.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE ARCHIVELOG_PIECE = '1,2' LEVEL = 'physical' TENANT = mysqltenant;The system tenant initiates a physical verification for archive pieces with
piece_id1 and 2 under the current archive path for all user tenants.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE ARCHIVELOG_PIECE = '1,2' LEVEL = 'physical';
Verify backup sets or log archive pieces in a specified path
Verify the backup set
The system tenant initiates a basic verification for all backup sets under the specified backup path of the user tenant
mysqltenant.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 verification for the backup sets with
backup_set_id1 and 2 of the specified user tenantmysqltenantunder the specified backup path.obclient(root@sys)[(none)]> ALTER SYSTEM VALIDATE BACKUPSET = '1,2' DATA_BACKUP_DEST = 'file:///data/nfs/backup/data' LEVEL = 'physical' TENANT = mysqltenant;
Verify log archive pieces
The system tenant initiates a basic verification for all archived 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 initiates a physical verification for the archive pieces with
piece_id1 and 2 under 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;
