OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Binlog Service

V4.0.1

  • Overview
  • Compatibility
  • Deployment guide
  • Parameters
  • Management Command
    • Overview
    • Node management
    • Task management
    • Instance management
    • Session management
    • File management
  • Install obcdc
  • Monitoring and alerting
  • Troubleshooting
  • Release Notes
    • Release notes
    • obbinlog Community Edition V4.0.1

Download PDF

Overview Compatibility Deployment guide Parameters Overview Node management Task management Instance management Session management File management Install obcdc Monitoring and alerting Troubleshooting Release notes obbinlog Community Edition V4.0.1
OceanBase logo

The Unified Distributed Database for the AI Era.

Follow Us
Products
OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
Resources
DocsBlogLive DemosTraining & Certification
Company
About OceanBaseTrust CenterLegalPartnerContact Us
Follow Us

© OceanBase 2026. All rights reserved

Cloud Service AgreementPrivacy PolicySecurity
Contact Us
Document Feedback
  1. Documentation Center
  2. OceanBase Binlog Service
  3. V4.0.1
iconOceanBase Binlog Service
V 4.0.1
  • V 4.2.5
  • V 4.2.0

Task management

Last Updated:2025-03-21 09:41:05  Updated
share
What is on this page
Create a binlog task
Syntax
Parameters
Example
Query a binlog task
Syntax
Modify a binlog task
Syntax
Parameters
Example
Release a binlog task
Syntax
Examples

folded

share

Create a binlog task

You can enable the binlog service for the specified OceanBase Database tenant. Then, the binlog server will asynchronously create N binlog instances for the tenant. After you execute the CREATE BINLOG statement, resources will be allocated. If the resource allocation is successful, an OK message is immediately returned. If less than N binlog instances are successfully created, a warning message is returned.

Syntax

CREATE BINLOG [IF NOT EXISTS] FOR TENANT cluster.tenant 
       [FROM timestamp] [TO USER user PASSWORD pwd] 
       WITH CLUSTER URL cluster_url [, binlog_option [, binlog_option...]];

binlog_option:
      INITIAL_TRX_XID
    | INITIAL_TRX_GTID_SEQ
    | REPLICATE NUM
    | SERVER UUID

Parameters

Parameter Description
IF NOT EXISTS Optional. If you specify IF NOT EXISTS and the binlog task to be created already exists, the system does not report an error or create the task again. If you do not specify this parameter and the binlog task to be created already exists, the system reports an error.
cluster.tenant The name of the tenant for which the binlog task is to be created, and the name of the cluster to which the tenant belongs.
timestamp Optional. The startup timestamp. If you do not specify this parameter, the binlog task starts from the current timestamp.
user Optional. The username of a user in the sys tenant of the OceanBase cluster. If you have specified the username and password of a user in the sys tenant when you start the binlog server, skip this parameter.
pwd Optional. The password of the user specified by user in the sys tenant. If you have specified the username and password of a user in the sys tenant when you start the binlog server, skip this parameter.
cluster_url The ConfigUrl of the OceanBase cluster, which must be enclosed in quotation marks. You can obtain the value of this parameter by executing the SHOW PARAMETERS LIKE 'obconfig_url'; statement.
binlog_option Optional. Options of the binlog task, which are separated with commas (,). Separate the options and the ConfigUrl with a comma (,). Valid values:
  • INITIAL_TRX_XID: the xid that uniquely identifies the start transaction.
  • INITIAL_TRX_GTID_SEQ: the global transaction ID (GTID) of the start transaction.
  • REPLICATE NUM: the number of binlog instance replicas of the tenant. When the value is greater than 1, the binlog service randomly selects an instance replica as the primary instance.
  • SERVER UUID: the UUID of the binlog server.

Example

Create a binlog task for the test1 tenant in the obdemo cluster and create three binlog instances for the tenant.

CREATE BINLOG FOR TENANT `obdemo`.`test1` 
       TO USER `root` PASSWORD `********` 
       WITH CLUSTER URL `http://10.10.10.1:8080/services?Action=ObRootServiceInfo&ObCluster=demo`
       , REPLICATE NUM 3;

