Skip to content
Skills Library
Data & analytics · Building & coding

oracle

/oracle

Expert Oracle Database assistance covering PL/SQL, cost-based optimizer, partitioning, RAC, and Data Guard. Use when writing enterprise SQL, managing Oracle schemas, or optimizing heavy OLTP workloads.

Licence
MIT
Last repository change
01.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 01.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Expert Oracle Database assistance covering PL/SQL, cost-based optimizer, partitioning, RAC, and Data Guard. Use when writing enterprise SQL, managing Oracle schemas, or optimizing heavy OLTP workloads.

Original author description

Expert Oracle Database assistance covering PL/SQL, cost-based optimizer, partitioning, RAC, and Data Guard. Use when writing enterprise SQL, managing Oracle schemas, or optimizing heavy OLTP workloads.

How it works

  1. When to Use
  2. Quick Start
  3. Core Concepts
  4. Common Patterns
  5. Best Practices
  6. Troubleshooting
  7. References
Original SKILL.md headings · 126 lines, 621 words
SKILL.md preview
---
name: oracle
description: Expert Oracle Database assistance covering PL/SQL, cost-based optimizer, partitioning, RAC, and Data Guard. Use when writing enterprise SQL, managing Oracle schemas, or optimizing heavy OLTP workloads.
---

# Oracle Database

Oracle Database is a multi-model database management system. It is the de-facto standard for Fortune 500 mission-critical systems due to its reliability, scalability (RAC), and PL/SQL power.

## When to Use

- **Mission-Critical Global Enterprise OLTP**: Running Tier-1 core banking, telecommunications, ERP, and supply chain workloads.
- **Oracle Real Application Clusters (RAC)**: Achieving active-active shared-everything database clustering and transparent failover.
- **Advanced PL/SQL Procedural Logic**: Executing complex enterprise business rules, packages, and triggers directly inside the database.
- **Multitenant Pluggable Databases (PDB)**: Consolidating hundreds of isolated tenant databases under a single Container Database (CDB).

## Quick Start

```sql
-- Implicit cursor loop in PL/SQL
BEGIN
  FOR r IN (SELECT first_name, last_name FROM employees WHERE department_id = 10)
  LOOP
    DBMS_OUTPUT.PUT_LINE(r.first_name || ' ' || r.last_name);
  END LOOP;
END;
/
```

## Core Concepts

### Multitenant Architecture (CDB and PDBs)

One Container Database (CDB) manages system memory and background processes; Pluggable Databases (PDBs) run independently:

```text
[ Container Database (CDB$ROOT) ]
        ├── [ Pluggable DB: PDB_FINANCE ]
        ├── [ Pluggable DB: PDB_HR ]
        └── [ Pluggable DB: PDB_COMMERCE ]
```

### PL/SQL Stored Packages & Transaction Management

Encapsulates procedural business logic with compiled database performance:

```sql
CREATE OR REPLACE PACKAGE BODY FinancialOps AS
    PROCEDURE TransferFunds(
        p_from_acc IN NUMBER,
        p_to_acc   IN NUMBER,
        p_amount   IN NUMBER
    ) IS
    BEGIN
        UPDATE Accounts SET Balance = Balance - p_amount WHERE AccountId = p_from_acc;
        UPDATE Accounts SET Balance = Balance + p_amount WHERE AccountId = p_to_acc;
        COMMIT;
    EXCEPTION
        WHEN OTHERS THEN
            ROLLBACK;
            RAISE_APPLICATION_ERROR(-20001, 'Fund transfer failed: ' || SQLERRM);
    END TransferFunds;
END FinancialOps;
/
```

### Automatic Workload Repository (AWR) & ASH

Comprehensive database performance monitoring and execution profiling:

```sql
-- Generate AWR Performance Snapshot
EXEC DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT();
```

## Common Patterns

### Bulk Data Processing with PL/SQL FORALL and BULK COLLECT

**Problem**: Processing thousands of rows row-by-row in PL/SQL creates massive context-switch overhead between SQL and PL/SQL engines.

**Solution**:
Use `BULK COLLECT` and `FORALL` for batch processing:

