agentleFS
zademyzademy/lu-query/skills/lu-query-triage-incident/SKILL.md

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.

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
  1. Distinctive:

    Every V$ value is a string or number from the instance.

    line 28
  2. Very specific:

    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 …

    line 35
  3. Very specific:

    Read-only. Still: V$ views on a busy instance can themselves be slow (full scans of V$SQL).

    line 62

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. Start with the health report. oracle_mcp_health_report gives connectivity, version, catalog role, invalid objects, server config and audit state in one call. Read overallStatus (UP / DEGRADED / DOWN) and then the individual checks - a WARN on catalog-role explains later ORA-00942s on dictionary views.
  2. Who is running what. list_active_sessions (optionally filtered by username/sid), get_session_longops for long operations with progress.
  3. Who is waiting on whom. list_blocked_sessions (with blocker sid/user), then list_locks for the mode and object, and get_wait_events for the current wait class.
  4. What is expensive. get_session_sql_text (needs sid + serialNum from list_active_sessions) or list_top_sql ordered by buffer_gets (default) or disk_reads / elapsed_time / executions / cpu_time.
  5. 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.
  6. Check your own standing. get_session_privs and get_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_sessions includes background processes (PMON, DBRMON…) with USERNAME: null. Filter by username for application sessions.
  • get_session_sql_text requires BOTH sid and serialNum - copy them from list_active_sessions, do not guess.
  • LIKELY_UNUSED / statistics from list_unused_indexes belong 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

ToolSignaturePurpose
oracle_mcp_health_report-{overallStatus, databaseName, checks[]}
list_active_sessionsusername?, 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_textsid*, serialNum*full SQL text of that session
list_top_sqllimit?, orderBy?top SQL by a metric
get_wait_eventssid?, waitClass?current waits from V$SESSION_WAIT
get_session_longopssid?long operations with progress
get_instance_info-instance name, host, version, uptime, status
get_database_info-name, creation, log/open mode, role
get_parametername?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

SymptomCauseAction
ORA-00942 on V$ toolsmissing SELECT ANY DICTIONARYsurface the grant hint to a DBA
health DEGRADED with catalog-role WARNno SELECT_CATALOG_ROLEdictionary views may be restricted; expect some tools to fail
get_session_sql_text emptysession finished or serialNum stalere-read list_active_sessions

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.