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.3.3

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & CertificationTicket
    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.3.3
    iconOceanBase Database
    SQL - V 4.3.3
    Databases
    • OceanBase Database
    • OceanBase Cloud
    • OceanBase Tugraph
    • Interactive Tutorials
    • OceanBase Best Practices
    Tools
    • OceanBase Cloud Platform
    • OceanBase Migration Service
    • OceanBase Developer Center
    • OceanBase Migration Assessment
    • OceanBase Admin Tool
    • OceanBase Loader and Dumper
    • OceanBase Deployer
    • Kubernetes operator for OceanBase
    • OceanBase Diagnostic Tool
    • OceanBase Binlog Service
    Connectors and Middleware
    • OceanBase Database Proxy
    • Embedded SQL in C for OceanBase
    • OceanBase Call Interface
    • OceanBase Connector/C
    • OceanBase Connector/J
    • OceanBase Connector/ODBC
    • OceanBase Connector/NET
    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

    Overview

    Last Updated:2024-12-02 03:48:27  Updated
    Share
    What is on this page
    Considerations
    Subprograms

    folded

    Share

    The DBMS_STATS package allows you to view and modify statistics collected by the optimizer for database objects.

    Applicability

    This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.

    Considerations

    In the current version of OceanBase Database, the DBMS_STATS package supports the following operations:

    • Collect statistics from the optimizer.

    • Set information about columns, tables, and indexes.

    • Delete statistics.

    • Lock and unlock statistics.

    Subprograms

    The following table describes the DBMS_STATS subprograms supported by the current OceanBase Database version.

    Subprogram
    Description
    ALTER_STATS_HISTORY_RETENTION Changes the retention period of historical statistics. The default retention period is 31 days.
    CREATE_STAT_TABLE Creates a table under the specified user to store statistics.
    DELETE_COLUMN_STATS Deletes column-level statistics.
    DELETE_INDEX_STATS Deletes index-related statistics.
    DELETE_TABLE_STATS Deletes table-level statistics.
    DELETE_SCHEMA_STATS Deletes the statistics on all tables of the specified user.
    DELETE_SCHEMA_PREFS Deletes a statistics preference from the statistics on all tables of the specified user.
    DELETE_SYSTEM_STATS Deletes system statistics.
    DELETE_TABLE_PREFS Deletes the statistics preferences of a table owned by the specified user.
    DROP_STAT_TABLE Drops a user statistics table.
    EXPORT_COLUMN_STATS Exports column-level statistics.
    EXPORT_INDEX_STATS Retrieves statistics on a specified index and stores them in a statistics table.
    EXPORT_TABLE_STATS Exports table-level statistics.
    EXPORT_SCHEMA_STATS Exports the statistics on all tables of the specified user.
    FLUSH_DATABASE_MONITORING_INFO Flushes the memory monitoring information of all tables to the dictionary.
    GATHER_INDEX_STATS Collects index statistics.
    GATHER_TABLE_STATS Collects statistics on tables and columns.
    GATHER_SCHEMA_STATS Collects the statistics on all objects of the specified user.
    GATHER_SYSTEM_STATS Collects system statistics.
    GET_STATS_HISTORY_AVAILABILITY Obtains the time of the earliest available historical statistics. You cannot restore historical statistics that are earlier than this time.
    GET_STATS_HISTORY_RETENTION Obtains the retention period of the historical statistics.
    GET_PARAM Obtains the default values of parameters of procedures in the DBMS_STATS package.
    GET_PREFS Obtains the default value of a specified preference.
    IMPORT_INDEX_STATS Retrieves the statistics on the specified index from a user statistics table and stores them in the dictionary.
    IMPORT_COLUMN_STATS Imports column-level statistics.
    IMPORT_TABLE_STATS Imports table-level statistics.
    IMPORT_SCHEMA_STATS Imports the statistics on all tables of the specified user.
    LOCK_PARTITION_STATS Locks the statistics on a partition.
    LOCK_SCHEMA_STATS Locks the statistics on all tables of the specified user.
    LOCK_TABLE_STATS Locks the statistics on a table.
    RESTORE_TABLE_STATS Restores the table-level historical statistics at the specified point in time.
    RESTORE_SCHEMA_STATS Restores the user-level historical statistics at the specified point in time.
    RESET_GLOBAL_PREF_DEFAULTS Resets global preferences to default values.
    RESET_PARAM_DEFAULTS Resets the default values of all parameters to the recommended values.
    PURGE_STATS Purges historical statistics saved before the specified timestamp.
    SET_COLUMN_STATS Sets column-level basic information.
    SET_INDEX_STATS Sets related information of an index.
    SET_TABLE_STATS Sets table-level basic information.
    SET_GLOBAL_PREFS Sets a global statistics preference.
    SET_PARAM Sets the default value for a parameter of procedures in the DBMS_STATS package.
    SET_SCHEMA_PREFS Sets a statistics preference for the specified user.
    SET_SYSTEM_STATS Sets system statistics.
    SET_TABLE_PREFS Sets a statistics preference of a table owned by the specified user.
    UNLOCK_PARTITION_STATS Unlocks the statistics on a partition.
    UNLOCK_SCHEMA_STATS Unlocks the statistics on all tables of the specified user.
    UNLOCK_TABLE_STATS Unlocks the statistics on a table.
    COPY_TABLE_STATS Copies statistics of the source partition or subpartition to the target partition or subpartition.

    Previous topic

    PARSE
    Last

    Next topic

    ALTER_STATS_HISTORY_RETENTION
    Next
    What is on this page
    Considerations
    Subprograms