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.2.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 & 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.2.2
    iconOceanBase Database
    SQL - V 4.2.2
    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

    DISPLAY_CURSOR

    Last Updated:2026-04-15 08:27:15  Updated
    share
    What is on this page
    Syntax
    Parameters
    Examples

    folded

    share

    The DISPLAY_CURSOR function displays the details of an executed query plan.

    Syntax

    DBMS_XPLAN.DISPLAY_CURSOR(plan_id  INTEGER DEFAULT 0,         -- default value: last plan
                            format   VARCHAR2 DEFAULT 'TYPICAL',
                            svr_ip   VARCHAR2 DEFAULT null,   -- default value: server connected by client
                            svr_port   INTEGER DEFAULT 0,     -- default value: server connected by client
                            tenant_id  INTEGER DEFAULT 0     -- default value: current tenant
                            )
    RETURN DBMS_XPLAN_TYPE_TABLE;
    

    Parameters

    Parameter
    Description
    plan_id The plan ID. If this parameter is not specified, the last executed plan is displayed.
    format The plan format. Valid values:
    • 'BASIC': displays the minimum information in the plan, including the operator ID, operator name, operator description, and expression information.
    • 'TYPICAL': displays the basic information in the plan, including the operator ID, operator name, operator description, number of output rows estimated by the optimizer, execution time estimated by the optimizer, and expression information. If the plan has been executed, feedback on the first execution of the plan is also displayed, including the actual number of output rows and cost.
    • 'ALL': displays the maximum information in the plan, including the operator ID, operator name, operator description, number of output rows estimated by the optimizer, execution time estimated by the optimizer, expression information, effective hints, trace information of query block names, outline information, base table optimization information, constant parameterization information, constraint information, and plan notes.
    • 'ADVANCED': displays the maximum information in the plan, including all information items covered by the 'ALL' type. It also displays tree-structured information for complex plans.
    svr_ip The IP address of the OBServer node where the plan is located. The default value is the IP address of the OBServer node to which the session is connected.
    svr_port The port number of the OBServer node where the plan is located. The default value is the port number of the OBServer node to which the session is connected.
    tenant_id The ID of the tenant to which the plan belongs. By default, the tenant that the session connects to is used.

    Examples

    Because the table function feature is not available to MySQL tenants, you can directly use the DISPLAY_CURSOR function in a SELECT statement to output plan information.

    /* Create a table. */
    obclient> CREATE TABLE t1(c1 INT); 
    Query OK, 0 rows affected
    
    /* Execute a query. */
    obclient> SELECT * FROM t1;
    Empty set 
    
    /* Use the DBMS_XPLAN package to display an executed query plan. */
    obclient> SELECT DBMS_XPLAN.DISPLAY_CURSOR() ;
    +--------------------------------------------------------------------------------------------------+
    | COLUMN_VALUE                                                                                     |
    +--------------------------------------------------------------------------------------------------+
    | ================================================================================================ |
    | |ID|OPERATOR       |NAME|EST.ROWS|EST.TIME(us)|REAL.ROWS|REAL.TIME(us)|IO TIME(us)|CPU TIME(us)| |
    | ------------------------------------------------------------------------------------------------ |
    | |0 |TABLE FULL SCAN|T1  |1       |2           |0        |0            |0          |0           | |
    | ================================================================================================ |
    | Outputs & filters:                                                                               |
    | -------------------------------------                                                            |
    |   0 - output([T1.C1]), filter(nil), rowset=256                                                   |
    |       access([T1.C1]), partitions(p0)                                                            |
    |       is_index_back=false, is_global_index=false,                                                |
    |       range_key([T1.__pk_increment]), range(MIN ; MAX)always true                                |
    +--------------------------------------------------------------------------------------------------+
    
    /* You can also specify tenant_id, svr_ip, svr_port, and plan_id to display the information about the specified plan. */
    obclient> SELECT DBMS_XPLAN.DISPLAY_CURSOR(
           123,
            'typical',
            '127.0.0.1',
            2828,
            1002
          ) FROM DUAL;
    +--------------------------------------------------------------------------------+
    | dbms_xplan.display_cursor(
      123,
      'typical',
      '127.x.x.1',
      2828,
      1002
    ) |
    +--------------------------------------------------------------------------------+
    |                                                                                |
    +--------------------------------------------------------------------------------+
    1 row in set
    

    Previous topic

    DISPLAY_ACTIVE_SESSION_PLAN
    Last

    Next topic

    DISPLAY
    Next
    What is on this page
    Syntax
    Parameters
    Examples