```sql
DECLARE
  TYPE t_emp_list IS TABLE OF employees%ROWTYPE;
  v_emps t_emp_list;
BEGIN
  -- Batch collect into memory
  SELECT * BULK COLLECT INTO v_emps FROM employees WHERE status = 'PENDING';

  -- Batch update in a single engine context switch
  FORALL i IN 1..v_emps.COUNT
    UPDATE employees
    SET status = 'PROCESSED', processed_date = SYSDATE
    WHERE employee_id = v_emps(i).employee_id;

  COMMIT;
END;
/
```

## Best Practices

**Do**:

- Use Bind Variables Everywhere: Bind variables (`:val`) prevent hard parsing, reduce latch contention, and stop SQL injection.
- Analyze AWR Reports Regularly: Inspect the "Top 5 Timed Events" in AWR to identify I/O bottlenecks and locking contention.
- Implement Partitioning for Massive Tables: Partition multi-terabyte tables by range or hash to enable partition pruning.
- Use Automatic Memory Management (AMM): Allow Oracle to balance PGA (work areas) and SGA (buffer cache/shared pool) dynamically.

**Don't**:

- Hardcode literals in production queries: Literal strings force Oracle to recompile and pollute the Shared Pool with distinct execution plans.
- Commit inside iterative row loops: Committing row-by-row causes `ORA-01555 Snapshot Too Old` errors and redo log thrashing.
- Ignore index monitoring: Drop unused indexes to reclaim storage and reduce write lock overhead.

## Troubleshooting

| Error                                                        | Cause                                                                | Solution                                                                             |
| :----------------------------------------------------------- | :------------------------------------------------------------------- | :----------------------------------------------------------------------------------- |
| `ORA-01555: snapshot too old`                                | Rollback segments/undo tablespace overwritten by long-running query. | Increase `UNDO_RETENTION` and resize undo tablespace.                                |
| `ORA-00054: resource busy and acquire with NOWAIT specified` | Table locked by another active uncommitted DDL or DML transaction.   | Wait for transaction to complete or identify blocking session via `V$LOCKED_OBJECT`. |
| `ORA-01653: unable to extend table ... in tablespace`        | Tablespace is full or max datafile size reached.                     | Add a new datafile or enable `AUTOEXTEND ON` for tablespace.                         |

## References

- [Oracle Database 23ai Documentation](https://docs.oracle.com/en/database/oracle/oracle-database/)

Versions

RepositoryScoreLicence
This page · G1Joshi/Agent-Skills100MIT
x85446/claudecodetricks100MIT
claude-dev-suite/claude-dev-suite100MIT
ialameh/sift-coder100MIT
edmundmiller/dotfiles90MIT
dkbnull/hello-skill86MIT

Database snapshot: 13.11.2026 · package version 59a6d370cc8a (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100oracle-expert
    Expert in Oracle Database, PL/SQL programming, Oracle RAC, Data Guard, performance tuning, backup/recovery, and enterprise database administration. Use when the user mentions database, enterprise, ERP, PL/SQL, Oracle RAC, or Data Guard, or when the task involves Oracle…
  • 90oracle-database-expert
    Expert Oracle Database engineering across Oracle Database 23ai, Autonomous Database, SQL/PLSQL tuning, AI Vector Search, JSON Relational Duality, partitioning, high availability, and security. Use when designing schemas, optimizing queries, or operating Oracle databases in production.
  • 90oracle-db-specialist
    Oracle Database guidance for SQL, PL/SQL, SQLcl, ORDS, administration, performance, security, migrations, and agent-safe database workflows. Version-aware across 19c, 21c, and 23ai. Trigger on: SQL, PL/SQL, SQLcl, ORDS, JDBC, node-oracledb, AWR, ASH, explain plan, Data Guard,…
  • 90sql-expert
    Use when writing, explaining, optimizing, or debugging SQL, especially Oracle SQL queries, analytic functions, dates, joins, and aggregations.
  • 80role-database:relational-databases
    Deep operational guide for 20 relational/SQL databases. PostgreSQL tuning (VACUUM, WAL, partitioning, extensions, PgBouncer), MySQL/MariaDB (InnoDB, Vitess, Galera, ProxySQL), Oracle (RAC, Data Guard), MS SQL Server (AlwaysOn AG, columnstore), SQLite, Db2, HANA, and managed…
  • 84analyze-oracle-schema
    Analyzes Oracle database schema and generates a comprehensive Markdown report for sharing. Use when you need to document Oracle schema objects including tables, triggers, custom types, PL/SQL code, and object dependencies.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.