database-management
Use when creating Autonomous Databases, troubleshooting connection failures, managing PDBs, or optimizing database costs. Covers connection string confusion, password validation errors, stop/start cost traps, clone type selection, and backup retention gotchas.
What this skill does
# OCI Database Management - 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 #4: Poor network segmentation (Landing Zone isolates database tier)
- โ Bad Practice #9: Public database endpoints (Security Zones enforce private subnets)
- โ Bad Practice #10: No monitoring (Landing Zone auto-configures database alarms)
**This skill provides**: ADB operations, troubleshooting, 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
- Database service CLI operations (`oci db autonomous-database`)
- Wallet configuration and connection string formats
- Latest ADB features (23ai, 26ai) and API changes
**When OCI operations are needed:**
1. Use exact CLI commands from skill references
2. Do NOT guess OCI CLI syntax or parameters
3. Do NOT assume API endpoint structures
4. Load oracle-dba skill for detailed ADB operations
**What you DO know:**
- Oracle Database internals (SQL, PL/SQL)
- General database administration principles
- Connection pooling and HA concepts
This skill bridges the gap by providing current OCI-specific database operations.
---
You are an OCI Database expert. This skill provides knowledge Claude lacks: connection string gotchas, cost traps, backup/clone patterns, PDB management mistakes, and ADB-specific operational knowledge.
## NEVER Do This
โ **NEVER use wrong connection service name (performance/cost impact)**
```
Autonomous Database provides 3 service names:
- HIGH: Dedicated CPU, highest performance, **3x cost of LOW**
- MEDIUM: Shared CPU, balanced
- LOW: Most sharing, cheapest, sufficient for OLTP
# WRONG - using HIGH for background jobs (expensive)
connection_string = adb_connection_strings["high"] # 3x cost!
# RIGHT - match service to workload
connection_string = adb_connection_strings["low"] # Batch jobs, reporting
connection_string = adb_connection_strings["high"] # Critical transactions only
```
**Cost impact**: Using HIGH vs LOW for 24/7 connection pool: $220/month vs $73/month wasted (3x)
โ **NEVER assume stopped database = zero cost**
```
# WRONG assumption - "stopped" database is free
Stop ADB at night to save costs
# Reality:
Stopped ADB charges:
- Storage: $0.025/GB/month continues
- Backups: Retention charges continue
- Compute: ZERO (only part that stops)
Example: 1TB ADB stopped 16 hrs/day
- Compute savings: $584/month ร 67% = $391 saved
- Storage cost: $25.60/month (still charged)
- Net savings: $391/month (not $610 expected)
```
โ **NEVER ignore password complexity (ALWAYS fails)**
```
OCI Database password requirements (strict regex):
- 12-30 characters
- 2+ uppercase, 2+ lowercase
- 2+ numbers, 2+ special (#-_)
- NO username in password
- NO repeating chars (aaa, 111)
# WRONG - fails validation
--admin-password "MyPass123" # Only 1 special char, < 12 chars
# RIGHT - meets requirements
--admin-password "MyP@ssw0rd#2024" # 2 upper, 2 lower, 2 num, 2 special, 16 chars
```
โ **NEVER confuse clone types (performance/cost consequences)**
```
| Clone Type | Use Case | Cost | Refresh | When Source Deleted |
|------------|----------|------|---------|---------------------|
| **Full clone** | Prod โ Dev (one-time) | Full ADB cost | Cannot refresh | Clone survives |
| **Refreshable clone** | Prod โ Test (weekly refresh) | Storage only (~30%) | Manual refresh | Clone deleted |
| **Metadata clone** | Schema-only copy | Minimal | N/A | Clone survives |
# WRONG - full clone for dev environment that needs weekly prod data
oci db autonomous-database create-from-clone-adb \
--clone-type FULL # Wastes $500/month, no refresh capability
# RIGHT - refreshable clone for test environments
oci db autonomous-database create-refreshable-clone \
# Costs $150/month storage, can refresh from prod weekly
```
**Cost trap**: Full clone for testing = $500/month vs $150/month for refreshable clone (70% savings)
โ **NEVER delete CDB without checking PDBs first**
```
# WRONG - deletes Container Database with PDBs inside (data loss)
oci db database delete --database-id <cdb-ocid>
# All pluggable databases deleted with no warning!
# RIGHT - check for PDBs first
oci db pluggable-database list --container-database-id <cdb-ocid>
# If PDBs exist, decide: unplug, clone, or explicitly delete each
```
โ **NEVER use ADMIN user in application code (security risk)**
```
# WRONG - application uses ADMIN credentials
app_config = {
'user': 'ADMIN',
'password': admin_password # Full database control!
}
# RIGHT - create app-specific user with least privilege
CREATE USER app_user IDENTIFIED BY <password>;
GRANT CONNECT, RESOURCE TO app_user;
GRANT SELECT, INSERT, UPDATE ON app_schema.* TO app_user;
# ADMIN only for DBA tasks, never in application code
```
โ **NEVER forget Always-Free limits (scale-up fails)**
```
Always-Free Autonomous Database limits:
- 1 OCPU max (cannot scale beyond)
- 20 GB storage max
- 1 database per tenancy per region
- NO private endpoints
- NO auto-scaling
# WRONG - trying to scale always-free database
oci db autonomous-database update \
--autonomous-database-id <adb-ocid> \
--cpu-core-count 2 # FAILS: Always-free max is 1 OCPU
# RIGHT - convert to paid tier first, THEN scale
oci db autonomous-database update \
--autonomous-database-id <adb-ocid> \
--is-free-tier false # Convert to paid
# Now can scale to 2+ OCPUs
```
## Connection String Gotchas
### Wallet Connection Failure Decision Tree
```
"Connection refused" or "Wallet error"?
โ
โโ Wallet file issues?
โ โโ Check: TNS_ADMIN env variable set?
โ โ โโ export TNS_ADMIN=/path/to/wallet
โ โโ Check: sqlnet.ora has correct wallet location?
โ โ โโ WALLET_LOCATION = (SOURCE = (METHOD = file) (METHOD_DATA = (DIRECTORY="/path/to/wallet")))
โ โโ Check: Wallet password correct?
โ
โโ Network security?
โ โโ Private endpoint ADB?
โ โ โโ Check: Source IP in NSG/security list?
โ โ โโ Check: VPN/FastConnect for on-premises access?
โ โโ Public endpoint ADB?
โ โโ Check: Database whitelisted your IP? (Access Control List)
โ
โโ Database state?
โ โโ Check: Lifecycle state = AVAILABLE (not STOPPED, UPDATING)?
โ โโ oci db autonomous-database get --autonomous-database-id <ocid> --query 'data."lifecycle-state"'
โ
โโ Service name wrong?
โโ Check: Using correct service name from tnsnames.ora?
โโ HIGH: <dbname>_high
โโ MEDIUM: <dbname>_medium
โโ LOW: <dbname>_low
```
### Service Name Selection (Cost vs Performance)
| Service | CPU Allocation | Concurrency | Cost | Use For |
|---------|---------------|-------------|------|---------|
| **HIGH** | Dedicated OCPU | 1ร OCPU count | 3ร base | OLTP critical transactions, interactive queries |
| **MEDIUM** | Shared OCPU | 2ร OCPU count | 1ร base | Batch jobs, reporting, most apps |
| **LOW** | Most sharing | 3ร OCPU count | 1ร base | Background tasks, data loads |
**Example**: 2 OCPU ADB
- HIGH: 2 concurrent queries max, $584/month
- MEDIUM: 4 concurrent queries, $584/month
- LOW: 6 concurrent queries, $584/month (same cost, more concurrency)
**Gotcha**: HIGH doesn't cost more in ADB pricing, but uses more OCPU-hours if you scale based on load.
## Cost Optimization with Exact Calculations
### Stop vs Scale Down Decision
**Scenario**: Development ADB, 2 OCPUs, 1 TB storage, used 8 hrs/day weekdays only
**Option 1: Stop when not in use** (16 hrs/day + weekends)
```
Usage: 8 hrs/day ร 5 days = 40 hrs/week (24% utilization)
Compute cost: $0.36/OCPU-hr ร 2 ร 40 ร 4.3 weeks = $124/month
Storage cost: $0.025/GB/month ร 1000 = $25/month
Total: $149/month
```
**Option 2: Scale to 1 Related 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.