Cheat sheets · 11
Oracle + APEX quick reference
The connection details, URLs and commands you reach for every day.
Claude Code for Oracle developers
5 · Claude Code
Run an AI coding agent against a real Oracle project without letting it near what it must not touch, and without burning tokens.
Jump to the section01
Local stack connection
5 entries
- DB host / port
localhost / 1521- Service (PDB)
FREEPDB1- Admin user
SYSTEM- APEX URL
http://localhost:8080/ords/apex- SQL Developer Web
http://localhost:8080/ords/sql-developer
02
Docker lifecycle
5 entries
- Start
docker compose start- Stop (keep data)
docker compose stop- Remove
docker compose down- Full reset
docker compose down -v- Status
docker ps
03
APEXlang / SQLcl
3 entries
- Export app
apex export -applicationid 100 -exptype APEXLANG -dir ./app100- Import app
apex import -input ./app100/my-app- Connect
sql user/pwd@//host:1521/FREEPDB1
04
Quick SQL / PL-SQL
4 entries
- Top-N
FETCH FIRST 5 ROWS ONLY- Upsert
MERGE INTO t USING s ON (…) WHEN MATCHED THEN UPDATE … WHEN NOT MATCHED THEN INSERT …- Identity
id NUMBER GENERATED ALWAYS AS IDENTITY- Bulk
FORALL i IN ind.FIRST..ind.LAST INSERT …
05
Oracle DB AI snippets (Select AI: Autonomous AI Database)
4 entries
- Use profile
EXEC DBMS_CLOUD_AI.set_profile('HR_AI')- Ask
SELECT AI how many orders this month- Review SQL
SELECT AI showsql …- Vector top-5
ORDER BY VECTOR_DISTANCE(embedding, :q, COSINE) FETCH FIRST 5 ROWS ONLY
06
APEX AI quick refs
3 entries
- Enable
Workspace Utilities → Generative AI Services- Gen app
Create → Create App using Generative AI- Assistant
Code editor → APEX Assistant button
Claude Code for Oracle developers
Run an AI coding agent against a real Oracle project without letting it near what it must not touch, and without burning tokens.
07
Safe agent setup
5 entries
- Deny destructive commands
.claude/settings.json → "permissions": { "deny": ["Bash(git push --force:*)", "Bash(rm -rf:*)"] }- Keep secrets unreadable
"deny": ["Read(./.env)", "Read(./**/wallet/**)"]- Protect the settings themselves
"deny": ["Edit(.claude/settings.json)"]- Hash-checked apply
sha256sum -c apply.sql.sha256 && sql -S $DB_CONN @apply.sql- DB user for the agent
Least-privilege schema user; no DBA, no SYS, no prod wallet
08
Multi-agent workflow
5 entries
- Lead
- Owns the plan and the contracts; merges, never bulk-edits
- Worker lanes
- One lane per file set, so two writers never touch the same files
- Reviewer
- Adversarial: before a contract locks, when a test breaks twice, before done
- Traffic controller
- Queues merges, enforces lane limits, stops overlap
- Done means
- Tests run on a clean install, not "it compiled"
09
Token-saving rules
5 entries
- Right model per task
- Large model to plan and review; smaller model for mechanical edits and searches
- Focused check first
- Run the one test you touched before the full suite
- Retry limits in code
- MAX_RETRIES = 2 in the script, not "try until it works" in the prompt
- Small context
- Point at files and line numbers; don't paste whole exports
- Stop rule
- Same failure twice → stop and call the reviewer
10
SQLcl + Liquibase
7 entries
- Capture schema
lb generate-schema -split- Preview SQL
lb update-sql -changelog-file controller.xml- Deploy
lb update -changelog-file controller.xml- Status
lb status -changelog-file controller.xml- Tag a release
lb tag -tag v1.2.0- Roll back last change
lb rollback-count -count 1 -changelog-file controller.xml- Roll back to tag
lb rollback -tag v1.2.0 -changelog-file controller.xml
11
SQLcl projects
7 entries
- Start a project (git repo)
project init -name myapp -schemas APP -makeroot- Export objects to src/
project export- Stage changes from the git diff
project stage- Cut the release
project release -version 1.2.0- Build the artifact
project gen-artifact -version 1.2.0- Deploy the artifact
project deploy -file artifact/myapp-1.2.0.zip- Clean-install test
Deploy every release into an empty schema before you ship