Okay friends, this one is a bit different. No benchmark, no lab scorecard today. Just a question I kept getting from other DBAs: "Where do I even start with all these AI words?" My answer: you already know most of them. You just call them something else.
A prompt is a SQL statement. A context window is a memory area. A tool call is a stored procedure call. An agent is a junior DBA with a runbook. Once that clicks, the rest gets a lot less scary. On-prem Unix box or cloud, it's all the same. Here's the map, a small example, and the security part I care about most.
1. What you need to follow along
Nothing new, really. Think of a slow database at 10:42. The old way: you open your own script folder, your notes, a few support notes, and you write the V$SESSION query yourself in SQL*Plus or SQLcl. Every step is yours. The new way: you type the question in plain English, a model drafts the SQL or explains the AWR section, and an agent can even run read-only queries for you through a tool.
| Piece | What it is in practice |
|---|---|
| A database you can break | A lab or a sanitized read-only replica. Never production first. |
| A client | SQL*Plus or SQLcl. SQLcl also ships an MCP server, so an AI client can talk to it. |
| A model | Local (data stays on your machine) or cloud (usually stronger, but your prompt leaves the building) |
| Its own account | A separate read-only user for the AI, never your DBA account |
That last row is the one people skip. It takes two minutes:
CREATE USER ai_ro IDENTIFIED BY "<a strong password>";
GRANT CREATE SESSION TO ai_ro;
GRANT READ ON hr.employees TO ai_ro; -- only what it needs, not the DBA role
And the password goes into the connection setup, never into the chat.
2. The translation, word by word
This is the heart of the video. Left column is what you'll read in AI articles, middle is what you already know from Oracle, right is why it matters day to day.
| AI term | What a DBA already knows | Why it matters |
|---|---|---|
| Prompt | SQL statement, with no parser | Oracle rejects bad syntax; a model guesses. Write prompts like a good ticket: goal, scope, instance, expected output. |
| Tokens | Database blocks | The unit of work, cost and every limit. Longer prompts and answers cost more, like more logical reads. |
| Context window | PGA work area | Working memory with a fixed size. Models use the start and end of a long context best; the middle gets lost. |
| Stateless API | A brand-new session per call | A chat only seems to remember because the app resends the whole history every time. |
| System prompt | spfile / logon trigger | Applied before every request: who the assistant is, the SQL dialect, the rules. |
| Hallucination | Stale statistics | Confident but wrong: a column that doesn't exist, a parameter from another version. NIST calls it confabulation. |
| Non-determinism | No plan baseline | Same question, different SQL. Fixed instructions, worked examples and a known test case make it steadier. |
| Grounding / RAG | Data dictionary lookup | Feed only the slice it needs: DBA_TAB_COLUMNS, DBA_COL_COMMENTS, a runbook page. Vector search is an index on meaning. |
| Tool call | Stored procedure call | The model only asks. The app runs it and returns the result. The model never touches the database directly. |
| MCP | Listener + JDBC driver | One protocol (JSON-RPC 2.0), many clients, many servers. |
| Workflow vs agent | Scheduler job chain vs junior DBA with a runbook | A workflow has fixed steps in code; an agent picks its next step from each result. |
| Human-in-the-loop | Change approval | The agent may find the root blocker. Killing that session is still your call. |
3. What you'd expect vs. what actually happens
These are the ones that trip DBAs up most, side by side:
| You'd expect | What actually happens |
|---|---|
| The chat remembers what I said yesterday | The API is stateless. The app resends the history; drop it and the model knows nothing. |
| A bigger context window means it reads everything equally well | The middle of a long context gets used worst. Put the important part at the start or the end. |
| Same question, same answer | Not guaranteed. Like a statement without a plan baseline, the result can change. |
| If the SQL runs without errors, it's correct | It can run fine and still answer the wrong question (see the blocking example below). |
| The AI connects to my database | It only asks for a tool call. Your app or MCP server does the work, with whatever privileges you gave it. |
The blocking example. "Which session blocks the most?" sounds clear, but is it the most waiters or the longest wait? Two generated queries can both run cleanly, one grouping by the waiting session and one by the blocking session, and only one of them answers you. The root of a blocking chain is right there in V$SESSION:
SELECT final_blocking_session, COUNT(*) AS waiters
FROM v$session
WHERE final_blocking_session_status = 'VALID'
GROUP BY final_blocking_session
ORDER BY waiters DESC;
An agent can run that read-only query all day. ALTER SYSTEM KILL SESSION still waits for you. (Session IDs and outputs in the video are illustrative.)
4. Where it goes wrong, and how to do better
The good part is real. A first draft of SQL in seconds, plain-English explanations of plans, wait events and error stacks, help on an engine you know less well (Postgres next to Oracle), and a lot less searching. The costs are real too: confident wrong answers, different results for the same question, tokens and time, and data that may leave your network. NIST also names a quieter one, over-reliance: you trust the tool because it sounds sure, and slowly lose the habit of checking it.
Prompt injection is SQL injection without bind variables. Instructions and data travel in the same text, so a comment in a table row or a line in a log file can say "ignore your rules". OWASP puts it at number one in its LLM list. There's no bind variable for prompts, so the fix is limiting what the model is allowed to do.
The rest of the security part, in DBA words:
| AI risk | DBA version | What I do about it |
|---|---|---|
| Sensitive data disclosure | Uncontrolled export | Classify before you paste, mask real values, local model for anything that shouldn't leave |
| Excessive agency | DBA role granted to an app user | Own read-only account, least privilege, human approval for anything high impact |
| The lethal trifecta | Private data + untrusted input + a way out | Never give one agent all three |
| Secrets in prompts | Password in a shell history | Passwords never go into the chat |
| No trail | Shared account, no audit | Separate user, so UNIFIED_AUDIT_TRAIL shows exactly what it ran. SQLcl's MCP server also tags MODULE / ACTION in V$SESSION and logs calls to DBTOOLS$MCP_LOG. |
| Testing on production | Same old mistake | Oracle's SQLcl docs say it too: no direct production access for the model, use a sanitized read-only replica. Lab, approval, restore point. |
5. What I'd take from this, and what would be worth testing later
My conclusion: new words, old habits. Least privilege, review before commit, test before production. If you already do those as a DBA, you're further along with AI than you think. The vocabulary is the only new part.
A few things would be worth trying in a lab some day, because the table above only tells half the story:
- Asking the same blocking question five times and counting how many different SQL statements come back.
- Planting a "ignore your rules" comment in a table row and seeing what an agent with a read-only account actually does with it.
- Giving the model only
DBA_TAB_COLUMNSoutput vs. nothing at all, and comparing how often it invents columns.
Which AI word confused you the most when you started? Tell me, maybe it belongs in the table.
Full video: You Already Speak AI on YouTube.
Comments
Post a Comment