← 返回 Skills 市场
39
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install dbskiter-db-lock-analyzer
功能描述
数据库锁分析与死锁检测,支持当前锁分析、死锁检测、锁等待链追踪。 使用场景: - 用户说"看锁" → 执行 analyze - 用户说"死锁" → 执行 deadlocks - 用户说"阻塞" → 执行 chains - 用户说"终止事务" → 执行 kill <事务ID> 用法: - dbskiter --ou...
使用说明 (SKILL.md)
锁分析 Skill
何时使用
当用户提到以下关键词时,使用此skill:
| 用户说法 | 执行命令 | 说明 |
|---|---|---|
| "看锁" | dbskiter --output-mode=ai --database=\x3Cname> lock analyze |
分析当前锁情况 |
| "死锁" | dbskiter --output-mode=ai --database=\x3Cname> lock deadlocks |
检测死锁 |
| "阻塞" | dbskiter --output-mode=ai --database=\x3Cname> lock chains |
追踪锁等待链 |
| "锁报告" | dbskiter --output-mode=ai --database=\x3Cname> lock report |
生成锁分析报告 |
| "终止事务" | dbskiter --output-mode=ai --database=\x3Cname> lock kill \x3Cid> |
终止阻塞事务 |
核心命令
1. 分析当前锁
dbskiter --database=\x3C数据库名> lock analyze
输出:总锁数、等待中锁数、已授予锁数
2. 检测死锁
dbskiter --database=\x3C数据库名> lock deadlocks
输出:死锁数量、涉及事务、解决建议
3. 追踪锁等待链
dbskiter --database=\x3C数据库名> lock chains
输出:锁等待链数量、链深度、阻塞源头
4. 终止事务
dbskiter --database=\x3C数据库名> lock kill \x3Ctransaction_id>
注意:谨慎使用,会强制终止事务
锁类型
- TABLE:表锁
- ROW:行锁
- METADATA:元数据锁
数据库支持情况
| 数据库 | 锁分析 | 死锁检测 | 锁等待链 | 说明 |
|---|---|---|---|---|
| MySQL | 完整支持 | 支持 | 支持 | 完全可用 |
| PostgreSQL | 完整支持 | 支持 | 支持 | 完全可用 |
| Oracle | 完整支持 | 支持 | 支持 | 完全可用 |
AI决策流程
场景1:用户说"看看锁情况"
步骤1:执行 dbskiter --database=\x3Cname> lock analyze
步骤2:查看锁统计信息
步骤3:如果有等待锁,执行 dbskiter --database=\x3Cname> lock chains 查看阻塞链
步骤4:总结锁情况给用户
场景2:用户说"有死锁吗"
步骤1:执行 dbskiter --database=\x3Cname> lock deadlocks
步骤2:如果有死锁,列出涉及的事务和SQL
步骤3:给出解决建议(如终止某个事务)
场景3:用户说"有阻塞"
步骤1:执行 dbskiter --database=\x3Cname> lock chains
步骤2:分析阻塞链,找出阻塞源头
步骤3:建议终止阻塞源头事务或优化业务逻辑
安全使用建议
This skill appears to do what it says (analyze locks, detect deadlocks, trace chains, and kill transactions), but it assumes a command-line tool named 'dbskiter' and database connectivity without declaring them. Before installing or enabling it: 1) Confirm you have a trusted 'dbskiter' binary on the agent host and verify its provenance/version; 2) Decide how database credentials will be provided (and ensure least privilege — read-only for analysis, separate privileged creds for any kill operations); 3) Consider adding safeguards (require explicit user confirmation before running any 'kill' command, restrict the skill to non-production databases, or log and audit its actions); 4) If you need to allow autonomous invocation, restrict the agent's ability to execute destructive commands or require explicit approval for transaction termination. If the maintainer can supply an explicit required-binaries list and clear credential/connection instructions, re-evaluate — currently the mismatch between declared requirements and runtime expectations is the main concern.
能力评估
Purpose & Capability
The skill clearly targets database lock analysis, deadlock detection, and killing transactions — functionality that matches the name/description. However, the runtime instructions rely entirely on a CLI tool named 'dbskiter' (and its --database argument) even though the skill metadata lists no required binary or install mechanism. The dependency on that CLI should have been declared.
Instruction Scope
SKILL.md instructs the agent to run shell commands (dbskiter ... lock analyze/deadlocks/chains/kill) which will interact with databases and can be destructive (kill <transaction_id>). The instructions do not describe how authentication/connection to the database is obtained (no env vars, config paths, or credential guidance), and they give the agent discretion to run 'kill', which can terminate production transactions. The scope is narrowly relevant but lacks safeguards and context.
Install Mechanism
This is an instruction-only skill (no install spec), so nothing is written to disk by the skill itself. That is low-risk in itself, but because it expects an external executable (dbskiter) without providing provenance or an install method, you cannot verify the origin or trustworthiness of that CLI from the skill package alone.
Credentials
The skill requests no environment variables or credentials in metadata, yet it requires access to databases. Practical use will require DB connection credentials or environment configuration outside the skill. The lack of declared primary credential or guidance on where credentials come from is a mismatch and a potential security/operational risk (accidental use of privileged credentials, or unclear credential storage).
Persistence & Privilege
The skill is not always-enabled and does not request special platform persistence. It does allow normal autonomous invocation (platform default). Combined with the ability to run destructive 'kill' commands, autonomous invocation increases risk, but that is a platform-level default rather than a property unique to this skill.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install dbskiter-db-lock-analyzer - 安装完成后,直接呼叫该 Skill 的名称或使用
/dbskiter-db-lock-analyzer触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of db-lock-analyzer skill.
- Supports database lock analysis, deadlock detection, and lock wait chain tracking.
- Command mappings for keywords like "看锁", "死锁", "阻塞", "终止事务", and "锁报告".
- Provides usage examples and supported database types: MySQL, PostgreSQL, Oracle.
- Includes step-by-step AI workflow for common locking issues.
元数据
常见问题
数据库锁分析与死锁检测 是什么?
数据库锁分析与死锁检测,支持当前锁分析、死锁检测、锁等待链追踪。 使用场景: - 用户说"看锁" → 执行 analyze - 用户说"死锁" → 执行 deadlocks - 用户说"阻塞" → 执行 chains - 用户说"终止事务" → 执行 kill <事务ID> 用法: - dbskiter --ou... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 39 次。
如何安装 数据库锁分析与死锁检测?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install dbskiter-db-lock-analyzer」即可一键安装,无需额外配置。
数据库锁分析与死锁检测 是免费的吗?
是的,数据库锁分析与死锁检测 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
数据库锁分析与死锁检测 支持哪些平台?
数据库锁分析与死锁检测 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 数据库锁分析与死锁检测?
由 magicCzc(@magicczc)开发并维护,当前版本 v1.0.0。
推荐 Skills