GitHub Copilot Enterprise for Oracle developers: PL/SQL, APEX and SQLcl
By Mohamed Harby · Verified against GitHub's Copilot documentation and Oracle's SQLcl User's Guide · Last verified
Teach Copilot your PL/SQL and APEXlang rules with repository instructions and prompt files, then connect agent mode to a local Oracle database through the SQLcl MCP Server.
GitHub Copilot knows a lot of general SQL, but it doesn't know your rules: bind variables only, no WHEN OTHERS THEN NULL, stable APEX Static IDs, SQLcl as the deploy tool. This guide shows how to write those rules down once so Copilot applies them in every chat, how to keep reusable prompts for PL/SQL refactoring and APEXlang edits, and how to let Copilot's agent mode query a local Oracle AI Database 26ai Free through the SQLcl MCP Server.
The database side uses the stack from Install Oracle AI Database 26ai + APEX with Docker: host localhost, port 1521, service FREEPDB1. The APEXlang workflow is the one from Vibe-code Oracle APEX with APEXlang.
Pick the right Copilot plan
GitHub's current plans are Copilot Free, Copilot Student, Copilot Pro, Copilot Pro+ and Copilot Max for individuals, and Copilot Business and Copilot Enterprise for organizations. Custom instructions, prompt files, agent mode, MCP servers and Copilot CLI are available on the individual plans too. Copilot code review on pull requests is not included in Copilot Free (Free only offers "Review selection" in VS Code).
What the organization plans add is control. Admins assign seats, set policies (for example whether MCP servers or Copilot CLI may be used) and configure content exclusion. At the time of writing GitHub lists Copilot Business at $19 and Copilot Enterprise at $39 per seat per month; check GitHub's plans page for the current price and AI-credit allowance.
Write your Oracle rules into copilot-instructions.md
Create .github/copilot-instructions.md at the root of the repository. Copilot adds it to every chat request made in the context of the repository: Copilot Chat in VS Code, Copilot CLI, Copilot code review and the cloud agent all read it. Write short, checkable rules, not essays. Here is a starting point for a repository with PL/SQL packages and an APEXlang app:
# Copilot instructions for this repository This repository holds Oracle PL/SQL packages and an Oracle APEX app exported as APEXlang. ## Stack - Oracle AI Database 26ai. Local development uses the Free container, service FREEPDB1. - PL/SQL packages live in db/packages as .pks (spec) and .pkb (body) files. - The APEX app lives in apex/my-app as APEXlang .apx files. - SQLcl is the only deploy tool. Never suggest running scripts in SQL Developer by hand. ## PL/SQL rules - Use bind variables. Never build SQL by concatenating values into a string. - If dynamic SQL is unavoidable, use EXECUTE IMMEDIATE ... USING binds and DBMS_ASSERT for object names. - Never write WHEN OTHERS THEN NULL. Log the error and re-raise with RAISE. - Do not COMMIT inside reusable package procedures; the caller owns the transaction. - Keep public signatures in the .pks stable. Add new procedures instead of changing existing parameters. - Prefer set-based SQL over row-by-row loops. Use BULK COLLECT with LIMIT for large sets. ## APEXlang rules - Never rename existing components and never change their Static IDs. - Refer to page items by name (for example :P12_STATUS) and to components by Static ID. - After editing .apx files, tell me to run: apex validate -input apex/my-app ## Deploy - Database objects: SQLcl scripts under db/, run with sql -S. - APEX app: apex validate, then apex import -input apex/my-app, run in SQLcl. - Never connect to production. Only the saved SQLcl connection for development may be used.
Rules that apply only to some files
For rules that only matter in certain folders, add path-specific files under .github/instructions/. The file name must end in .instructions.md, and the applyTo front matter takes comma-separated glob patterns. Save this one as .github/instructions/plsql.instructions.md:
--- applyTo: "db/**/*.pks,db/**/*.pkb,db/**/*.sql" --- Every procedure that changes data must have an exception handler that logs the error with the package name and re-raises it. Use %TYPE and %ROWTYPE for variables that hold column values.
Copilot also reads AGENTS.md files as agent instructions. If your team already keeps one, Copilot Chat in VS Code and Copilot CLI use it alongside copilot-instructions.md, so you don't need to duplicate the rules.
Keep reusable prompts in prompt files
Prompt files are saved prompts you run as slash commands. Put them in .github/prompts/ with the .prompt.md extension. Save the file below as .github/prompts/refactor-plsql.prompt.md and run it from Copilot Chat by typing /refactor-plsql. The agent: 'agent' line switches the chat to agent mode when the prompt runs. GitHub marks prompt files as public preview, supported in VS Code, Visual Studio and JetBrains IDEs.
--- agent: 'agent' description: 'Refactor one PL/SQL package without changing its public API' --- Refactor the PL/SQL package in the file I attach. Rules: - Keep every public signature in the .pks exactly as it is. - Replace string-concatenated SQL with bind variables. - Replace row-by-row loops with set-based SQL where the result is identical. - Remove WHEN OTHERS THEN NULL; log and re-raise instead. - Do not add COMMIT or ROLLBACK. First list the changes you plan to make and wait for my confirmation. Then edit the .pkb file and explain each change in one line.
Prompt patterns that work for Oracle code
Whether you use a prompt file or type the prompt, the same pattern holds: name the exact file, state what must not change, and ask for a plan before the edit. For a PL/SQL refactor:
Refactor #file:db/packages/order_api.pkb. Keep the spec in order_api.pks unchanged. Replace the concatenated SQL in get_orders with bind variables, and turn the cursor loop in close_old_orders into one UPDATE. Show me the plan first, then make the edit.
For an APEXlang edit, point at the export folder and protect the identifiers. APEXlang refers to components by Static ID and to page items by name, so a renamed component breaks references elsewhere in the app:
In apex/my-app/pages, add a "Status" select list to page 12 with the static values Open, In Progress and Closed, default Open. Do not rename existing components or change any Static ID. When you are done, list the .apx files you changed.
Then review the diff in Git, run apex validate and import into a development workspace with SQLcl, exactly as you would with any other agent.
Connect agent mode to Oracle with the SQLcl MCP Server
SQLcl includes an MCP server. An MCP client such as Copilot starts it with sql -mcp. In SQLcl 26.3 it exposes tools such as list-connections, connect, disconnect, run-sql, run-sqlcl and schema-information, plus newer ones (context_retrieve, annotation_generate, skill_sync, request_status). Oracle's documentation lists SQLcl 25.2.0 or later and a Java runtime, version 17 or 21.
The server only sees connections saved in SQLcl's connection store (in ~/.dbtools), and only those saved with their password. Save one for a development schema in your local FREEPDB1. Use the schema you develop in, never SYS or SYSTEM:
sql /nolog SQL> conn -save ora26ai_dev -savepwd app_dev/<password>@//localhost:1521/FREEPDB1 SQL> exit
Next, create .vscode/mcp.json in the repository. Replace /path/to/sqlcl with the absolute path to your SQLcl folder (on Windows, for example C:/tools/sqlcl/bin/sql.exe):
{
"servers": {
"sqlcl": {
"command": "/path/to/sqlcl/bin/sql",
"args": ["-mcp"]
}
}
}Save the file and click Start above the server entry. In Copilot Chat, open the agents dropdown at the bottom of the chat view and choose Agent. Then ask a question that needs the database:
Use the sqlcl tools. Connect to ora26ai_dev, list the invalid objects in my schema, and show me the compile errors for each one. Do not change anything in the database.
Copilot works through list-connections, connect and run-sql. Read each tool call and the SQL it carries in the chat before you let it continue. If you use Oracle's SQL Developer for VS Code extension, Oracle's documentation says it registers the SQLcl MCP Server for Copilot automatically, so you only need a saved connection.
💡 Keep the restrict level
-R in args (for example ["-R","1","-mcp"]), but there is rarely a reason to. SQLcl also logs every MCP interaction in the DBTOOLS$MCP_LOG table and tags its queries with a /* LLM in use ... */ comment, so you can audit what the agent ran.Use Copilot CLI in the terminal
Copilot CLI brings the same agent to your terminal. Install it with npm (Node.js 22 or later) or WinGet. On Windows it needs PowerShell 6 or later:
npm install -g @github/copilot # or, on Windows: winget install GitHub.Copilot
Run copilot in the repository and sign in with /login the first time. The CLI reads your copilot-instructions.md, path-specific instructions and AGENTS.md. Add the SQLcl MCP Server to it with copilot mcp add (it is saved to ~/.copilot/mcp-config.json), and use --deny-tool to block commands the agent must never run:
copilot mcp add sqlcl -- /path/to/sqlcl/bin/sql -mcp copilot --deny-tool='shell(rm)' --deny-tool='shell(git push)'
A custom agent for PL/SQL review
Custom agents are Markdown profiles with a name and description in the front matter and instructions in the body. Save this as .github/agents/plsql-reviewer.agent.md; Copilot CLI lists it under /agent, and the cloud agent and VS Code can use it too:
--- name: plsql-reviewer description: Reviews PL/SQL changes for bind variables, exception handling and transaction control without editing files --- You review PL/SQL code. Do not edit files. For each finding, give the file, the line, the rule it breaks (from .github/copilot-instructions.md) and a corrected snippet.
If you already use Harby's Skills Pack, its SKILL.md files work in Copilot as agent skills: put each skill in its own folder under .github/skills/ (for example .github/skills/plsql/SKILL.md). Agent mode in VS Code, Copilot CLI, code review and the cloud agent load a skill when it is relevant to the task.
Let Copilot review your pull requests
Assign Copilot as a reviewer on a pull request, or turn on automatic reviews in your settings or with a repository ruleset. Copilot code review reads .github/copilot-instructions.md and your .instructions.md files from the pull request's head branch, so your PL/SQL rules become review comments. By default its reviews don't count toward required approvals, so a human still approves the merge.
Enterprise controls: policies, data and content exclusion
- MCP policy: for Copilot Business and Copilot Enterprise users, MCP only works when the MCP servers in Copilot policy is enabled. It used to be off by default; from 22 October 2026 GitHub enables unconfigured features by default, so whether it is on depends on what your admin set. If the SQLcl server doesn't start, ask your organization or enterprise owner.
- Copilot CLI and agent mode can also be turned off by policy. If you don't see Agent in the dropdown, ask your administrator.
- Content exclusion (Copilot Business and Copilot Enterprise) is set per repository, organization or enterprise under Copilot → Content exclusion, with path patterns such as
"/db/secrets/**". - Organization instructions set by an owner apply to Copilot Chat, code review and the cloud agent on GitHub.com, not to VS Code or Copilot CLI. Keep project rules in the repository.
⚠ What Copilot sees, and what exclusion doesn't cover
Check your understanding
Check your understanding
0% · 0/3Where do repository-wide Copilot instructions live?
Which connections can the SQLcl MCP Server use?
Does content exclusion stop agent mode from reading an excluded file?
Get the Oracle + AI digest
One email when a new tested guide, template or APEX release note lands — English or Arabic. No spam; unsubscribe anytime.
Need this delivered?
Request a quote