Note
This parameter was introduced in OceanBase Database V4.2.5.
Description
enable_lock_priority specifies whether to enable table lock priorities. When lock priorities are enabled, RENAME TABLE operations have the highest lock priority. When a RENAME TABLE operation is waiting for a table lock together with another DDL operation, a locking operation, or a DML operation, the RENAME TABLE operation is the first to obtain a table lock.
Limitations
Query the parameter
In the
systenant or a user tenant, you can execute theSHOW PARAMETERSstatement to query the parameter or query theGV$OB_PARAMETERSview for the parameter.Modify the parameter
You can use the
ALTER SYSTEM SETstatement to modify the parameter in thesystenant or a user tenant.
Attributes
| Attribute | Description |
|---|---|
| Type | Boolean |
| Default value | FALSE |
| Value range | TRUE: specifies to enable table lock priorities.FALSE: specifies to disable table lock priorities. |
| Modifiable | Yes. You can use the ALTER SYSTEM SET statement to modify the parameter. |
| Effective upon OBServer node restart | No. The setting takes effect immediately. |
Considerations
Before you use gh-ost or OceanBase Developer Center (ODC) to perform an online DDL operation, set the enable_lock_priority parameter to TRUE for the corresponding tenant and query the GV$OB_PARAMETERS view to make sure that the setting takes effect for all servers in the tenant. After the online DDL operation is completed, change the value of the parameter to FALSE to avoid impact on your DML business.
Examples
Enable table lock priorities.
ALTER SYSTEM SET enable_lock_priority = TRUE;Query the value of the
enable_lock_priorityparameter.SHOW PARAMETERS LIKE 'enable_lock_priority';The query 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 | +-------+----------+----------------+----------+----------------------+-----------+-------+-----------------------------------------------------------------------------------------------------------------------------------+---------+--------+---------+-------------------+---------------+-----------+ 1 row in setDisable table lock priorities.
ALTER SYSTEM SET enable_lock_priority = FALSE;