Loading...
Loading...
Explore and manage the IBM i SQL plan cache including snapshots, event monitors, and procedure references. Use when user asks about: (1) plan cache services or procedures available, (2) plan cache snapshot files on the system, (3) plan cache event monitor status, (4) how to dump or manage the plan cache, (5) plan cache sizing or QSQSRVR job memory usage, or (6) SQL syntax for plan cache management operations.
npx skill4agent add ajshedivy/ibmi-agent-skills database-plan-cacheibmiSKILL_DIR# SKILL_DIR = directory containing this SKILL.md
# Examples: ./skills/database-plan-cache, ~/.claude/skills/database-plan-cache
# List all plan cache tools
ibmi tools --tools "$SKILL_DIR/tools/" --toolset database_plan_cache_default
# Run a specific tool
ibmi tool list_plan_cache_services --tools "$SKILL_DIR/tools/"
# Run with parameters
ibmi tool get_plan_cache_procedure_details --tools "$SKILL_DIR/tools/" --procedure-name DUMP_PLAN_CACHE
# Ad-hoc SQL for plan cache analysis
ibmi sql "SELECT * FROM QSYS2.SERVICES_INFO WHERE SERVICE_CATEGORY = 'DATABASE-PLAN CACHE'"devREAD_ONLYibmi tool list_plan_cache_services --tools "$SKILL_DIR/tools/"ibmi tool get_plan_cache_procedure_details --tools "$SKILL_DIR/tools/" --procedure-name DUMP_PLAN_CACHE_TOPNibmi tool list_plan_cache_snapshots --tools "$SKILL_DIR/tools/"ibmi tool get_plan_cache_management_sql --tools "$SKILL_DIR/tools/"CALL QSYS2.DUMP_PLAN_CACHE_TOPN(
FILESCHEMA => 'MYLIB',
FILENAME => 'PCTOP50',
TOPN => 50,
CATEGORY => 'TOTAL_TIME');SELECT QQJOB, QQUSER, QQUCNT, QQETIM, QQSTIM
FROM MYLIB.PCTOP50
ORDER BY QQETIM DESC
FETCH FIRST 20 ROWS ONLY;tools/database-plan-cache.yaml| Tool | Description |
|---|---|
| All plan cache services from SERVICES_INFO |
| Parameter info for a specific procedure |
| Find existing snapshot files across libraries |
| Metadata for a specific snapshot file |
| Active and inactive database monitors |
| QSQSRVR job memory and resource usage |
| Ready-to-use CALL statements for all operations |
ibmi tool <tool_name> --tools "$SKILL_DIR/tools/" # Execute
ibmi tool <tool_name> --tools "$SKILL_DIR/tools/" --dry-run # Preview SQL
ibmi tools show <tool_name> --tools "$SKILL_DIR/tools/" # View details