You can enable the automatic detection of deadlocks based on your business requirements.
Prerequisites
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. The Clusters page automatically appears.
In the Clusters list on the Clusters page, find the target cluster and click its name.
Click the More icon in the upper right corner on the Overview page, and select Enable 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.