mcpField
O
oracledb

oracledb

github.com/clineData & databases40913 installsUpdated 15w ago
Repository

About oracledb

A Node.js skill for Oracle Database operations and diagnostics through scripts. It runs SQL and provides tools for inspecting query plans, sessions, schema objects, tables, tablespace usage, and resource-intensive SQL.

Key features

  1. 01Execute SQL statements
  2. 02Generate SQL execution plans
  3. 03List active database sessions
  4. 04Find invalid schema objects
  5. 05Inspect tables and tablespace usage
  6. 06Rank SQL by resource consumption

Use cases

  1. 01Running SQL against the connected database
  2. 02Analyzing a query plan without execution
  3. 03Checking active sessions and invalid objects
  4. 04Monitoring tablespace use and resource-heavy SQL

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/cline/skills --skill oracledb

After installing, type/oracledbin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

scripts/
execute_sql.js
get_query_plan.js
list_active_sessions.js
list_invalid_objects.js
list_tables.js
list_tablespace_usage.js
list_top_sql_by_resource.js

Details

From the project README

Usage

All scripts can be executed using Node.js. Replace <param_name> and <param_value> with actual values.

Bash: node <skill_dir>/scripts/<script_name>.js '{"<param_name>": "<param_value>"}'

PowerShell: node <skill_dir>/scripts/<script_name>.js '{\"<param_name>\": \"<param_value>\"}'

Note: The scripts automatically load the environment variables from various .env files. Do not ask the user to set vars unless skill executions fails due to env var absence.

Scripts

execute_sql

Executes any SQL statement.

Parameters
NameTypeDescriptionRequiredDefault
sqlstringThe SQL to execute.Yes

get_query_plan

Generate a full execution plan for a single SQL statement using EXPLAIN PLAN. This can be used to analyze query performance without execution. Requires the SQL statement as input as a parameter.

Parameters
NameTypeDescriptionRequiredDefault
querystringThe SQL statement for which you want to generate plan (omit the EXPLAIN keyword).Yes

list_active_sessions

List the top N (default 50) currently running database sessions (STATUS='ACTIVE'), showing SID, OS User, Program, and the current SQL statement text.


list_invalid_objects

Lists all database objects that are in an invalid state, requiring recompilation (e.g., procedures, functions, views).


list_tables

Lists all user tables in the connected schema, including segment size, row count, and last analyzed date. Filters by a comma-separated list of names. If names are omitted, lists all tables in the current user's schema.


list_tablespace_usage

List tablespace names, total size, free space, and used percentage to monitor storage utilization.


list_top_sql_by_resource

List the top N (default 5) SQL statements from the library cache based on a chosen resource metric (CPU, I/O, or Elapsed Time). Shows SQL ID, execution count, buffer gets, disk reads, CPU time, and elapsed time.


Comments

Markdown supported