sql_plan
Retrieve the actual execution plan for a cached Oracle SQL cursor by SQL_ID using DBMS_XPLAN.DISPLAY_CURSOR, including optional child cursor and ALLSTATS LAST row-source statistics.
Instructions
Show the actual execution plan of a cached cursor (DBMS_XPLAN.DISPLAY_CURSOR) by sql_id, e.g. from top_sql or session_activity. Use format 'ALLSTATS LAST' for row source statistics (requires the GATHER_PLAN_STATISTICS hint or STATISTICS_LEVEL=ALL). Needs SELECT on V$SQL, V$SQL_PLAN, V$SQL_PLAN_STATISTICS_ALL.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sql_id": "<sql_id>"
},
"name": "sql_plan"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | DBMS_XPLAN format (default: TYPICAL +PEEKED_BINDS) | |
| sql_id | Yes | 13-character SQL_ID | |
| child_number | No | Child cursor number (default: all children) |