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 Developer Center

V4.4.0

  • Topics Overview
  • Overview
    • What is ODC?
    • Features
    • Architecture
    • Limitations
    • ODC console
  • Quick Start
    • Client ODC
      • Overview
      • Install Client ODC
      • Use Client ODC
    • Web ODC
      • Overview
      • Deploy Web ODC
      • Use Web ODC
  • Data Source Management
    • Create a data source
    • Data sources and project collaboration
    • Database O&M
      • Session management
      • Global variable management
      • Recycle bin management
  • SQL Development
    • Edit and execute SQL statements
    • Perform PL compilation and debugging
    • Use the command-line window
    • Edit and export the result set of an SQL statement
    • Execution analysis
    • Generate test data
    • System settings
    • Database objects
      • Table objects
        • Overview
        • Create a table
      • View objects
        • Overview
        • Create a view
        • Manage views
      • Materialized view objects
        • Overview
        • Create a materialized view
        • Manage materialized views
      • Function objects
        • Overview
        • Create a function
        • Manage functions
      • Stored procedure objects
        • Overview
        • Create a stored procedure
        • Manage stored procedures
      • Sequence objects
        • Overview
        • Create a sequence
        • Manage sequences
      • Package objects
        • Overview
        • Create a program package
        • Manage program packages
      • Trigger objects
        • Overview
        • Create a trigger
        • Manage triggers
      • Type objects
        • Overview
        • Create a type
        • Manage types
      • Synonym objects
        • Overview
        • Create a synonym
        • Manage synonyms
  • Import and Export
    • Import schemas and data
    • Export schemas and data
  • Database Change Management
    • Manage user permissions
      • Users and roles
      • Automatic authorization
      • User permission management
    • Project collaboration management
    • Risk levels, risk identification rules, and approval processes
    • SQL check specifications
    • SQL window specification
    • Database change management
    • Manage changes to logical databases
    • Batch database change management
    • Online schema changes
    • Synchronize shadow tables
    • Schema comparison
  • Data Lifecycle Management
    • Data archiving
    • Data cleanup
    • Manage partitioning plans
      • Manage partitioning plans
      • Set partitioning strategies
      • Examples of partitioning strategies
    • SQL plan task
  • Data Masking and Auditing
    • Desensitize data
    • Operation records
  • Notification Management
    • Overview
    • View notification records
    • Manage notification channels
      • Create a notification channel
      • View, edit, and delete a notification channel
      • Configure a custom channel
    • Manage notification rules
  • System Integration
    • Login integration
    • Approval integration
    • SQL approval integration
    • Bastion host integration
  • Deployment Guide
    • Deployment overview
    • Preparations before deployment
    • Deploy ODC in single-node mode
    • Deploy ODC in high-availability mode
    • Deployment verification
  • Upgrade Guide
    • Upgrade Overview
    • Preparations before upgrade
    • Update single-node ODC
    • Update high-avaliability ODC
    • Upgrade verification
    • Rollback after upgrade failed
  • Best Practices
    • Tips for SQL development
    • Explore ODC team workspaces
    • Understanding real-time SQL diagnostics for OceanBase AP
    • OceanBase historical database solutions
    • ODC SQL check for automatic identification of high-risk operations
    • Integration with ODC enterprise-level account system
    • Manage and modify sharded databases and tables via ODC
    • Data masking and control practices
    • Enterprise-level control and collaboration: Safeguard every database change
  • Troubleshooting
    • ODC troubleshooting process
    • Collect message
      • View the runtime environment and version information
      • View web ODC logs
      • View client ODC logs
      • View end-to-end ODC-related logs
      • View ODC MetaDB data
      • Query the index status in OceanBase Database V4.x
      • Query the index status in OceanBase Database V1.4.x to V3.2.x
      • Collect JVM runtime information
      • Use tcpdump to capture packets
    • FAQ
      • Installation of client ODC
      • Web ODC deployment and startup
      • Connection Information
      • Command-line window
      • DDL statement display
  • Common features
  • Release Notes
    • V4.4
      • ODC V4.4.0
    • V4.3
      • ODC V4.3.4
      • ODC V4.3.3
      • ODC V4.3.2
      • ODC V4.3.1
      • ODC V4.3.0
    • V4.2
      • ODC V4.2.4
      • ODC V4.2.3
      • ODC V4.2.2
      • ODC V4.2.1
      • ODC V4.2.0
    • V4.1
      • ODC V4.1.3
      • ODC V4.1.2
      • ODC V4.1.1
      • ODC V4.1.0
    • V4.0
      • ODC V4.0.2
      • ODC V4.0.0
    • V3.4
      • ODC V3.4.0
    • V3.3
      • ODC V3.3.3
      • ODC V3.3.2
      • ODC V3.3.1
      • ODC V3.3.0
    • V3.2
      • ODC V3.2.3
      • ODC V3.2.2
      • ODC V3.2.1
      • ODC V3.2.0

