Overview
enable_lock_priority specifies whether to enable table lock priority. When this option is enabled, a specific DDL statement (RENAME TABLE) will have the highest lock priority. That is, when other DDL statements, lock operations, or DML statements are competing for the same lock, the RENAME TABLE statement will be granted the lock first after it is released.
Privilege requirements
Query parameters
Both the
systenant and all user tenants can query this parameter using theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview.Modify parameters
Both the
systenant and user tenants can use theALTER SYSTEM SETstatement to modify this parameter.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | BOOL |
| Default Value | FALSE |
| Value range |
|
| Modifiable | Yes, you can use the following methods:ALTER SYSTEM SETStatement modification. |
| Whether to restart the OBServer node for the change to take effect | No, the setting takes effect immediately. |
Usage instructions
Before using gh-ost or OceanBase Developer Center (ODC) to perform online DDL operations, you must enable the enable_lock_priority parameter for the corresponding tenant. After enabling it, you need to query the GV$OB_PARAMETERS view to ensure the configuration takes effect on all servers in the tenant. After the online DDL operation is completed, you must disable this parameter to prevent DDL operations from affecting user DML business.
Configuration example
Enable table lock priority.
ALTER SYSTEM SET enable_lock_priority = TRUE;View the value of the parameter.
SHOW PARAMETERS LIKE 'enable_lock_priority';The return result is as follows:
+-------+----------+----------------+----------+----------------------+-----------+-------+-----------------------------------------------------------------------------------------------------------------------------------+---------+--------+---------+-------------------+---------------+-----------+ | zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level | default_value | isdefault | +-------+----------+----------------+----------+----------------------+-----------+-------+-----------------------------------------------------------------------------------------------------------------------------------+---------+--------+---------+-------------------+---------------+-----------+ | zone1 | observer | xxx.xx.xxx.001 | 2882 | enable_lock_priority | NULL | True | specifies whether to enable lock priority, which, when activated, gives certain DDL operations the highest table lock precedence. | TRANS | TENANT | DEFAULT | DYNAMIC_EFFECTIVE | False | 0 | | zone2 | observer | xxx.xx.xxx.002 | 2882 | enable_lock_priority | NULL | True | specifies whether to enable lock priority, which, when activated, gives certain DDL operations the highest table lock precedence. | TRANS | TENANT | DEFAULT | DYNAMIC_EFFECTIVE | False | 0 | | zone3 | observer | xxx.xx.xxx.003 | 2882 | enable_lock_priority | NULL | True | specifies whether to enable lock priority, which, when activated, gives certain DDL operations the highest table lock precedence. | TRANS | TENANT | DEFAULT | DYNAMIC_EFFECTIVE | False | 0 | +-------+----------+----------------+----------+----------------------+-----------+-------+-----------------------------------------------------------------------------------------------------------------------------------+---------+--------+---------+-------------------+---------------+-----------+ 3 row in setDisable table lock priority.
ALTER SYSTEM SET enable_lock_priority = FALSE;