db-lock-analyzer

数据库锁分析与死锁检测,支持当前锁分析、死锁检测、锁等待链追踪。 使用场景: - 用户说"看锁" → 执行 analyze - 用户说"死锁" → 执行 deadlocks - 用户说"阻塞" → 执行 chains - 用户说"终止事务" → 执行 kill <事务ID> 用法: - dbskiter --output-mode=ai --database=<name> lock analyze - dbskiter --output-mode=ai --database=<name> lock deadlocks - dbskiter --output-mode=ai --database=<name> lock chains - dbskiter --output-mode=ai --database=<name> lock kill <transaction_id>

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "db-lock-analyzer" with this command: npx skills add magicczc/dbskiter-db-lock-analyzer

锁分析 Skill

何时使用

当用户提到以下关键词时,使用此skill:

用户说法执行命令说明
"看锁"dbskiter --output-mode=ai --database=<name> lock analyze分析当前锁情况
"死锁"dbskiter --output-mode=ai --database=<name> lock deadlocks检测死锁
"阻塞"dbskiter --output-mode=ai --database=<name> lock chains追踪锁等待链
"锁报告"dbskiter --output-mode=ai --database=<name> lock report生成锁分析报告
"终止事务"dbskiter --output-mode=ai --database=<name> lock kill <id>终止阻塞事务

核心命令

1. 分析当前锁

dbskiter --database=<数据库名> lock analyze

输出:总锁数、等待中锁数、已授予锁数

2. 检测死锁

dbskiter --database=<数据库名> lock deadlocks

输出:死锁数量、涉及事务、解决建议

3. 追踪锁等待链

dbskiter --database=<数据库名> lock chains

输出:锁等待链数量、链深度、阻塞源头

4. 终止事务

dbskiter --database=<数据库名> lock kill <transaction_id>

注意:谨慎使用,会强制终止事务

锁类型

  • TABLE:表锁
  • ROW:行锁
  • METADATA:元数据锁

数据库支持情况

数据库锁分析死锁检测锁等待链说明
MySQL完整支持支持支持完全可用
PostgreSQL完整支持支持支持完全可用
Oracle完整支持支持支持完全可用

AI决策流程

场景1:用户说"看看锁情况"

步骤1:执行 dbskiter --database=<name> lock analyze
步骤2:查看锁统计信息
步骤3:如果有等待锁,执行 dbskiter --database=<name> lock chains 查看阻塞链
步骤4:总结锁情况给用户

场景2:用户说"有死锁吗"

步骤1:执行 dbskiter --database=<name> lock deadlocks
步骤2:如果有死锁,列出涉及的事务和SQL
步骤3:给出解决建议(如终止某个事务)

场景3:用户说"有阻塞"

步骤1:执行 dbskiter --database=<name> lock chains
步骤2:分析阻塞链,找出阻塞源头
步骤3:建议终止阻塞源头事务或优化业务逻辑

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Web3

ATXSwap

Manage ATX on BSC with wallet creation, price and balance queries, PancakeSwap V3 swaps, liquidity operations, and BNB/ERC20 transfers. Use when the user men...

Registry SourceRecently Updated
Web3

Carbon DeFi

Use this skill when the user wants to create or manage on-chain maker trading strategies on Carbon DeFi. Triggers include: "place a limit order", "create a r...

Registry SourceRecently Updated
Web3

YiHui Agent Swarm

Multi-agent orchestration framework for OpenClaw. Define roles, route tasks, manage state, and coordinate agent teams using structured YAML configs and a pro...

Registry SourceRecently Updated
330Profile unavailable
Web3

SwarmHaul

Connect to SwarmHaul — multi-agent coordination protocol on Solana. Register your agent, bid on task legs, earn devnet SOL per leg confirmed on-chain.

Registry SourceRecently Updated
280Profile unavailable