Download PDF

Topics Overview What is ODC? Features Architecture Limitations ODC console Overview Install Client ODC Use Client ODC Overview Deploy Web ODC Use Web ODC Create a data source Data sources and project collaboration Session management Global variable management Recycle bin management Edit and execute SQL statements Perform PL compilation and debugging Use the command-line window Edit and export the result set of an SQL statement Execution analysis Generate test data System settings Import schemas and data Export schemas and data Users and roles Automatic authorization User permission management Project collaboration management Risk levels, risk identification rules, and approval processes SQL check specifications SQL window specification Database change management Manage changes to logical databases Batch database change management Online schema changes Synchronize shadow tables Schema comparison Data archiving Data cleanup Manage partitioning plans Set partitioning strategies Examples of partitioning strategies SQL plan task Desensitize data Operation records Overview View notification records Create a notification channel View, edit, and delete a notification channel Configure a custom channel Manage notification rules Login integration Approval integration SQL approval integration Bastion host integration Deployment overview Preparations before deployment Deploy ODC in single-node mode Deploy ODC in high-availability mode Deployment verification Upgrade Overview Preparations before upgrade Update single-node ODC Update high-avaliability ODC Upgrade verification Rollback after upgrade failed Tips for SQL development Explore ODC team workspaces Understanding real-time SQL diagnostics for OceanBase AP OceanBase historical database solutions ODC SQL check for automatic identification of high-risk operations Integration with ODC enterprise-level account system Manage and modify sharded databases and tables via ODC Data masking and control practices Enterprise-level control and collaboration: Safeguard every database change ODC troubleshooting process View the runtime environment and version information View web ODC logs View client ODC logs View end-to-end ODC-related logs View ODC MetaDB data Query the index status in OceanBase Database V4.x Query the index status in OceanBase Database V1.4.x to V3.2.x Collect JVM runtime information Use tcpdump to capture packets Installation of client ODC Web ODC deployment and startup Connection Information Command-line window DDL statement display Common features ODC V4.4.0 ODC V4.3.4 ODC V4.3.3 ODC V4.3.2 ODC V4.3.1 ODC V4.3.0 ODC V4.2.4
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 Developer Center
  3. V4.4.0
iconOceanBase Developer Center
V 4.4.0
  • V 4.4.2
  • V 4.4.1
  • V 4.4.0
  • V 4.3.4
  • V 4.3.3
  • V 4.3.2
  • V 4.3.1
  • V 4.3.0
  • V 4.2.4
  • V 4.2.3
  • V 4.2.2
  • V 4.2.1
  • V 4.2.0
  • V 4.1.3 and earlier

Query the index status in OceanBase Database V4.x

Last Updated:2026-04-07 10:00:35  Updated
share
What is on this page
GV$SESSION_LONGOPS view
View the index creation process
Waiting for transaction to end
Data completion

folded

share

Notice

  • This method applies to OceanBase Database V4.1. To query the index progress, you must use the sys tenant account.
  • For more information about how to query the index progress in OceanBase Database of a version from V1.4.x to V3.2.x, see Query the index status in OceanBase Database V1.4.x to V3.2.x.

GV$SESSION_LONGOPS view

If you use OceanBase Database V4.1.0 or later, you can view the time-consuming tasks of OceanBase Database in the GV$SESSION_LONGOPS view. The GV$SESSION_LONGOPS view provides information about the stage and progress of index creation. The following table describes the fields in the view.

Field Type Description
SID bigint(20) The ID of the session.
OPNAME varchar(128) The name of the DDL operation.
TARGET varchar(128) The DDL operation object.
SVR_IP varchar(46) The IP address of the server.
SVR_PORT bigint(20) The port on the server.
START_TIME bigint(20) The start time.
ELAPSED_SECONDS DECIMAL(24,4) The time consumed.
TIME_REMAINING bigint(20) The estimated remaining time.
LAST_UPDATE_TIME bigint(20) The record update time.
MESSAGE varchar(500) The supplementary information.
TRACE_ID varchar(64) The trace ID.

