OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

OceanBase Binlog Service

V4.2.5
  • Overview
  • Compatibility
  • Deployment guide
  • Configuration Information
    • Metadata
    • Local configurations
  • Control Commands
    • Overview
    • Node management
    • Task management
    • Instance management
    • Session management
    • File management
  • Monitoring and alerting
  • Troubleshooting
  • User Manual
    • Install obcdc
    • Update and upgrade
    • Performance tuning
  • Release Notes
    • Release notes
    • obbinlog V4.2.5
    • obbinlog V4.2.4
    • obbinlog V4.2.3
    • obbinlog V4.2.1
    • obbinlog V4.2.0
    • obbinlog Community Edition V4.0.1

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Binlog Service
  3. V4.2.5

File management

Last Updated:2026-09-03 10:36:38

Purge binlog files
Syntax
Parameters
Examples

Purge binlog files

You can purge specified binlog files. For more information, see PURGE BINARY LOGS Statement.

Syntax

  • Purge binlog files of the specified tenant

    PURGE BINARY LOGS {
        TO 'log_name' FOR TENANT cluster.tenant
      | BEFORE datetime_expr FOR TENANT cluster.tenant
    };
    
  • Purge binlog files of the specified instance

    PURGE BINARY LOGS {
        TO 'log_name' FOR INSTANCE instance_name
      | BEFORE datetime_expr FOR INSTANCE instance_name
    };
    

Parameters

Parameter
Description
log_name The name of the binlog file to be purged. You can configure this parameter to purge the specified binlog file from the specified tenant or instance.
cluster.tenant The name of the tenant whose binlog files are to be purged, and the name of the cluster to which the tenant belongs.
datetime_expr The cutoff timestamp for purging binlog files. Binlog files generated before this timestamp in the specified tenant or instance will be purged. The value is in the YYYY-MM-DD hh:mm:ss format.
instance_name The name of the instance whose binlog files are to be purged.

Examples

  • Purge the mysql-bin.000001 file from the test1 tenant of the obdemo cluster.

    PURGE BINARY LOGS TO 'mysql-bin.000001' FOR TENANT obdemo.test1;
    
  • Purge the binlog files that are generated after 2024-11-20 11:30:30 in the binlog1 instance.

    PURGE BINARY LOGS BEFORE '2024-11-20 11:30:30' FOR INSTANCE binlog1;
    

Previous topic

Session management
Last

Next topic

Monitoring and alerting
Next
on this page
Purge binlog files
Syntax
Parameters
Examples