OceanBase AI Database supports dynamically updating the access_id and access_key information for backup paths or archive paths. After you configure a backup path or archive path, if the key information of the object storage is changed for security or other reasons, you can use this method to update the access_id and access_key for the configured backup path or archive path to ensure the normal execution of backup or archiving.
Limitations
Only the
access_idandaccess_keyinformation of object storage paths can be updated.Only a user tenant can update the key information of the backup path or archive path of the tenant. The
systenant cannot update the key information of the backup path or archive path of a specified user tenant.
Considerations
- During the backup or archiving process, if the key information corresponding to the object storage path is changed, you must promptly update the
access_idandaccess_keyinformation for the backup path or archive path. Otherwise, the backup task may fail to be executed or archiving may be stuck.
Procedure
Log in to the user tenant of the cluster as the tenant administrator of the user tenant.
Note
In MySQL-compatible mode, the administrator user is the
rootuser.The following example shows how to connect to the database. Use the actual environment settings when you connect to the database.
obclient -h10.xx.xx.xx -P2883 -uroot@mysql_tenant#obdemo -p***** -AExecute the following statement to change the key information of the backup path or archive path.
The sample SQL statement is as follows:
ALTER SYSTEM {ALTER|CHANGE|MODIFY} EXTERNAL_STORAGE_DEST PATH [=] 'path' SET ACCESS_INFO = 'access_id=new_access_id&access_key=new_access_key';The parameters in the statement are described as follows:
path: the backup path or archive path for which the key information is to be updated. The path must be a backup path or archive path already configured for the current tenant, and it must be an object storage path. In addition, the path must include thehostinformation.In the case of S3, the path format is as follows:
S3://oceanbase-test-bucket/backup/data?host=***.access_id=new_access_id&access_key=new_access_key: the newaccess_idandaccess_keyafter the update. You must specify bothaccess_idandaccess_key.For example, assume that the backup path and archive path configured for the current user tenant are
S3://oceanbase-test-bucket/backup/data?host=s3.<region>.amazonaws.comandS3://oceanbase-test-bucket/backup/archive?host=s3.<region>.amazonaws.comrespectively, and S3 is used as the backup or archive medium. The key information of the backup path and archive path can be changed as follows:Change the key information of the backup path
obclient> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='S3://oceanbase-test-bucket/backup/data?host=s3.<region>.amazonaws.com' SET ACCESS_INFO = 'access_id=******&access_key=******';Change the key information of the archive path
obclient> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='S3://oceanbase-test-bucket/backup/archive?host=s3.<region>.amazonaws.com' SET ACCESS_INFO = 'access_id=******&access_key=******';
For more examples, see ALTER/CHANGE/MODIFY EXTERNAL_STORAGE_DEST.
After the modification is successful, you can query the
DBA_OB_BACKUP_STORAGE_INFOview to verify the change.Confirm the
access_idandaccess_keyinformation of the backup path.obclient[oceanbase]> SELECT AUTHORIZATION FROM oceanbase.DBA_OB_BACKUP_STORAGE_INFO WHERE PATH='S3://oceanbase-test-bucket/backup/data' AND ENDPOINT = 'host=s3.<region>.amazonaws.com';The query result is as follows:
+-------------------------------------+ | AUTHORIZATION | +-------------------------------------+ | access_id=******&encrypt_key=****** | +-------------------------------------+ 1 row in setConfirm the
access_idandaccess_keyinformation of the archive path.obclient[oceanbase]> SELECT AUTHORIZATION FROM oceanbase.DBA_OB_BACKUP_STORAGE_INFO WHERE PATH='S3://oceanbase-test-bucket/backup/archive' AND ENDPOINT = 'host=s3.<region>.amazonaws.com';The query result is as follows:
+-------------------------------------+ | AUTHORIZATION | +-------------------------------------+ | access_id=******&encrypt_key=****** | +-------------------------------------+ 1 row in set