OceanBase Cloud Platform (OCP) supports the object storage services compatible with the AWS Simple Storage Service (S3) protocol, such as the native Amazon Web Services (AWS) S3, Huawei Cloud Object Storage Service (OBS), Tianyi Cloud OBS, and Google Cloud Storage (GCS).
AWS S3
S3 allows you to configure the cleanup mode of backup files by using the delete_mode parameter in the same way as with Alibaba Cloud Object Storage Service (OSS) and Tencent Cloud Object Storage (COS).
The following examples describes how to set an S3 bucket as the backup destination:
To set an S3 bucket as the backup destination and specify the
deletecleanup mode for themysql_tenanttenant from thesystenant, execute the following statement:obclient> ALTER SYSTEM SET DATA_BACKUP_DEST='s3://oceanbase-test-bucket/backup/data? host=s3.<region>.amazonaws.com &access_id=**** &access_key=**** &s3_region=**** &delete_mode=delete' TENANT = mysql_tenant;To set an S3 bucket as the backup destination and specify the
deletecleanup mode for a user tenant from the current tenant, execute the following statement:obclient> ALTER SYSTEM SET DATA_BACKUP_DEST='s3://oceanbase-test-bucket/backup/data? host=s3.<region>.amazonaws.com &access_id=**** &access_key=**** &s3_region=**** &delete_mode=delete';
In the examples, s3:// indicates that an S3 bucket is used as the backup destination, the bucket is named oceanbase-test-bucket, the storage path in the bucket is /backup/data, and the question mark (?) is used to separate the bucket information from other parameters of the path. The host parameter specifies the domain name of the S3 service. The access_id and access_key parameters specify the AccessKey pair for accessing the S3 service. The s3_region parameter is required, and it specifies the region where the S3 bucket is located. The cleanup mode is set to delete.
Object storage services compatible with the S3 protocol
If you use an object storage service, such as OBS or GCS, that is compatible with the S3 protocol and the behaviors of S3 APIs of OceanBase Database, OceanBase Database allows you to use the object storage service as the backup destination, and access the object storage service in the same way as you access an S3 bucket.
The following examples describe how to set an OBS bucket as the backup destination:
To set an OBS bucket as the backup destination for the
mysql_tenanttenant from thesystenant, execute the following statement:obclient> ALTER SYSTEM SET DATA_BACKUP_DEST='s3://oceanbase-test-bucket/backup/data? host=obs.****.myhuaweicloud.com &access_id=**** &access_key=****' TENANT = mysql_tenant;To set an OBS bucket as the backup destination a user tenant from the current tenant, execute the following statement:
obclient> ALTER SYSTEM SET DATA_BACKUP_DEST='s3://oceanbase-test-bucket/backup/data? host=obs.****.myhuaweicloud.com &access_id=**** &access_key=****';
In the examples, s3:// indicates that an object storage bucket compatible with the S3 protocol is used as the backup destination, the bucket is named oceanbase-test-bucket, the storage path in the bucket is /backup/data, and the question mark (?) is used to separate the bucket information from other parameters of the path. The host parameter specifies the domain name of OBS. The access_id and access_key parameters specify the AccessKey pair for accessing OBS.
** The following examples describe how to set a GCS bucket as the backup destination:**
To set a GCS bucket as the backup destination for the
mysql_tenanttenant from thesystenant, execute the following statement:obclient> ALTER SYSTEM SET DATA_BACKUP_DEST='s3://oceanbase-test-bucket/backup/data? host=https://storage.googleapis.com &access_id=**** &access_key=****' TENANT = mysql_tenant;To set a GCS bucket as the backup destination for a user tenant from the current tenant, execute the following statement:
obclient> ALTER SYSTEM SET DATA_BACKUP_DEST='s3://oceanbase-test-bucket/backup/data? host=https://storage.googleapis.com &access_id=**** &access_key=****';
In the examples, s3:// indicates that an object storage bucket compatible with the S3 protocol is used as the backup destination, the bucket is named oceanbase-test-bucket, the storage path in the bucket is /backup/data, and the question mark (?) is used to separate the bucket information from other parameters of the path. The host parameter specifies the domain name of GCS. The access_id and access_key parameters specify the AccessKey pair for accessing GCS.