This section describes the preparations for log archiving.
(Optional) Configure the log archiving concurrency
Before you enable the archiving mode, you can configure the log archiving concurrency to improve the log archiving speed of the tenant.
Log in to the database as the
systenant or the tenant administrator of a user tenant.Choose a suitable statement to set the
log_archive_concurrencyparameter.The tenant-level
log_archive_concurrencyparameter specifies the total number of working threads for log archiving. This parameter takes effect dynamically without requiring a restart of the OBServer node. The value of this parameter ranges from 0 to 100, with a default value of0, indicating the use of the adaptive log archiving concurrency of OceanBase Database. We recommend that you use the default value.Notice
For small-scale tenants (tenants with CPU cores less than or equal to 4), we recommend that you use the default value and do not modify the value of this parameter.
You can set this parameter as follows:
Adjust the log archiving concurrency of a specified tenant in the
systenant.ALTER SYSTEM SET log_archive_concurrency = 10 TENANT = mysql_tenant;Adjust the log archiving concurrency of all tenants in the
systenant.ALTER SYSTEM SET log_archive_concurrency = 10 TENANT = all_user;or
ALTER SYSTEM SET log_archive_concurrency = 10 TENANT = all;Note
Starting from OceanBase Database V4.2.1, the
TENANT = all_userandTENANT = allclauses have the same semantics. When you want to apply the setting to all user tenants, we recommend that you use theTENANT = all_userclause. TheTENANT = allclause will be deprecated and no longer supported.Adjust the log archiving concurrency of the current tenant in a user tenant.
ALTER SYSTEM SET log_archive_concurrency = 10;
For more information about the
log_archive_concurrencyparameter, see log_archive_concurrency.
Configure the archive destination
Before you start a log archiving task, you need to use the ALTER SYSTEM command to configure the LOG_ARCHIVE_DEST parameter. Since the sys tenant is a cluster management tenant that does not contain user data, it does not support backup and restore. Therefore, you do not need to configure the archive destination for the sys tenant.
The main operations for configuring the archive destination are to set the LOCATION, BINDING, and PIECE_SWITCH_INTERVAL attributes.
Considerations
When you configure the destination for archiving, you must configure an independent empty directory for each tenant as the archive path. Different tenants cannot use the same archive path.
Procedure
Log in as a tenant administrator of the
systenant or a user tenant.Note
In MySQL-compatible mode, the administrator user is
root. In Oracle-compatible mode, the administrator user isSYS.Set the archive destination.
Notice
For an upgrade from OceanBase Database V4.0.x to V4.1.0, you must modify the archive log path after the upgrade. For an upgrade from OceanBase Database V4.1.x to V4.2.x, you do not need to modify the archive log path after the upgrade. In addition, you can perform log archiving during an upgrade from OceanBase Database V4.1.x to V4.2.x.
The sys tenant configures the archive destination for a specified tenant
ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=archive_path [BINDING=archive_mode] [PIECE_SWITCH_INTERVAL=piece_switch_interval]' TENANT = tenant_name;The user tenant configures the archive destination for the current tenant
ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=archive_path [BINDING=archive_mode] [PIECE_SWITCH_INTERVAL=piece_switch_interval]';
The detailed configuration is as follows.
Configure
LOCATION(required)The
LOCATIONattribute specifies the archive path. Currently, OceanBase Database supports NFS, Alibaba Cloud OSS, Azure Blob (supported starting from V4.2.5 BP6 in V4.2.5), AWS S3, and S3-compatible object storage such as Huawei OBS, Google GCS, and Tencent Cloud COS as archive media. Some archive media may need to meet basic requirements before use. For the specific requirements of each archive medium, see Backup media requirements in Overview of physical backup and restore.Alibaba Cloud OSSNFSAWS S3S3-compatible object storageAzure BlobWhen you use OSS as the archive medium, you can set the
delete_modeparameter in addition to the archive path,host,access_id, andaccess_key. Thedelete_modeparameter supportsdeletemode andtaggingmode. If you do not explicitly set thedelete_modeparameter,deletemode is used by default.OSS also supports the
checksum_typeparameter to specify the algorithm used to verify the integrity of archive files. Valid values aremd5andno_checksum. If you do not explicitly set thechecksum_typeparameter, the default value ismd5.In OceanBase Database V4.2.5, starting from V4.2.5 BP7, you can use an Alibaba Cloud OSS bucket with a compliance retention policy configured as the archive path. When you configure an archive path, you can use the
enable_wormparameter to specify whether OceanBase Database performs write and delete operations on the path according to the bucket retention policy (WORM policy). Valid values aretrueandfalse. If you do not explicitly set theenable_wormparameter, the default value isfalse. When you setenable_worm=true, you must also explicitly setchecksum_type=md5. After this parameter is set, it cannot be changed.Notice
OceanBase Database does not configure a compliance retention policy for you. Before you set the archive path, make sure that the OSS bucket retention policy (WORM policy) has been properly configured and locked.
For more information about the parameters, see SET LOG_ARCHIVE_DEST.
Notice
If you use an object storage service as the archival storage medium, the object storage path parameters are separated by the
&symbol. Ensure that the parameters you enter contain only English letters, numbers,/-_$+=, and wildcards. If you use other characters, the setting may fail.Examples:
When you use OSS as the archive medium, the sys tenant sets the archive path for the specified tenant
mysql_tenant, sets the cleanup mode todelete, and specifies the verification algorithm asmd5.obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=oss://oceanbase-test-bucket/backup/archive?host=****.aliyun-inc.com&access_id=****&access_key=****&delete_mode=delete&checksum_type=md5' TENANT = mysql_tenant;If you do not want to verify the integrity of archive files, set the
checksum_typeparameter tono_checksum. Example:obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=oss://oceanbase-test-bucket/backup/archive?host=****.aliyun-inc.com&access_id=****&access_key=****&delete_mode=delete&checksum_type=no_checksum' TENANT = mysql_tenant;When you use OSS as the archive medium, the sys tenant sets the archive path for the specified tenant
mysql_tenant, sets the cleanup mode totagging, specifies WORM-compliant object write and delete operations, and sets the verification algorithm tomd5.Notice
- OceanBase Database does not configure a compliance retention policy for you. Before you set the archive path, make sure that the OSS bucket retention policy (WORM policy) has been properly configured and locked.
- When you use a bucket with a WORM policy as the archive path, we recommend that you use the
taggingcleanup mode.
obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=oss://oceanbase-test-bucket/backup/archive?host=****.aliyun-inc.com&access_id=****&access_key=****&delete_mode=tagging&checksum_type=md5&enable_worm=true' TENANT = mysql_tenant;When you use OSS as the archive medium, the user tenant sets the archive path for the current tenant, sets the cleanup mode to
delete, and specifies the verification algorithm asmd5.obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=oss://oceanbase-test-bucket/backup/archive?host=****.aliyun-inc.com&access_id=****&access_key=****&delete_mode=delete&checksum_type=md5';
In the examples,
oss://indicates that OSS is used as the archive medium. The bucket name isoceanbase-test-bucket, and the path in the bucket is/backup/archive. The?character separates the path from the parameters, which are separated by&.hostspecifies the host address of the bucket.access_idandaccess_keyspecify the access keys for OSS.delete_mode=deleteindicates that the cleanup mode isdelete, and the MD5 algorithm is used to verify the integrity of archive files.enable_worm=trueindicates that write and delete operations are performed according to WORM rules. OceanBase Database does not configure a compliance retention policy for you. Before you set the archive path, make sure that the OSS bucket retention policy (WORM policy) has been properly configured and locked.Notice
When you use NFS as the archive medium, note the following:
- The value of
LOCATIONcannot be set to a string that contains a question mark (?) character. LOCATIONmust be set to an absolute path, ensuring that the OBServer server has read and write permissions forLOCATION.- Make sure that all OBServer nodes have mounted the same NFS server. To ensure smooth archiving, use the recommended parameters to mount the NFS server. For more information about how to mount the NFS server, see Deploy NFS Clients.
Examples:
When you use NFS as the archive medium, the sys tenant sets the archive path for the specified tenant
mysql_tenant.obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=file:///data/nfs/backup/archive' TENANT = mysql_tenant;When you use NFS as the archive medium, the user tenant sets the archive path for the current tenant.
obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=file:///data/nfs/backup/archive';
In the example,
file://indicates that NFS is used as the archive medium, and the archive path is/data/nfs/backup/archive.Like OSS, AWS S3 supports the
delete_modeparameter to configure the cleanup mode of archive files. The configuration method is the same as that for OSS. AWS S3 also supports thechecksum_typeparameter to specify the algorithm used to verify the integrity of archive files. Valid values aremd5andcrc32. If you do not explicitly set thechecksum_typeparameter, the default value ismd5.For more information about the
delete_modeandchecksum_typeparameters, see SET LOG_ARCHIVE_DEST.Notice
When you use object storage as the archive medium, the parameters in the object storage path are separated by the
&symbol. Make sure that the parameter values contain only uppercase and lowercase English letters, digits,/-_$+=, and wildcards. If you enter other characters, the setting may fail.Examples for using S3 as the archive medium:
When you use S3 as the archive medium, the sys tenant sets the archive path for the specified tenant
mysql_tenant, sets the cleanup mode todelete, and specifies the verification algorithm ascrc32.obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=s3://oceanbase-test-bucket/backup/archive?host=s3.<region>.amazonaws.com&access_id=******&access_key=******&s3_region=******&delete_mode=delete&checksum_type=crc32' TENANT = mysql_tenant;When you use S3 as the archive medium, the user tenant sets the archive path for the current tenant, sets the cleanup mode to
delete, and specifies the verification algorithm ascrc32.obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=s3://oceanbase-test-bucket/backup/archive?host=s3.<region>.amazonaws.com&access_id=******&access_key=******&s3_region=******&delete_mode=delete&checksum_type=crc32';
In the examples,
s3://indicates that AWS S3 is used as the archive medium. The bucket name isoceanbase-test-bucket, and the path in the bucket is/backup/archive. The?character separates the path from the parameters, which are separated by&.hostspecifies the domain name of the Amazon S3 service.access_idandaccess_keyspecify the access keys for AWS.s3_regionis required when S3 is used as the archive medium and specifies the region of the S3 bucket. The cleanup mode isdelete, and the CRC32 algorithm is used to verify the integrity of archive files.For more information about the AWS S3 path format, see Appendix: AWS S3 Path Format Description.
Because most object storage services are compatible with the S3 protocol, any S3-compatible object storage that meets OceanBase Database requirements (the object storage must implement the S3 API behaviors used by OceanBase system calls) can be used as an archive medium and accessed through the S3 protocol. For example, OBS, GCS, and COS are all accessed through the S3 protocol.
For OBS, GCS, and COS object storage accessed through the S3 protocol, you can use the
checksum_typeparameter to specify the algorithm used to verify the integrity of archive files. Onlymd5is supported. If you do not explicitly set thechecksum_typeparameter, the default value ismd5. For more information about thechecksum_typeparameter, see SET LOG_ARCHIVE_DEST.Notice
- When you use object storage as the archive medium, the parameters in the object storage path are separated by the
&symbol. Make sure that the parameter values contain only uppercase and lowercase English letters, digits,/-_$+=, and wildcards. If you enter other characters, the setting may fail. - For some S3-compatible object storage services, the default URL encoding method of the AWS S3 SDK may not be supported. If errors such as 9129 or 9026 occur when you access object storage through the
s3://protocol, set the cluster-level parameter ob_storage_s3_url_encode_type to make the URL encoding method used by AWS S3 compatible with the RFC 3986 standard. For detailed steps, see Steps and examples for using COS as the archive medium below.
Examples for using OBS as the archive medium:
When you use OBS as the archive medium, the sys tenant sets the archive path for the specified tenant
mysql_tenant.obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=s3://oceanbase-test-bucket/backup/archive?host=obs.****.myhuaweicloud.com&access_id=****&access_key=****' TENANT = mysql_tenant;When you use OBS as the archive medium, the user tenant sets the archive path for the current tenant.
obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=s3://oceanbase-test-bucket/backup/archive?host=obs.****.myhuaweicloud.com&access_id=****&access_key=****';
In the examples,
s3://indicates that S3-compatible object storage is used as the archive medium. The bucket name isoceanbase-test-bucket, and the path in the bucket is/backup/archive. The?character separates the path from the parameters, which are separated by&.hostspecifies the domain name of the OBS service.access_idandaccess_keyspecify the access keys for OBS.Examples for using GCS as the archive medium:
When you use GCS as the archive medium, the sys tenant sets the archive path for the specified tenant
mysql_tenant.obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=s3://oceanbase-test-bucket/backup/archive?host=https://storage.googleapis.com&access_id=****&access_key=****' TENANT = mysql_tenant;When you use GCS as the archive medium, the user tenant sets the archive path for the current tenant.
obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=s3://oceanbase-test-bucket/backup/archive?host=https://storage.googleapis.com&access_id=****&access_key=****';
In the examples,
s3://indicates that S3-compatible object storage is used as the archive medium. The bucket name isoceanbase-test-bucket, and the path in the bucket is/backup/archive. The?character separates the path from the parameters, which are separated by&.hostspecifies the domain name of the GCS service.access_idandaccess_keyspecify the access keys for GCS.Steps and examples for using COS as the archive medium:
Check the value of the
ob_storage_s3_url_encode_typeparameter at the cluster level.obclient> SHOW PARAMETERS LIKE '%ob_storage_s3_url_encode_type%';The result is as follows:
+-------+----------+----------------+----------+-------------------------------+-----------+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+ | zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level | +-------+----------+----------------+----------+-------------------------------+-----------+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+ | zone1 | observer | 172.xx.xxx.xxx | 2882 | ob_storage_s3_url_encode_type | NULL | default | Determines the URL encoding method for S3 requests."default": Uses the S3 standard URL encoding method."compliantRfc3986Encoding": Uses URL encoding that adheres to the RFC 3986 standard. | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE | +-------+----------+----------------+----------+-------------------------------+-----------+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+ 1 row in setIf the value is
default, change it tocompliantRfc3986Encoding.obclient> ALTER SYSTEM SET ob_storage_s3_url_encode_type='compliantRfc3986Encoding';For more information about this parameter, see ob_storage_s3_url_encode_type.
Set the archive path and configure the cleanup mode of archive files with the
delete_modeparameter.When you use COS as the archive medium, the sys tenant sets the archive path for the specified tenant
mysql_tenantand sets the cleanup mode todelete. Example:obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=s3://oceanbase-test/backup/archive?host=cos.ap-xxxx.myqcloud.com&access_id=***&access_key=***&delete_mode=delete' TENANT = mysql_tenant;When you use COS as the archive medium, the user tenant sets the archive path for the current tenant and sets the cleanup mode to
delete. Example:obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=s3://oceanbase-test/backup/archive?host=cos.ap-xxxx.myqcloud.com&access_id=***&access_key=***&delete_mode=delete';In the example,
s3://is used to access the archive path through the S3 protocol. The bucket name isoceanbase-test, and the path in the bucket is/backup/archive. The?character separates the path from the parameters, which are separated by&.hostspecifies the host address of COS, which is the endpoint without the bucket name.access_idandaccess_keyspecify the access keys for COS, and the cleanup mode isdelete.Notice
During an archiving run, you cannot change the access protocol used for archiving. For example, you cannot switch from S3 to OSS or from OSS to S3.
In OceanBase Database V4.2.5, Azure Blob is supported as an archive medium starting from V4.2.5 BP6.
Like OSS, Azure Blob supports the
delete_modeandchecksum_typeparameters. Thedelete_modeparameter configures the cleanup mode of archive files. If you do not explicitly set thedelete_modeparameter, the default value isdelete. Thechecksum_typeparameter specifies the algorithm used to verify the integrity of archive files. Valid values aremd5andno_checksum. If you do not explicitly set thechecksum_typeparameter, the default value ismd5.For more information about other parameters, see SET LOG_ARCHIVE_DEST.
Examples:
Notice
- When you use object storage as the archive medium, the parameters in the object storage path are separated by the
&symbol. Make sure that the parameter values contain only uppercase and lowercase English letters, digits,/-_$+=, and wildcards. If you enter other characters, the setting may fail. - When you use Azure Blob as the archive medium, the prefix of the
hostparameter must behttp://orhttps://. Because Azure Blob enables secure transfer by default, it is accessed throughhttps://by default. To access it throughhttp://, you must disable the secure transfer option for Azure Blob. For more information, see Azure Blob documentation.
When you use Azure Blob as the archive medium, the sys tenant sets the archive path for the specified tenant
mysql_tenant, sets the cleanup mode todelete, and specifies the verification algorithm asmd5.obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=azblob://oceanbase-test-bucket/backup/archive?host=http://****.blob.core.windows.net&access_id=****&access_key=****&delete_mode=delete&checksum_type=md5' TENANT = mysql_tenant;When you use Azure Blob as the archive medium, the user tenant sets the archive path for the current tenant, sets the cleanup mode to
delete, and specifies the verification algorithm asmd5.obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=azblob://oceanbase-test-bucket/backup/archive?host=http://****.blob.core.windows.net&access_id=****&access_key=****&delete_mode=delete&checksum_type=md5';
In the example,
azblob://indicates that Azure Blob is used as the archive medium. The bucket name isoceanbase-test-bucket, and the path in the bucket is/backup/archive. The?character separates the path from the parameters, which are separated by&.hostspecifies the host address of the bucket, which can be obtained from the container properties or the storage account connection string.access_idspecifies the storage account name.access_keyspecifies the access key for Azure Blob. The cleanup mode isdelete, and the MD5 algorithm is used to verify the integrity of archive files.Configure the
BINDINGattribute (optional)The
BINDINGattribute sets the priority mode between archiving and business operations. Currently,Optionalmode andMandatorymode are supported. If you do not set this attribute, the default value isOptional.Optionalmode means that business operations take priority. In this mode, if archiving cannot keep up with log generation, logs may be recycled before they are archived, which may cause log streaming interruption.Mandatorymode means that archiving takes priority. In this mode, if archiving cannot keep up with data writes, writes may fail.
When you use NFS as the archive medium, the sys tenant configures the archive path for the specified tenant
mysql_tenantand sets theBINDINGattribute. Example:obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=file:///data/nfs/backup/archive BINDING=Optional' TENANT = mysql_tenant;When you use NFS as the archive medium, the user tenant configures the archive path for the current tenant and sets the
BINDINGattribute. Example:obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=file:///data/nfs/backup/archive BINDING=Optional';Configure the
PIECE_SWITCH_INTERVALattribute (optional)The
PIECE_SWITCH_INTERVALattribute configures the switch interval of apiece. The value range is[1d, 7d]. If you do not set this attribute, the default value is1d.When you use NFS as the archive medium, the sys tenant configures the archive path for the specified tenant
mysql_tenantand sets the logpieceswitch interval to one day. Example:obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=file:///data/nfs/backup/archive BINDING=Optional PIECE_SWITCH_INTERVAL=1d' TENANT = mysql_tenant;When you use NFS as the archive medium, the user tenant configures the archive path for the current tenant and sets the log
pieceswitch interval to one day. Example:obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST='LOCATION=file:///data/nfs/backup/archive BINDING=Optional PIECE_SWITCH_INTERVAL=1d';
After the configuration is completed, you can query the parameter settings.
You can query the
CDB_OB_ARCHIVE_DESTview in thesystenant and theDBA_OB_ARCHIVE_DESTview in a user tenant.For more information about how to view the archiving parameters, see View archiving parameters.
Considerations and instructions after configuration
After the LOG_ARCHIVE_DEST parameter is set, the system creates a format file in the destination directory by default. This file is used to verify the validity of the backup destination and ensure the integrity of the data in the destination. Therefore, when you configure the log archiving destination, note the following:
If the
formatfile does not exist, the destination directory must be empty for the configuration to be successful. Otherwise, the system will return an error-9080indicating that theformatfile does not exist.If the
formatfile already exists, its content must pass the validation for the configuration to be successful. Otherwise, the system will return an error-9081indicating that theformatfile does not match. The content validation mainly checks whether the cluster, tenant, and backup destination type in theformatfile match the current cluster, tenant, and backup destination type.If the
formatfile does not exist or the content validation fails, the backup task will fail.
After the archive destination is configured, incremental configuration is not supported. For example, if the BINDING attribute of the archive path /data/nfs/backup/archive under NFS is set to Mandatory and the PIECE_SWITCH_INTERVAL attribute is set to 1d, and you want to update the PIECE_SWITCH_INTERVAL attribute to 2d while keeping the BINDING attribute as Mandatory, you still need to specify the values of other attributes in the command. Otherwise, the unspecified attributes will use their default values.
You need to execute the following statements to make the changes.
Modify the specified tenant in the sys tenant
obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST = 'LOCATION=file:///data/nfs/backup/archive BINDING=Mandatory PIECE_SWITCH_INTERVAL=2d' TENANT = mysql_tenant;Modify the current tenant in the user tenant
obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST = 'LOCATION=file:///data/nfs/backup/archive BINDING=Mandatory PIECE_SWITCH_INTERVAL=2d';
(Optional) Configure the archive lag target
OceanBase Database uses the tenant-level parameter archive_lag_target to control the delay in archiving logs for a tenant. This parameter supports units of milliseconds (ms), seconds (s), minutes (m), and hours (h), with a default value of 2 minutes. It specifies the maximum interval between two consecutive archive I/O operations, ensuring that online logs are archived in a timely manner to reduce the risk of data loss.
OceanBase Database archives logs in streams. If a log stream has logs being written and the time elapsed since the last archive of this stream exceeds the value specified by archive_lag_target, an archive operation is triggered for this stream, archiving all unarchived logs.
For example, if archive_lag_target is set to 120s (2 minutes), each log stream will attempt to perform an archive operation every 2 minutes (unless other conditions are met, such as the cache aggregation buffer for log archiving being full). This ensures that the interval between the current archive operation and the last one is less than 2 minutes. Note that when archive_lag_target is set to 0, real-time archiving is achieved.
For more information about the archive_lag_target parameter, see archive_lag_target.
Prerequisites
Before modifying the value of the archive_lag_target parameter, make sure that the archive destination has been configured. If no archive path is configured, the system will prompt log_archive_dest has not been set, set archive_lag_target is not allowed when you attempt to modify the parameter.
Considerations
For scenarios where the archive medium is OSS or NFS, the value of
archive_lag_targetcan be set to any value within its valid range. However, for scenarios where the archive medium is S3 or another object storage service that is compatible with the S3 protocol, the value ofarchive_lag_targetmust be at least60s. If it is set to a value less than60s, the system will return an error.It is recommended to set the value of
archive_lag_targetto a reasonable value to avoid excessive I/O operations that may impact system performance, especially when using object storage. Additionally, excessively high values may not meet the timeliness requirements for data recovery. Therefore, the value ofarchive_lag_targetshould be balanced based on specific business requirements and the performance of the archive medium.
Configuration method
Log in to the database as the
systenant or the tenant administrator of a user tenant.Choose a suitable statement to configure the archive lag based on your actual situation.
Configuration methods:
The sys tenant configures the archive lag for a specified tenant
obclient> ALTER SYSTEM SET archive_lag_target = '120s' TENANT = mysql_tenant;The sys tenant configures the archive lag for all user tenants
obclient> ALTER SYSTEM SET archive_lag_target = '120s' TENANT = all_user;The user tenant configures the archive lag for the current tenant
obclient> ALTER SYSTEM SET archive_lag_target = '120s';
