一键导入
control-sessions
Control active sessions by terminating problematic sessions, managing runaway queries, and handling blocking situations
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Control active sessions by terminating problematic sessions, managing runaway queries, and handling blocking situations
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Manage delayed request queues including workload, system, and utility queues to release blocked requests or abort unnecessary items
**Autonomously create** filters, throttles, and classification rules to implement new workloads or manage workload lifecycle in response to changing operational needs
Track query execution using real-time resources, analyze query bands, access query logs, and identify performance patterns across the Teradata system
Monitor AMP processor load, system physical resources, and capacity using real-time resources to track system health and identify performance bottlenecks
Monitor active Teradata sessions using real-time resources, view SQL execution details, identify blocking issues, and optionally take control actions
Monitor workload definitions, distribution, and TASM statistics using real-time resources to understand classification effectiveness and workload performance
| name | control-sessions |
| description | Control active sessions by terminating problematic sessions, managing runaway queries, and handling blocking situations |
Manage and control active database sessions including terminating runaway queries, resolving blocking situations, and handling problematic sessions to maintain system health.
show_sessions - View all active sessionsshow_sql - Review SQL for specific sessionterminate_session - Kill a specific sessiondetect_blocking - Identify blocking sessionsshow_top_consumers - Find resource-heavy sessionsIdentify Problem Sessions
show_sessions to see all active sessionsshow_top_consumers to find resource-heavy sessionsdetect_blocking if blocking is suspectedInvestigate Session Activity
show_sql to see what the session is doingAssess Impact
Determine Action
Terminate When:
Don't Terminate When:
Execute Termination
terminate_session with session IDFollow Up
User: "There's a query using 90% CPU for hours, please kill it"
Action:
1. Use show_top_consumers to identify the session
2. Call show_sql to see the query
3. Verify it's actually problematic (not critical batch)
4. Document: "Session 12345, user john_doe, cartesian join consuming 90% CPU"
5. Call terminate_session(12345)
6. Confirm termination: "Session terminated"
7. Notify user: "Killed runaway query, check for missing join condition"
User: "Critical report is blocked, unblock it"
Action:
1. Use detect_blocking to identify blocker
2. Check show_sql for blocking session - is it legitimate?
3. Estimate how long blocker will run
4. Decision: Blocker is stuck DDL from 2 hours ago
5. Call terminate_session on blocker
6. Verify blocked session proceeds
7. Report: "Terminated blocking session 67890, report now running"
8. Investigate why DDL was stuck
User: "Clean up sessions from users who went home"
Action:
1. Use show_sessions to see active sessions
2. Filter for sessions idle > 4 hours or off-hours activity
3. Check show_sql to verify idle (no active query)
4. Identify truly orphaned (user offline, session idle)
5. Terminate orphaned sessions one by one
6. Report: "Terminated 8 orphaned sessions, freed resources"
7. Recommend: "Enable idle session timeout policy"
User: "I accidentally started a huge query, can you kill my session?"
Action:
1. Use show_sessions to find user's session
2. Verify ownership matches requesting user
3. Call show_sql to confirm it's the query they want killed
4. Terminate without extensive investigation (user authorized)
5. Confirm: "Session terminated as requested"
6. Advise: "Check your WHERE clause before rerunning"
User: "System is at 99% CPU, we need to shed load now"
Action:
1. Use show_top_consumers to identify heaviest sessions
2. Quick review with show_sql to avoid killing critical work
3. Prioritize terminating:
- Ad-hoc/development queries over production
- Newer sessions over long-running
- Non-critical users over critical
4. Terminate top 3-5 consumers
5. Monitor system recovery with monitor_amp_load
6. Report actions taken and system status
7. Investigate root cause after stabilization