Query a binlog task

You can query the binlog files and resource metrics of the primary binlog instance in a binlog task. If the primary binlog instance is unavailable, an empty result set is returned.

Syntax

SHOW BINLOG STATUS [FOR TENANT cluster.tenant];

cluster.tenant specifies the name of the tenant whose binlog task is to be queried and the name of the cluster to which the tenant belongs. If you directly execute SHOW BINLOG STATUS without specifying FOR TENANT cluster.tenant, which is optional, information about the primary binlog instances of all binlog tasks is returned. If you specify FOR TENANT cluster.tenant, information about the primary binlog instance of the specified tenant is returned. Here is an example:

SHOW BINLOG STATUS FOR TENANT obdemo.test1;

The output is as follows:


+-----------+--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| cluster   | tenant | status                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
+-----------+--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| obdemo    | test1  | {"binlog_instance":"gldwt7bnco","resources_metrics":{"client_id":"/home/admin/oblogproxy/run/gldwt7bnco","fd_count":78,"pid":12058,"cpu_status":{"cpu_count":8,"cpu_used_ratio":0.006535947788506746},"disk_status":{"disk_total_size_mb":307048,"disk_usage_size_process_mb":0,"disk_used_ratio":0.0,"disk_used_size_mb":78830},"memory_status":{"mem_total_size_mb":63882,"mem_used_ratio":0.016514824703335763,"mem_used_size_mb":1055},"network_status":{"network_rx_bytes":288853,"network_wx_bytes":289725}},"binlog_files":[{"binlog_name":"mysql-bin.000001","binlog_size":155}]}      |
+-----------+--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

The following table describes the columns in the result set.

Column Description
cluster The name of the cluster.
tenant The name of the tenant.
status Information about the primary binlog instance.

Modify a binlog task

You can modify the parameter settings for all binlog instances of the specified tenant. The new settings also take effect for binlog instances created later.

Syntax

ALTER BINLOG cluster.tenant 
      SET binlog_instance_option [, binlog_instance_option...];

binlog_instance_option:
      BINLOG_EXPIRE_LOGS_SECONDS
    | BINLOG_EXPIRE_LOGS_SIZE
    | FAILOVER
    | EXTRA_OBCDC_CFG

Parameters

Parameter Description
cluster.tenant The name of the tenant for which the binlog instance parameter settings are to be modified, and the name of the cluster to which the tenant belongs.
binlog_instance_option The binlog instance parameters to be modified, which are separated with commas (,). Valid values:
  • BINLOG_EXPIRE_LOGS_SECONDS: the validity period of binlog files. The default value is 259,200 seconds. A binlog file automatically becomes invalid after the validity period elapses.
  • BINLOG_EXPIRE_LOGS_SIZE: the maximum size of a binlog file. The default value is 53687091200 bytes.
  • FAILOVER: specifies whether to automatically recover the binlog instance after it fails. The default value is 1, which indicates automatic recovery.
  • EXTRA_OBCDC_CFG: the OceanBase Change Data Capture (obcdc) parameter settings of the binlog instance.

Example

ALTER BINLOG obdemo.test1 SET BINLOG_EXPIRE_LOGS_SECONDS = 518400;

Release a binlog task

You can stop all binlog instances of the specified tenant and drop generated binlog files.

Syntax

DROP BINLOG [IF EXISTS] FOR TENANT cluster.tenant;

cluster.tenant specifies the name of the tenant whose binlog task is to be released and the name of the cluster to which the tenant belongs.

Examples

Release the binlog task of the test1 tenant in the obdemo cluster.

DROP BINLOG FOR TENANT obdemo.test1;

Previous topic

Node management
Last

Next topic

Instance management
Next
What is on this page
Create a binlog task
Syntax
Parameters
Example
Query a binlog task
Syntax
Modify a binlog task
Syntax
Parameters
Example
Release a binlog task
Syntax
Examples