feat: implement health_check for Oracle - #435
Merged
Merged
Conversation
Connection pool state from V$SESSION (user sessions other than the diagnostic one; TADDR marks an open transaction, LAST_CALL_ET gives the current call's or idle period's age) with the ceiling from the `sessions` parameter; buffer cache hit ratio from V$SYSSTAT (db block gets + consistent gets vs physical reads). Each section degrades to a `notes` entry when the connecting user lacks SELECT_CATALOG_ROLE / SELECT ANY DICTIONARY, matching the SQL Server connector's posture. Integration test accepts either populated metrics or the explanatory note; docs, CLAUDE.md and the TOML example list Oracle as supported. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0189BHv585xi8iqEp9JvmgKY
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Moderate implementation and test-coverage issues remain, and the skill support matrix is inconsistent.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Adds Oracle support to the opt-in health_check tool using dynamic performance views with privilege-aware fallback behavior.
Changes:
- Implements Oracle session and buffer-cache metrics.
- Adds Oracle integration coverage.
- Updates documentation and configuration examples.
| File | Summary |
|---|---|
src/connectors/oracle/index.ts |
Implements Oracle health metrics and fallback notes. Moderate finding (1 vote): handle V$SESSION.STATUS values beyond ACTIVE and INACTIVE. |
src/connectors/__tests__/oracle.integration.test.ts |
Adds health-check integration coverage. Moderate findings (1 vote each): add deterministic privileged-path and restricted-privilege tests. |
docs/tools/overview.mdx |
Lists Oracle health-check support. |
docs/tools/health-check.mdx |
Documents Oracle metrics and privileges. Nit (2 votes): also update skills/dbhub/SKILL.md to avoid contradictory support guidance. |
dbhub.toml.example |
Updates health-check configuration guidance. |
CLAUDE.md |
Updates architecture support documentation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Count only INACTIVE sessions as idle; KILLED / SNIPED / CACHED are transitional states that belong in the total but are neither active nor idle - Deterministic integration tests: connect as SYSTEM (same password as the app user in the test image) to grant SELECT_CATALOG_ROLE to the app user and create a user without it, then assert the populated path and the notes-only path separately - skills/dbhub/SKILL.md lists Oracle for health_check Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0189BHv585xi8iqEp9JvmgKY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes the one gap #433 called out:
health_checknow works on Oracle sources.Implementation (
src/connectors/oracle/index.ts)V$SESSION, counting user sessions other than the diagnostic one.ACTIVEsessions are active,INACTIVEones idle; the transitionalKILLED/SNIPED/CACHEDstates count toward the total only.TADDRnon-null marks an open transaction (idle-in-transaction);LAST_CALL_ETgives the age of the current call for active sessions or of the idle period otherwise. The ceiling is thesessionsparameter fromV$PARAMETER.idle_in_transaction_abortedis omitted: Oracle rolls back a failed statement on its own and leaves the transaction usable, so there is no aborted-but-open state.V$SYSSTAT: logical reads aredb block gets+consistent gets, physical reads arephysical reads, ratio via the sharedcomputeHitRatioPct.SELECT_CATALOG_ROLE/SELECT ANY DICTIONARYOracle reports the V$ views as non-existent, so each section falls back to anotesentry naming the grant instead of failing the whole call.Tests and docs
SELECT_CATALOG_ROLEto the app user and creates a second user without it. The privileged path asserts both sections populated with no notes; the restricted path asserts no sections and exactly the two notes. Both pass in CI.docs/tools/health-check.mdx(features, privilege table row),docs/tools/overview.mdx,skills/dbhub/SKILL.md, CLAUDE.md, anddbhub.toml.examplelist Oracle as supported.Review
Copilot's one inline finding and two summary-only findings (session status handling, deterministic tests) are addressed in the second commit.
🤖 Generated with Claude Code
https://claude.ai/code/session_0189BHv585xi8iqEp9JvmgKY