oracle-dba
Use when managing Oracle Autonomous Database on OCI, troubleshooting performance issues, optimizing costs, or implementing HA/DR. Covers ADB-specific gotchas, cost traps, SQL_ID debugging workflows, auto-scaling behavior, and version differences (19c/21c/23ai/26ai).
What this skill does
# OCI Oracle DBA - Expert Knowledge
## ๐๏ธ Use OCI Landing Zone Terraform Modules
**Don't reinvent the wheel.** Use [oracle-terraform-modules/landing-zone](https://github.com/oracle-terraform-modules/terraform-oci-landing-zones) for database infrastructure.
**Landing Zone solves:**
- โ Bad Practice #1: Generic compartments (Landing Zone creates dedicated Database/Security compartments for ADB organization)
- โ Bad Practice #9: Public database endpoints (Landing Zone Security Zones enforce private endpoints only)
- โ Bad Practice #10: No monitoring (Landing Zone auto-configures ADB performance alarms, slow query notifications)
**This skill provides**: ADB-specific operations, performance tuning, and cost optimization for databases deployed WITHIN a Landing Zone.
---
## โ ๏ธ OCI CLI/API Knowledge Gap
**You don't know OCI CLI commands or OCI API structure.**
Your training data has limited and outdated knowledge of:
- OCI CLI syntax and parameters (updates monthly)
- OCI API endpoints and request/response formats
- Autonomous Database CLI operations (`oci db autonomous-database`)
- OCI service-specific commands and flags
- Latest OCI features and API changes
**When OCI operations are needed:**
1. Use exact CLI commands from this skill's references
2. Do NOT guess OCI CLI syntax or parameters
3. Do NOT assume API endpoint structures
4. Load [`oci-cli-adb.md`](references/oci-cli-adb.md) for ADB management operations
**What you DO know:**
- Oracle Database internals (SQL, PL/SQL, performance tuning)
- General cloud concepts
- Database administration principles
This skill bridges the gap by providing current OCI CLI/API commands for Autonomous Database operations.
---
You are an Oracle Autonomous Database expert on OCI. This skill provides knowledge Claude lacks: ADB-specific behaviors, cost traps, SQL_ID debugging workflows, auto-scaling gotchas, and production anti-patterns.
## NEVER Do This
โ **NEVER use ADMIN user in application code**
```sql
-- WRONG - application uses ADMIN credentials
app_config = {'user': 'ADMIN', 'password': admin_pwd}
-- RIGHT - create app-specific user with least privilege
CREATE USER app_user IDENTIFIED BY :password;
GRANT CREATE SESSION, SELECT ON schema.* TO app_user;
```
**Why critical**: ADMIN has full database control, audit trail shows all actions as ADMIN (no accountability), ADMIN can't be locked/disabled without breaking automation.
โ **NEVER scale without checking wait events first**
```
-- WRONG decision path: "CPU is high โ scale ECPUs"
-- RIGHT decision path:
1. Check v$system_event for top wait events
2. High 'CPU time' wait โ Bad SQL, need optimization (DON'T scale)
3. High 'db file sequential read' โ Missing indexes (DON'T scale)
4. High 'User I/O' sustained โ Scale storage IOPS OR auto-scaling
5. Only scale ECPUs if: CPU wait sustained + SQL already optimized
```
**Cost impact**: Scaling 2โ4 ECPU = $526/month increase. If root cause is bad SQL, wasted $526/month.
โ **NEVER assume stopped ADB = zero cost**
```
Stopped Autonomous Database charges:
โ Compute: $0 (stopped)
โ Storage: $0.025/GB/month continues
โ Backups: Retention charges continue
Example: 1TB ADB stopped for 30 days
Storage: 1000 GB ร $0.025 = $25/month (CHARGED!)
Better for long-term idle (>60 days):
1. Export data (Data Pump)
2. Delete ADB
3. Restore from backup when needed
```
โ **NEVER forget retention on manual backups (cost trap)**
```bash
# WRONG - manual backup with no retention (kept forever)
oci db autonomous-database-backup create \
--autonomous-database-id $ADB_ID \
--display-name "pre-upgrade-backup"
# Cost: $0.025/GB/month FOREVER
# RIGHT - set retention
oci db autonomous-database-backup create \
--autonomous-database-id $ADB_ID \
--display-name "pre-upgrade-backup" \
--retention-days 30
Cost trap: 1TB manual backup ร $0.025/GB/month ร 12 months = $300/year waste
```
โ **NEVER use SELECT * in production queries**
```sql
-- WRONG - fetches all columns, heavy network/parsing
SELECT * FROM orders WHERE customer_id = :cust_id;
-- RIGHT - specify needed columns
SELECT order_id, total_amount, status FROM orders WHERE customer_id = :cust_id;
Impact: 50-column table, fetching 5 needed columns
- SELECT *: 50 columns ร 1000 rows = 50k data points
- Explicit: 5 columns ร 1000 rows = 5k data points (90% reduction)
```
โ **NEVER ignore SQL_ID when debugging slow queries**
```sql
-- WRONG - "my query is slow, tune the database"
ALTER SYSTEM SET optimizer_mode = 'FIRST_ROWS'; # Affects ALL queries!
-- RIGHT - identify specific SQL_ID, tune that query
SELECT sql_id, elapsed_time/executions/1000 AS avg_ms, executions
FROM v$sql
WHERE executions > 0
ORDER BY elapsed_time DESC
FETCH FIRST 10 ROWS ONLY;
Then tune specific SQL_ID (not entire database)
```
โ **NEVER use ROWNUM with ORDER BY (wrong results)**
```sql
-- WRONG - ROWNUM applied BEFORE ORDER BY (wrong top 10)
SELECT * FROM orders WHERE ROWNUM <= 10 ORDER BY created_at DESC;
-- RIGHT - FETCH FIRST (Oracle 12c+)
SELECT * FROM orders ORDER BY created_at DESC FETCH FIRST 10 ROWS ONLY;
```
โ **NEVER scale auto-scaling ADB without checking current behavior**
```
ADB Auto-Scaling Gotcha:
- Base ECPU: 2
- Auto-scaling: Scales 1-3x (2 โ 6 ECPU max)
- Cost: Charged for PEAK usage during period
# WRONG - enable auto-scaling then forget about it
Cost surprise: Base 2 ECPU ($526/month) โ Peak 6 ECPU ($1,578/month)
# RIGHT - set max ECPU limit in console
Max ECPU = 4 (2ร base, not 3ร)
Cost control: Peak 4 ECPU ($1,052/month) max
```
## Performance Troubleshooting Decision Tree
```
"Queries are slow"?
โ
โโ Is it ONE query or ALL queries?
โ โโ ONE query slow
โ โ โโ Get SQL_ID from v$sql (top by elapsed_time)
โ โ โโ Check execution plan:
โ โ SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR('&sql_id'));
โ โ โโ Full table scan? โ Add index
โ โ โโ Wrong join order? โ Use hints or SQL Plan Management
โ โ โโ Cartesian join? โ Fix query logic
โ โ
โ โโ ALL queries slow (system-wide)
โ โโ Check wait events:
โ SELECT event, time_waited_micro/1000000 AS wait_sec
โ FROM v$system_event
โ WHERE wait_class != 'Idle'
โ ORDER BY time_waited_micro DESC
โ FETCH FIRST 10 ROWS ONLY;
โ
โ โโ Top wait: 'CPU time' โ Optimize SQL OR scale ECPU
โ โโ Top wait: 'db file sequential read' โ Missing indexes
โ โโ Top wait: 'db file scattered read' โ Full table scans
โ โโ Top wait: 'log file sync' โ Too many commits (batch)
โ โโ Top wait: 'User I/O' โ Scale storage IOPS or auto-scale
โ
โโ When did slowness start?
โโ After schema change? โ Gather stats (DBMS_STATS)
โโ After data load? โ Gather stats + check partitioning
โโ After version upgrade? โ Check execution plan changes
โโ Gradual over time? โ Data growth, need indexing/partitioning
```
## ADB Cost Calculations (Exact)
### ECPU Scaling Cost
```
License-Included pricing: $0.36/ECPU-hour
BYOL pricing: $0.18/ECPU-hour (if you have Oracle licenses)
Monthly cost = ECPU count ร hourly rate ร 730 hours
Examples:
2 ECPU: 2 ร $0.36 ร 730 = $526/month
4 ECPU: 4 ร $0.36 ร 730 = $1,052/month
8 ECPU: 8 ร $0.36 ร 730 = $2,104/month
BYOL (50% off):
2 ECPU: 2 ร $0.18 ร 730 = $263/month
4 ECPU: 4 ร $0.18 ร 730 = $526/month
```
### Storage Cost
```
Storage pricing: $0.025/GB/month (all tiers: Standard, Archive)
Examples:
1 TB: 1000 GB ร $0.025 = $25/month
5 TB: 5000 GB ร $0.025 = $125/month
CRITICAL: Storage charged even when ADB stopped!
```
### Auto-Scaling Cost Impact
```
Scenario: Base 2 ECPU with auto-scaling enabled (1-3ร)
Without auto-scaling:
2 ECPU ร $0.36 ร 730 = $526/month (fixed)
With auto-scaling (spiky load):
- 50% of time: 2 ECPU = $263
- 30% of time: 4 ECPU = $315
- 20% of time: 6 ECPU = $315
Monthly cost: $893 (70% increase)
When auto-scaling makes sense:
- Spiky load (not sustained high)
- Want to avoid manual scaling
- Cost increase acceptable (up to 3ร)
```
## SQL_ID Debugging Workflow
**Step 1: FinRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.