db2-oracle
Skill2 starsChanged 4 months agoMITView on GitHub
Enterprise database development for IBM DB2 and Oracle. Covers PL/SQL, SQL/PL, partitioning, performance tuning, XML/JSON handling, and migration patterns.
In this repository45 other files it gives its agents.
- AGENTS.mdAGENTS.md
- allure-reportsSkill
- android-nativeSkill
- appian-lowcodeSkill
- appium-mobileSkill
- behave-bddSkill
- BiDiWave Cross-BrowserSkill
- BiDiWave Network InterceptionSkill
- CDPWave DebuggingSkill
- CDPWave TestingSkill
- ebook-writerSkill
- flask-apiSkill
- flet-desktopSkill
- google-crawling-indexingSkill
- google-ranking-appearanceSkill
- google-seo-fundamentalsSkill
- google-seo-monitoringSkill
- jinja2-templatesSkill
- jmeter-load-testingSkill
- k6-load-testingSkill
- karate-api-testingSkill
- octane-almSkill
- paramiko-sshSkill
- postman-api-automationSkill
- prestashop-moduleSkill
- prompt-engineering-best-practicesSkill
- pytest-advancedSkill
- robot-frameworkSkill
- salesforce-devSkill
- sonarqube-quality-gatesSkill
- sql-serverSkill
- Skill NameSkill
- testcontainersSkill
- wave-ecosystem-guideSkill
- WaveXis AccessibilitySkill
- WaveXis CI/CD IntegrationSkill
- wavexis-cli-automationSkill
- wavexis-mcp-agent-integrationSkill
- WaveXis Network TestingSkill
- WaveXis Performance AuditSkill
- WaveXis Session RecordingSkill
- WaveXis Web ScrapingSkill
- webdriverioSkill
- wordpress-themesSkill
- xctest-iosSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 254
Use SERIAL or GENERATED ALWAYS AS IDENTITY instead of sequences + triggers.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
DB2 and Oracle
1. Oracle PL/SQL
Basic Procedure
CREATE OR REPLACE PROCEDURE sp_create_order (
p_user_id IN NUMBER,
p_total IN NUMBER,
p_order_id OUT NUMBER
) AS
BEGIN
INSERT INTO orders (user_id, total, status, created_at)
VALUES (p_user_id, p_total, 'pending', SYSTIMESTAMP)
RETURNING id INTO p_order_id;
COMMIT;
EXCEPTION
WHEN DUP_VAL_ON_INDEX THEN
RAISE_APPLICATION_ERROR(-20001, 'Duplicate order detected');
WHEN OTHERS THEN
ROLLBACK;
RAISE;
END;
/Cursor and Bulk Collect
DECLARE
TYPE t_user_tab IS TABLE OF users%ROWTYPE;
v_users t_user_tab;
BEGIN
SELECT * BULK COLLECT INTO v_users
FROM users
WHERE is_active = 1;
FORALL i IN 1..v_users.COUNT
UPDATE users
SET last_login = SYSTIMESTAMP
WHERE id = v_users(i).id;
COMMIT;
END;
/2. DB2 SQL/PL
Stored Procedure
CREATE PROCEDURE create_order (
IN p_user_id INT,
IN p_total DECIMAL(10,2),
OUT p_order_id INT
)
BEGIN
DECLARE v_status VARCHAR(20) DEFAULT 'pending';
INSERT INTO orders (user_id, total, status, created_at)
VALUES (p_user_id, p_total, v_status, CURRENT_TIMESTAMP);
SET p_order_id = IDENTITY_VAL_LOCAL();
ENDMERGE (DB2)
MERGE INTO inventory AS target
USING (SELECT product_id, quantity FROM staging_inventory) AS source
ON target.product_id = source.product_id
WHEN MATCHED THEN
UPDATE SET target.quantity = target.quantity + source.quantity
WHEN NOT MATCHED THEN
INSERT (product_id, quantity) VALUES (source.product_id, source.quantity);3. Oracle Partitioning
| Type | Use Case |
| Range | Time-series data (by month/year) |
| List | Discrete categories (by region/status) |
| Hash | Even distribution for I/O balance |
| Composite | Range + Hash or Range + List |
CREATE TABLE sales (
sale_id NUMBER,
sale_date DATE,
amount NUMBER(10,2)
) PARTITION BY RANGE (sale_date) (
PARTITION p2023q1 VALUES LESS THAN (TO_DATE('2023-04-01','YYYY-MM-DD')),
PARTITION p2023q2 VALUES LESS THAN (TO_DATE('2023-07-01','YYYY-MM-DD')),
PARTITION p2023q3 VALUES LESS THAN (TO_DATE('2023-10-01','YYYY-MM-DD')),
PARTITION p2023q4 VALUES LESS THAN (TO_DATE('2024-01-01','YYYY-MM-DD')),
PARTITION pmax VALUES LESS THAN (MAXVALUE)
);4. DB2 Partitioning (Table Partitioning + MDC)
CREATE TABLE sales (
sale_id INT,
sale_date DATE,
amount DECIMAL(10,2)
) PARTITION BY RANGE (sale_date) (
STARTING FROM '2023-01-01' ENDING AT '2024-01-01' EVERY 3 MONTHS
)
ORGANIZE BY DIMENSIONS (EXTRACT(YEAR FROM sale_date), EXTRACT(MONTH FROM sale_date));5. Performance Tuning
Oracle Execution Plan
EXPLAIN PLAN FOR
SELECT * FROM orders WHERE user_id = 42;
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);DB2 Explain
EXPLAIN PLAN FOR SELECT * FROM orders WHERE user_id = 42;
SELECT * FROM EXPLAIN_INSTANCE;Index Hints (Oracle)
SELECT /*+ INDEX(orders idx_orders_user) */ *
FROM orders
WHERE user_id = 42;6. JSON Handling
Oracle JSON
-- Query JSON column
SELECT id, json_data.name, json_data.address.city
FROM customers,
JSON_TABLE(
json_col, '$'
COLUMNS (
name VARCHAR2(100) PATH '$.name',
city VARCHAR2(100) PATH '$.address.city'
)
) json_data
WHERE json_exists(json_col, '$.premium' PASSING 'true' AS "premium");DB2 JSON
-- JSON column operations
SELECT id, JSON_VAL(json_col, 'name') AS name
FROM customers
WHERE JSON_EXISTS(json_col, '$.premium');
-- Update JSON
UPDATE customers
SET json_col = JSON_SET(json_col, '$.last_visit', CURRENT_DATE)
WHERE id = 1;7. Sequences and Identity
Oracle
CREATE SEQUENCE seq_users START WITH 1 INCREMENT BY 1 CACHE 100;
-- Trigger for auto-increment feel
CREATE TRIGGER trg_users_bi
BEFORE INSERT ON users
FOR EACH ROW
BEGIN
:NEW.id := seq_users.NEXTVAL;
END;DB2
-- Identity column
CREATE TABLE users (
id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
name VARCHAR(100)
);
-- Sequence
CREATE SEQUENCE seq_orders START WITH 1 INCREMENT BY 1 NO CACHE;8. Python Connectivity
Oracle (cx_Oracle)
import cx_Oracle
dsn = cx_Oracle.makedsn("host", 1521, service_name="ORCL")
with cx_Oracle.connect("user", "password", dsn) as conn:
cursor = conn.cursor()
cursor.execute("SELECT * FROM users WHERE id = :id", {"id": 1})
row = cursor.fetchone()DB2 (ibm_db)
import ibm_db
conn_str = (
"DATABASE=mydb;HOSTNAME=host;PORT=50000;"
"PROTOCOL=TCPIP;UID=user;PWD=pass;"
)
conn = ibm_db.connect(conn_str, "", "")
stmt = ibm_db.exec_immediate(conn, "SELECT * FROM users FETCH FIRST 10 ROWS ONLY")
result = ibm_db.fetch_both(stmt)9. Migration Patterns
Oracle to PostgreSQL
- Replace
SYSTIMESTAMPwithCURRENT_TIMESTAMP. - Replace
ROWNUMwithLIMIT. - Replace
NVLwithCOALESCE. - Replace
DECODEwithCASE. - Use
SERIALorGENERATED ALWAYS AS IDENTITYinstead of sequences + triggers.
DB2 to PostgreSQL
- Replace
FETCH FIRST n ROWS ONLYwithLIMIT n. - Replace
CURRENT DATE/CURRENT TIMESTAMPwithCURRENT_DATE/CURRENT_TIMESTAMP. - Replace
IDENTITY_VAL_LOCAL()withRETURNING id.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

