The current version of OceanBase Database can track the memory usage of a single SQL statement. When memory usage exceeds a specified threshold, the system returns an error and stops the SQL statement execution to prevent out-of-memory (OOM) issues or for OOM troubleshooting.
Adjust the memory usage threshold for the execution of a single SQL statement
OceanBase Database allows you to use the tenant-level parameter query_memory_limit_percentage to specify the maximum percentage of memory in the tenant available for a single SQL statement. The default value is 50, indicating that the system returns an error and stops the SQL statement execution when the memory used by a single SQL statement exceeds 50% of the tenant memory. You can adjust the parameter
by performing the following steps based on your business needs:
Log in to a user tenant of the cluster as the tenant administrator.
Note
The administrator user is the
rootuser in MySQL mode and theSYSuser in Oracle mode.Here is an example:
obclient -h172.30.xxx.xxx -P2883 -uroot@mysqltenant#obdemo -pxxxx -AQuery the value of the
query_memory_limit_percentageparameter.obclient> SHOW PARAMETERS LIKE '%query_memory_limit_percentage%';Adjust the value of the
query_memory_limit_percentageparameter.Here is an example:
obclient> ALTER SYSTEM SET query_memory_limit_percentage = 50;