You can enable the automatic detection of deadlocks based on your business requirements.
Prerequisites
Make sure that you have the following permissions:
-
Resource Permissions : Cluster Maintenance permission -
Menu Permissions : Permission on theOverview menu ofClusters
-
The logged-on user has the permission to manage the cluster.
The version of the OceanBase cluster is V3.2.0 or later, and the cluster is not in read-only mode.
Automatic detection of deadlocks is not enabled for the cluster.
Note
If the version of the OceanBase Database is V4.0 and later, automatic detection of deadlocks is enabled by default. If automatic detection of deadlocks is disabled, you can use this feature to enable it.
Procedure
Log on to the OceanBase Cloud Platform (OCP) console.
In the left-side navigation pane, click
Clusters .In the
Clusters list on theClusters page, find the target cluster and click its name.Click the
More icon in the upper right corner on theOverview page, and selectEnable Automatic Deadlock Detection from the context menu.Click
OK in the dialog box that appears.After automatic detection of deadlocks is enabled, OceanBase Database automatically detects and rolls back deadlocks. The deadlocks of the last 7 days are retained. For more information, see View deadlock analysis.

Notice
Automatic detection of deadlocks consumes approximately 2% of the system resources. Proceed with caution.