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

    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.2.1
    iconOceanBase Database
    SQL - V 4.2.1
    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

    Idle transaction timed out, with Error ORA-24761 reported

    Last Updated:2023-12-25 08:49:41  Updated
    share
    What is on this page
    Symptom
    Possible causes
    Troubleshooting procedure

    folded

    share

    This topic describes how to handle Error ORA-24761, where an idle transaction timed out in the Oracle mode of OceanBase Database.

    Symptom

    An error is returned when you query table data long after the transaction is started.

    obclient [SYS]> SELECT * FROM ordr;
    +----+------+-------+------------------------------+
    | ID | NAME | VALUE | GMT_CREATE                   |
    +----+------+-------+------------------------------+
    |  1 | CN   |  NULL | 04-NOV-22 06.06.16.843024 PM |
    |  2 | UK   |  NULL | 04-NOV-22 06.06.16.843024 PM |
    |  3 | US   |  NULL | 04-NOV-22 06.06.16.843024 PM |
    +----+------+-------+------------------------------+
    3 rows in set
    
    obclient [SYS]> UPDATE ordr SET value=1003 WHERE id=3;
    Query OK, 1 rows affected
    Rows matched: 1  Changed: 1  Warnings: 0
    
    /* Do not perform any operation for a long period of time. */
    
    obclient [SYS]> SELECT * FROM ordr;
    ORA-24761: transaction rolled back: transaction idle timeout
    

    The error codes corresponding to this error message are as follows:

    • Error code: ORA-24761

    • Error code in OceanBase Database: 6211

    • SQLSTATE: 25000

    For more information about the error codes, see Overview of error codes.

    Possible causes

    The transaction idle time, namely the execution interval between two consecutive statements, has exceeded the specified threshold. When the transaction idle time exceeds the specified threshold, the system reports an error if you perform a database operation. The idle transaction timeout period is controlled by the ob_trx_idle_timeout tenant variable. The default value is 86400000000 microseconds, namely 24 hours.

    Note

    OceanBase Database provides two timeout mechanisms to prevent transactions from holding locks for a long time and affecting other sessions: idle transaction timeout and uncommitted transaction timeout. Typically, only one timeout mechanism is triggered at a time.

    Troubleshooting procedure

    Take the following steps to view and modify tenant variables, roll back the transaction by using ROLLBACK, and then proceed with your operations.

    1. Check whether the transaction remains idle for a period of time longer than the threshold specified by the ob_trx_idle_timeout variable.

      The idle transaction timeout period is controlled by the ob_trx_idle_timeout tenant variable in the unit of microseconds. We recommend that you use the default value of 86400000000 microseconds, namely 24 hours.

      Note

      The following variable setting method takes effect only for the current session. To make the settings permanent, use the SET GLOBAL syntax to configure the variable, and then restart the session for the settings to take effect.

      obclient [SYS]> SHOW VARIABLES LIKE 'ob_trx_idle_timeout';
      +---------------------+-----------+
      | VARIABLE_NAME       | VALUE     |
      +---------------------+-----------+
      | ob_trx_idle_timeout | 120000000 |
      +---------------------+-----------+
      1 row in set
      
      obclient [SYS]> SET SESSION ob_trx_idle_timeout=86400000000;
      Query OK, 0 rows affected
      
    2. Use the ROLLBACK statement to roll back the transaction.

      obclient [SYS]> ROLLBACK;
      Query OK, 0 rows affected
      
    3. Query the data of the table again.

      obclient [SYS]> SELECT * FROM ordr;
      +----+------+-------+------------------------------+
      | ID | NAME | VALUE | GMT_CREATE                   |
      +----+------+-------+------------------------------+
      |  1 | CN   |  NULL | 04-NOV-22 06.06.16.843024 PM |
      |  2 | UK   |  NULL | 04-NOV-22 06.06.16.843024 PM |
      |  3 | US   |  NULL | 04-NOV-22 06.06.16.843024 PM |
      +----+------+-------+------------------------------+
      3 rows in set
      

    Previous topic

    Error handling specifications for Oracle-compatible applications
    Last

    Next topic

    Transaction timed out, with Error ORA-00600 reported
    Next
    What is on this page
    Symptom
    Possible causes
    Troubleshooting procedure