View the index creation process

Index data completion is the most time-consuming stage in index creation. In some environments, the most time in index creation may be spent in waiting for the concurrent transactions to complete or end.

Waiting for transaction to end

The index creation task is waiting for the transaction to end. Here is the sample command:

obclient> select * from oceanbase.gv$session_longops \G
*************************** 1. row ***************************
             SID: -1
        TRACE_ID: YE5186458A15C-0005EF63AE10FBBB-0-0
          OPNAME: create index
          TARGET: __idx_500005_i1
          SVR_IP:
        SVR_PORT: 58648
      START_TIME: 2023-06-09
 ELAPSED_SECONDS: 7
  TIME_REMAINING: 0
LAST_UPDATE_TIME: 2023-06-09
         MESSAGE: TENANT_ID: 1004, TASK_ID: 2, STATUS: WAIT TRANS END, PENDING_TX_ID: 76

When the transaction is waiting for completion, the MESSAGE field prints WAIT TRANS END and the transaction ID of the first uncompleted transaction, such as PENDING_TX_ID: 76. You can then query the transaction information in the __all_virtual_trans_stat table by using the trans_id field.

Data completion

You can use the row count metric to determine the overall progress of an index creation task.

Here is the sample code:

obclient> select * from oceanbase.gv$session_longops \G
*************************** 1. row ***************************
             SID: -1
        TRACE_ID: YFDE80BA2DA8D-0005FDA8116C1F4E-0-0
          OPNAME: create index
          TARGET: 500097
          SVR_IP: 127.1
        SVR_PORT: 65000
      START_TIME: 2023-06-09 17:10:42
 ELAPSED_SECONDS: 5
  TIME_REMAINING: 0
LAST_UPDATE_TIME: 2023-06-09 17:10:48
         MESSAGE: TENANT_ID: 1004, TASK_ID: 541, STATUS: REPLICA BUILD, ROW_SCANNED: 2000000, ROW_SORTED: 4000000, ROW_INSERTED: 503316
1 row in set (0.03 sec)

Fields in GV$SESSION_LONGOPS

The following table describes the fields for an index creation task.

Field Description
TRACE_ID The ID of the OBServer program log, which is used to search for related log files.
OPNAME The operation name. The value is create index for an index creation task.
TARGET The operation object. The value is the name of the index being created for an index creation task.
SVR_IP The IP address of the OBServer node on which the index creation task is executed.
SVR_PORT The port number of the OBServer node on which the index creation task is executed.
START_TIME The start date of index creation. This field is compatible with Oracle databases.
ELAPSED_SECONDS The time consumed for creating the index in seconds.
TIME_REMAINING The estimated remaining time. The field is compatible with Oracle databases and is currently not supported.
LAST_UPDATE_TIME The date when statistics are collected. This field is compatible with Oracle databases.
MESSAGE The specific information about the index task, which includes the following fields:
  • TENANT_ID: the ID of the tenant.
  • TASK_ID: the ID of the DDL task.
  • STATUS: the status of DDL execution. For example, REPLICA BUILD indicates the data completion stage.

Row count metric in the index data completion phase

Data completion can be divided into three main stages. The following table describes the row count metrics in these stages.

Stage Row count metric Description
Primary table scanning ROW_SCANNED -
Sorting ROW_SORTED The sorting stage may involve multiple rounds of compaction. Therefore, the value of ROW_SORTED is usually larger than those of ROW_SCANNED and ROW_INSERTED. The stage also takes a longer time.
Data writing to the index table ROW_INSERTED -

Based on the following fields in the preceding sample code: ROW_SCANNED: 2000000, ROW_SORTED: 4000000, and ROW_INSERTED: 503316, the following conclusions can be made:

  • The primary table scanning and sorting stages in data completion have been completed, and the task is now in the last stage, namely, data writing to the index table.

  • The total number of data rows is 2,000,000, and the number of rows written to the index table is 503,316, reaching a progress of 503316/2000000, which is about 25%.

Previous topic

View ODC MetaDB data
Last

Next topic

Query the index status in OceanBase Database V1.4.x to V3.2.x
Next
What is on this page
GV$SESSION_LONGOPS view
View the index creation process
Waiting for transaction to end
Data completion