You can enable 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 3.2.0 or later, and the cluster is not in read-only mode.
Automatic detection of deadlocks is not enabled for the cluster.
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.