OceanBase logo

OceanBase

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

Product Overview
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

OceanBase

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

Product Overview
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.6.0

    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.6.0
    iconOceanBase Database
    SQL - V 4.6.0
    SQL
    KV
    • V 4.6.0
    • 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

    MODIFY PAXOS_REPLICA_NUM

    Last Updated:2026-05-07 11:26:25  Updated
    share
    What is on this page
    Purpose
    Limitations and considerations
    Privilege requirements
    Syntax
    Parameters
    Examples
    References

    folded

    share

    Purpose

    This statement is used to modify the paxos_replica_num of a log stream, which specifies the number of required members for the leader of the log stream.

    Limitations and considerations

    • This statement can only modify the paxos_replica_num of one log stream at a time.

    • For the same log stream in a tenant, only one disaster recovery task (excluding replica migration tasks) can be executed at a time. This includes tasks such as adding a replica, deleting a replica, changing the replica type, and modifying the number of required members for the leader of the log stream.

      Note

      The sys tenant can check the CDB_OB_LS_REPLICA_TASKS view to confirm if there are any ongoing disaster recovery tasks. User tenants can check the DBA_OB_LS_REPLICA_TASKS view for the same information.

    Privilege requirements

    The user executing this statement must have the ALTER SYSTEM privilege. For more information about OceanBase Database privileges, see Privilege classification in MySQL mode and Privilege classification in Oracle mode.

    Syntax

    ALTER SYSTEM MODIFY
        LS [=] ls_id
        PAXOS_REPLICA_NUM [=] paxos_replica_num
        [TENANT [=] 'tenant_name'];
    

    Parameters

    Parameter Description
    ls_id Specifies the ID of the log stream to be modified.
    paxos_replica_num Specifies the new number of required members for the leader.

    Notice

    When specifying the value of this parameter, please note the following:

    1. After the adjustment, both paxos_replica_num and the number of members in the MEMBER_LIST of the leader replica must satisfy the majority requirement.
    2. The value of paxos_replica_num must be greater than or equal to the number of members in the MEMBER_LIST of the current leader replica. The sys tenant can query the CDB_OB_LS_LOCATIONS view for confirmation; user tenants can query the DBA_OB_LS_LOCATIONS view for confirmation.
    3. paxos_replica_num can only be decreased, not increased, and the absolute value of the change must not exceed 1.
    If any of the above conditions are not met, an error will be reported.

    tenant_name Optional. Specifies the tenant to operate on. If not explicitly specified, the current tenant is used as the default.

    Notice

    The sys tenant can specify other tenants, while user tenants can only specify their own tenant. This statement does not support using ALL, ALL_USER, or ALL_META to specify all tenants, user tenants, or all Meta tenants.

    Examples

    Execute the following command in the sys tenant to change the PAXOS_REPLICA_NUM of the log stream (1002) in the mysql001 tenant to 2.

    ALTER SYSTEM MODIFY
        LS = 1002
        PAXOS_REPLICA_NUM = 2
        TENANT = 'mysql001';
    

    For more examples on modifying the paxos_replica_num of a log stream, see Modify the number of required members for the leader of a log stream.

    References

    • For information about manually adding a log stream replica, see ADD REPLICA.
    • For information about deleting a log stream replica, see REMOVE REPLICA.
    • For information about changing the type of a log stream replica, see MODIFY REPLICA.
    • For information about migrating a log stream replica, see MIGRATE REPLICA.
    • For information about canceling a log stream replica task, see CANCEL REPLICA TASK.

    Previous topic

    MODIFY LS
    Last

    Next topic

    MODIFY REPLICA
    Next
    What is on this page
    Purpose
    Limitations and considerations
    Privilege requirements
    Syntax
    Parameters
    Examples
    References