skills/database-management/SKILL.md
Use when creating Autonomous Databases, troubleshooting wallet connection failures, managing PDBs, optimizing ADB costs, or selecting clone types. Covers connection service cost impact, password complexity failures, stop/start cost trap, clone type consequences, Always-Free limits, and PDB lifecycle gotchas.
npx skillsauth add acedergren/agentic-tools database-managementInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
4 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
❌ NEVER use HIGH service name for non-critical workloads (3x cost trap)
ADB service names:
- HIGH: Dedicated OCPU, 1× concurrency per OCPU, highest priority
- MEDIUM: Shared OCPU, 2× concurrency per OCPU
- LOW: Most sharing, 3× concurrency per OCPU
# WRONG - using HIGH for background jobs
connection_string = adb_connection_strings["high"] # 3x wasted OCPU-hours!
# RIGHT - match service to workload
connection_string = adb_connection_strings["low"] # Batch, reporting, data loads
connection_string = adb_connection_strings["high"] # Interactive OLTP only
Cost impact: Using HIGH vs LOW for connection pools wastes 3x OCPU allocation.
❌ NEVER assume stopped ADB = zero cost
Stopped ADB still charges:
- Storage: $0.025/GB/month (continues)
- Backups: Retention charges (continue)
- Compute: $0 (only part that stops)
Example: 1TB ADB, stopped 16 hrs/day
- Compute saved: ~67% of compute bill
- Storage still: $25/month
- Total savings are less than expected — plan accordingly
❌ NEVER guess ADB password complexity — it always fails validation
Requirements (strict):
- 12-30 characters
- 2+ uppercase, 2+ lowercase
- 2+ numbers, 2+ special chars (#-_ only)
- NO username substring
- NO repeating chars (aaa, 111)
# WRONG - fails validation
--admin-password "MyPass123" # Too short, only 1 special char
# RIGHT
--admin-password "MyP@ssw0rd#2024" # 2 upper, 2 lower, 2 num, 2 special
❌ NEVER use full clone for test environments (70% cost waste)
| Clone Type | Cost | Refresh capability | When source deleted |
|-------------------|----------------|--------------------|---------------------|
| Full clone | 100% of source | Cannot refresh | Clone survives |
| Refreshable clone | ~30% (storage) | Manual refresh | Clone auto-deleted! |
| Metadata clone | Minimal | N/A | Clone survives |
# WRONG - full clone for QA needing weekly prod data
oci db autonomous-database create-from-clone-adb --clone-type FULL
# $500/month, no refresh capability
# RIGHT - refreshable clone for test environments
# $150/month storage only, refresh from prod weekly (70% savings)
Critical gotcha: Refreshable clone is silently deleted when source ADB is deleted — no warning.
❌ NEVER delete CDB without checking for PDBs first
# WRONG - deletes all PDBs with no warning
oci db database delete --database-id <cdb-ocid>
# RIGHT - check first
oci db pluggable-database list --container-database-id <cdb-ocid>
# Then explicitly unplug, clone, or delete each PDB
❌ NEVER forget Always-Free ADB limits
Always-Free limits:
- 1 OCPU max (scale-up fails)
- 20 GB storage max
- 2 ADBs total per TENANCY (not per region) — stopped ADBs count!
- NO private endpoints, NO auto-scaling
# To free a slot: must DELETE, not just STOP the ADB
"Connection refused" or "Wallet error"?
│
├─ Wallet file issues?
│ ├─ TNS_ADMIN env set? → export TNS_ADMIN=/path/to/wallet
│ ├─ sqlnet.ora has wallet location?
│ │ WALLET_LOCATION=(SOURCE=(METHOD=file)(METHOD_DATA=(DIRECTORY="/path/to/wallet")))
│ └─ Wallet password correct?
│
├─ Network security?
│ ├─ Private endpoint ADB? → Source IP in NSG? VPN/FastConnect for on-prem?
│ └─ Public endpoint ADB? → IP whitelisted in Access Control List?
│
├─ Database state?
│ └─ Lifecycle state = AVAILABLE?
│ oci db autonomous-database get --autonomous-database-id <ocid> \
│ --query 'data."lifecycle-state"'
│
└─ Service name wrong?
└─ tnsnames.ora entries: <dbname>_high, <dbname>_medium, <dbname>_low
DB System or Exadata
└─ Container Database (CDB)
└─ Pluggable Database (PDB) ← Application connects HERE
# WRONG - connecting to CDB
sqlplus admin/pass@cdb-host:1521/ORCLCDB
# RIGHT - connect to PDB
sqlplus app_user/pass@cdb-host:1521/PDB1
Unplug gotcha: Unplugging PDB does NOT delete data — charges continue until you explicitly DELETE. Unplug only creates an XML metadata file for portability.
Stop/start is worth it for dev databases with predictable hours:
| Model | Cost | Use When | |-------|------|----------| | License Included | $0.36/OCPU-hr | No Oracle DB licenses | | BYOL | $0.18/OCPU-hr | Have Oracle licenses (50% savings) |
4 OCPU production ADB 24/7: BYOL saves $525/month ($6,300/year) if you have licenses.
# DANGER - auto-scaling can 3x your bill silently
resource "oci_database_autonomous_database" "prod" {
cpu_core_count = 2
is_auto_scaling_enabled = true # Scales to 6 OCPUs = 3x surprise cost!
}
Setting max OCPU cap is not available via API or Terraform — must be set in console under Manage Scaling. Set to 2x baseline to control costs.
Load references/oci-dbcs-cli.md when you need:
development
--- name: api-audit description: "Use when auditing API routes for schema drift, missing auth, or validation gaps. Scans routes against shared TypeScript types to find mismatches, missing middleware, and undocumented endpoints. Read-only — produces a severity-grouped report. Keywords: audit routes, schema drift, auth gaps, missing validation, type mismatch, orphaned schemas. Triggers on "audit API routes" or "find schema drift"." --- # API Route & Type Audit Skill ## When to Use Load this skil
development
Use when drafting, translating, polishing, or reviewing Swedish text so it sounds natural, fluent, contemporary, and appropriate for its audience. Triggers include "write better Swedish", "make this sound natural in Swedish", "translate into Swedish", "polish this Swedish", "tech company Swedish", "contemporary Swedish words", "Swedish developer docs", and "avoid Anglicisms".
development
Use when working with shadcn-svelte components, TanStack Table in Svelte 5, or Tailwind v4.1. Covers non-obvious reactivity bugs, library selection trade-offs, and migration pitfalls not in the official docs. Keywords: shadcn-svelte, TanStack Table, Tailwind v4.1, Svelte 5 runes, bits-ui, superforms, data table, svelte-check.
data-ai
Use when mapping IDCS claims to org membership after OAuth login succeeds. Covers mapProfileToUser, session.create.before, session.create.after hooks, MERGE INTO upserts, tenant-org mapping, and first-admin bootstrap. Keywords: IDCS groups, org_members, provisioning, session hooks, tenant map, MERGE INTO.