接口功能介绍
分页查询数据库锁表。
接口约束
无
URI
GET /v2/operation/locks
路径参数
无
Query参数
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
prodInstId | 是 | String | 产品实例id,涉及实例的接口一律使用产品实例id | cb236d462b924ef7bfba5ecf1d61de2b | |
rdsProdInstId | 否 | String | rds产品实例id,涉及实例的接口一律使用产品实例id | 5485 | |
type | 是 | String | 锁类型,locks、transactions、lockwaits、showopentables | transactions | |
pageNow | 否 | Integer | 当前页,若为空或小于1,默认是1 | 1 | |
pageSize | 否 | Integer | 页大小,若为空或小于1,默认是10 | 10 | |
info | 否 | String | 关键字,模糊匹配 | dbproxy |
请求参数
请求头header参数
无
请求体body参数
无
响应参数
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
code | 是 | String | 返回码 取值范围:0表示成功,1表示失败 | 0 | |
message | 是 | String | 结果描述 | success | |
result | 否 | Array of Objects | 返回对象,对象类型与type有关,若无该字段或该字段为null或者空列表,都代表返回对象为空。 | result |
表 result
type=locls
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 | |
---|---|---|---|---|---|---|
lock_id | 是 | String | 锁id | 5900:33:4:3 | ||
lock_trx_id | 是 | String | 事务id | 5900 | ||
lock_mode | 是 | String | 锁模式 | X,GAP | ||
lock_type | 是 | String | 锁类型 | RECORD | ||
lock_table | 是 | String | 加锁的表 | dbproxytest.test | ||
lock_index | 否 | String | 锁住的索引 | idx_name | ||
lock_space | 否 | Long | 锁对象的space_id | 33 | ||
lock_page | 否 | Long | 事务锁定页的数量,若是表锁,则为null | 4 | ||
lock_rec | 否 | Long | 事务锁定行的数量,若是表锁,则为null | 3 | ||
lock_date | 否 | String | 事务锁定记录的主键,若是表锁,则为null | 'id',2 |
type=transactions
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 | |
---|---|---|---|---|---|---|
trx_id | 是 | String | 事务ID | 582666 | ||
trx_state | 是 | String | 事务的状态 | RUNNING | ||
trx_started | 是 | date | 事务的开始时间 | 2022-10-17T18:54:29 | ||
trx_requested_lock_id | 否 | String | 等待事务的锁ID | 3 | ||
trx_wait_started | 否 | date | 事务等待开始的事件 | null | ||
trx_weight | 是 | Long | 事务的权重 | 0 | ||
trx_mysql_thread_id | 是 | Long | MySQL中的线程ID | 90 | ||
trx_query | 否 | String | 事务运行的SQL 语句 | 0 | ||
trx_operation_state | 否 | String | 事务当前操作状态 | null | ||
trx_tables_in_use | 是 | Long | 当前事务执行的 SQL 中使用的表的个数 | 0 | ||
trx_tables_locked | 是 | Long | 当前执行 SQL 的行锁数量 | 1 | ||
trx_lock_structs | 是 | Long | 事务保留的锁数量 | 2 | ||
trx_lock_memory_bytes | 是 | Long | 事务锁住的内存大小,byte | 1160 | ||
trx_rows_locked | 是 | Long | 事务锁住的记录数 | 1 | ||
trx_rows_modified | 是 | Long | 事务更改的行数 | 1 | ||
trx_concurrency_tickets | 是 | Long | 事务并发票数 | 0 | ||
trx_isolation_level | 是 | String | 当前事务的隔离级别 | READ COMMITTED | ||
trx_unique_checks | 是 | Integer | 是否打开唯一性检查的标识 | 1 | ||
trx_foreign_key_checks | 是 | Integer | 是否打开外键检查的标识 | 1 | ||
trx_last_foreign_key_error | 否 | String | 最后一次的外键错误信息 | null | ||
trx_adaptive_hash_latched | 是 | Integer | 自适应散列索引是否被当前事务锁住的标识 | 0 | ||
trx_adaptive_hash_timeout | 是 | Long | 是否立刻放弃为自适应散列索引搜索 LATCH 的标识 | 0 | ||
trx_is_read_only | 是 | Integer | 事务是否为只读 | 0 | ||
trx_autocommit_non_locking | 是 | Integer | 是否开启了autocommit | 0 |
type=lockwaits
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 | |
---|---|---|---|---|---|---|
requesting_trx_id | 是 | String | 申请锁资源的事务ID | 11188391835 | ||
requested_lock_id | 是 | String | 申请的锁的ID | 11188391835:5900:5:6 | ||
blocking_trx_id | 是 | String | 阻塞的事务ID | 11184617003 | ||
blocking_lock_id | 是 | String | 阻塞的锁的ID | 11184617003:5900:5:6 |
type=showopentables
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 | |
---|---|---|---|---|---|---|
database | 是 | String | 数据库名称 | dbproxytest_1 | ||
table | 是 | String | 表名称 | test | ||
In_use | 是 | Integer | 表当前被查询使用的次数 | 11 | ||
Name_locked | 是 | Integer | 表名称是否被锁定,是:1,否:0 | 0 |
请求示例
请求头header
无
请求体body
无
响应示例
{
"code": 0,
"message": "success",
"result": [
{
"trx_id": "582666",
"trx_state": "RUNNING",
"trx_started": "2022-10-17T18:54:29",
"trx_weight": 3,
"trx_mysql_thread_id": 90,
"trx_tables_in_use": 0,
"trx_tables_locked": 1,
"trx_lock_structs": 2,
"trx_lock_memory_bytes": 1160,
"trx_rows_locked": 1,
"trx_rows_modified": 1,
"trx_concurrency_tickets": 0,
"trx_isolation_level": "READ COMMITTED",
"trx_unique_checks": 1,
"trx_foreign_key_checks": 1,
"trx_adaptive_hash_latched": 0,
"trx_adaptive_hash_timeout": 0,
"trx_is_read_only": 0,
"trx_autocommit_non_locking": 0
}
]
}
状态码
请参考 状态码说明。