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 Database

SQL - V4.4.2

    Download PDF

    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 Database
    3. SQL
    4. V4.4.2
    iconOceanBase Database
    SQL - V 4.4.2
    SQL
    KV
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    ls_gc_delay_time

    Last Updated:2026-04-02 06:23:58  Updated
    share
    What is on this page
    Description
    Privilege requirements
    Attributes
    Considerations
    Examples

    folded

    share

    Note

    For V4.2.0, this parameter is available starting with V4.2.0.

    Description

    The ls_gc_delay_time parameter specifies the duration for which the log streams of a tenant are delayed before being deleted.

    OceanBase Database V4.2.0 introduced a load balancing module based on log splitting and merging. This allows the database to scale out and scale in. When you scale in OceanBase Database, logs that meet the garbage collection (GC) conditions are removed, and the corresponding log storage is cleared.

    In addition, OceanBase Database has implemented physical standby databases based on the network starting with V4.2.0. When the source primary or standby tenant has not enabled log archiving and the database undergoes a scaling down operation, the log stream will be quickly cleared. This can lead to overall log synchronization being held up due to the recycling of logs. Therefore, you need to configure the delay time for log stream deletion for the source primary or standby tenant using this parameter.

    Privilege requirements

    • Query the parameter

      The sys tenant and all user tenants can query this parameter by executing the SHOW PARAMETERS statement or querying the GV$OB_PARAMETERS view.

    • Modify the parameter

      You can use the sys tenant or a user tenant to modify the parameters.

    Attributes

    Attribute Description
    Type Time
    Default value 0s, indicating that the log stream delay delete mechanism is no longer applicable.

    Note

    Starting from V4.2.1 BP1, the default value has been adjusted from 3600s to 0s.

    Value range [0s, +∞)
    Modifiable Yes. You can use the ALTER SYSTEM SET statement to modify the parameter.
    Effective upon OBServer node restart No. The setting takes effect immediately.

    Considerations

    • In physical standby scenarios:

      • If logs are not archived for the primary or standby tenants on the source, and the default value of the ls_gc_delay_time parameter is 3600s (1 hour), the log delayed deletion mechanism is activated, with a delay period of 1 hour for the log streams.

      • If log archiving is enabled for the primary or standby tenant of the source database, the log stream data integrity is guaranteed by log archiving. Therefore, the garbage collection (GC) of the log streams is not affected by this parameter. In this scenario, the log delay deletion mechanism does not take effect, regardless of the value of the ls_gc_delay_time parameter.

    • For a scenario where a tenant is deleted, the log stream delayed deletion mechanism will not take effect regardless of the value of the ls_gc_delay_time parameter.

      Note

      The only data that remains after deletion is the log stream entities. Whether the log files of the log stream can be retained depends on the available disk space for the current tenant. If the available disk space is insufficient, log recovery will still be triggered.

    Examples

    • Specify the delay period before a tenant log stream is automatically deleted in the sys tenant.

      obclient> ALTER SYSTEM SET ls_gc_delay_time='7200s' TENANT = 'mysql_tenant';
      
    • You can set the delayed deletion time of the log stream for the current user tenant.

      obclient> ALTER SYSTEM SET ls_gc_delay_time='7200s';
      

    Previous topic

    log_transport_compress_func
    Last

    Next topic

    ls_scale_out_factor
    Next
    What is on this page
    Description
    Privilege requirements
    Attributes
    Considerations
    Examples