---
title: "锁函数概述 - OceanBase 数据库 V4.2.5 | OceanBase 文档中心"
description: 锁函数概述 OceanBase 数据库 MySQL 模式支持用于操作锁的函数，如下表所示。 函数名称 描述 GET_LOCK 获取命名锁。 IS_FREE_LOCK 指定的锁是否空闲。 IS_USED_LOCK 指定的锁是否正在使用。 RELEASE_ALL_LOCKS 释放当前会话所有持有的锁。 RELEASE_L…
image: https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*OSPzQ6GUQF4AAAAAQHAAAAgAeiGDAQ/original
---
切换语言

- 中文站 - 简体中文
- International - English
- 日本站 - 日本語

文档反馈![](https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*P8CuR4UJ_FkAAAAAAAAAAAAADiGDAQ/original) OceanBase 数据库分布式版 - V 4.2.5 LTS

# 锁函数概述

更新时间：2026-07-15 20:42:47

[编辑](https://github.com/oceanbase/oceanbase-doc/edit/V4.2.5/zh-CN/700.reference/500.sql-reference/100.sql-syntax/200.common-tenant-of-mysql-mode/400.functions-of-mysql-mode/920.lock-functions-of-mysql-mode/100.lock-functions-overview-of-mysql-mode.md)  

OceanBase 数据库 MySQL 模式支持用于操作锁的函数，如下表所示。

| **函数名称** | **描述** |
| --- | --- |
| [GET_LOCK](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000001504329) | 获取命名锁。 |
| [IS_FREE_LOCK](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000001504333) | 指定的锁是否空闲。 |
| [IS_USED_LOCK](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000001504330) | 指定的锁是否正在使用。 |
| [RELEASE_ALL_LOCKS](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000001504331) | 释放当前会话所有持有的锁。 |
| [RELEASE_LOCK](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000001504328) | 释放指定的锁。 |

 上一篇 下一篇 ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ)[AI](https://www.oceanbase.com/obi) 咨询热线
