lu-query-triage-incident
Skill2 starsChanged 29 days agoMITView on GitHub
Use lu-query to triage an Oracle database incident - oracle_mcp_health_report for a readiness overview, list_active_sessions/list_blocked_sessions/list_locks/get_wait_events/get_session_longops for live sessions, get_session_sql_text and list_top_sql for what is running and what is expensive, get_instance_info/get_database_info/get_parameter/get_system_stats/get_db_time_model/list_datafile_io for the system, plus get_session_privs and get_session_roles.
In this repository45 other files it gives its agents.
- AGENTS.mdAGENTS.md
- api-and-interface-designSkill
- browser-testing-with-devtoolsSkill
- ci-cd-and-automationSkill
- code-review-and-qualitySkill
- code-reviewSkill
- code-simplificationSkill
- constraint-driven-developmentSkill
- debugging-and-error-recoverySkill
- deprecation-and-migrationSkill
- documentation-and-adrsSkill
- domain-modelingSkill
- doubt-driven-developmentSkill
- frontend-ui-engineeringSkill
- git-workflow-and-versioningSkill
- grill-meSkill
- grill-with-docsSkill
- implementSkill
- implement-specSkill
- improve-codebase-architectureSkill
- incremental-implementationSkill
- observability-and-instrumentationSkill
- performance-optimizationSkill
- planning-and-task-breakdownSkill
- prSkill
- security-and-hardeningSkill
- setup-matt-pocock-skillsSkill
- shipping-and-launchSkill
- source-driven-developmentSkill
- spec-driven-developmentSkill
- test-driven-developmentSkill
- to-specSkill
- to-ticketsSkill
- using-agent-skillsSkill
- wayfinderSkill
- writing-for-agentsSkill
- lu-query-audit-data-qualitySkill
- lu-query-audit-reportSkill
- lu-query-benchmark-sqlSkill
- lu-query-explore-schemaSkill
- lu-query-manage-schemaSkill
- lu-query-plan-data-changesSkill
- lu-query-query-dataSkill
- lu-query-tune-sqlSkill
- lu-query-use-plsqlSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
Every V$ value is a string or number from the instance.
- Very specific: line 35
If the V$ tools answer ORA-00942 or ORA-01031, the server returns a hint to grant SELECT ANY DICTIONARY (or per-view grants) to the …
- Very specific: line 62
Read-only. Still: V$ views on a busy instance can themselves be slow (full scans of V$SQL).
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Triage incidents with lu-query
When to use
- "Is the database healthy?", "who is blocking whom?", "what is the database busy with?", "which session runs this SQL?"
When not to use
- You want to optimise one statement → lu-query-tune-sql.
Workflow
- Start with the health report.
oracle_mcp_health_reportgives connectivity, version, catalog role, invalid objects, server config and audit state in one call. ReadoverallStatus(UP/DEGRADED/DOWN) and then the individualchecks- aWARNoncatalog-roleexplains laterORA-00942s on dictionary views. - Who is running what.
list_active_sessions(optionally filtered byusername/sid),get_session_longopsfor long operations with progress. - Who is waiting on whom.
list_blocked_sessions(with blocker sid/user), thenlist_locksfor the mode and object, andget_wait_eventsfor the current wait class. - What is expensive.
get_session_sql_text(needssid+serialNumfromlist_active_sessions) orlist_top_sqlordered bybuffer_gets(default) ordisk_reads/elapsed_time/executions/cpu_time. - If the instance looks wrong.
get_instance_info,get_database_info,get_parameter(e.g.open_cursors),get_system_stats,get_db_time_model,list_datafile_io. - Check your own standing.
get_session_privsandget_session_roles- the tools' own reach depends on them, so failures of the V$ tools are often a grants problem, not a database problem.
Reading results correctly
- Every V$ value is a string or number from the instance; empty arrays mean "nothing matches right now", not "tool broken".
list_active_sessionsincludes background processes (PMON,DBRMON…) withUSERNAME: null. Filter byusernamefor application sessions.get_session_sql_textrequires BOTHsidandserialNum- copy them fromlist_active_sessions, do not guess.LIKELY_UNUSED/ statistics fromlist_unused_indexesbelong to the tuning skill, not here.
Missing grants
If the V$ tools answer ORA-00942 or ORA-01031, the server returns a hint to grant SELECT ANY DICTIONARY (or per-view grants) to the connecting user. That is a database change owned by a DBA - report it, do not work around it.
Tool reference
| Tool | Signature | Purpose |
oracle_mcp_health_report | - | {overallStatus, databaseName, checks[]} |
list_active_sessions | username?, sid? | ACTIVE sessions with module/program and seconds since last call |
list_blocked_sessions | - | blocked session + blocker |
list_locks | - | held/requested locks with decoded mode and object |
get_session_sql_text | sid*, serialNum* | full SQL text of that session |
list_top_sql | limit?, orderBy? | top SQL by a metric |
get_wait_events | sid?, waitClass? | current waits from V$SESSION_WAIT |
get_session_longops | sid? | long operations with progress |
get_instance_info | - | instance name, host, version, uptime, status |
get_database_info | - | name, creation, log/open mode, role |
get_parameter | name? | init parameters from V$PARAMETER |
get_system_stats | - | cumulative V$SYSSTAT (DB time, parses, physical IO) |
get_db_time_model | - | V$SYS_TIME_MODEL (DB CPU vs DB time) |
list_datafile_io | - | datafiles with size, reads/writes and average IO time |
get_session_privs | - | granted vs effective system privileges |
get_session_roles | - | enabled roles |
Details: references/tools.md. Verified transcripts: references/examples.md.
Safety
Read-only. Still: V$ views on a busy instance can themselves be slow (full scans of V$SQL); keep limit small on list_top_sql.
Failure recovery
| Symptom | Cause | Action |
ORA-00942 on V$ tools | missing SELECT ANY DICTIONARY | surface the grant hint to a DBA |
health DEGRADED with catalog-role WARN | no SELECT_CATALOG_ROLE | dictionary views may be restricted; expect some tools to fail |
get_session_sql_text empty | session finished or serialNum stale | re-read list_active_sessions |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

