db2
Skill15 starsChanged 42 days agoMITView on GitHub
Expert IBM Db2 assistance covering relational SQL, pureScale, BLU acceleration, and enterprise database administration. Use when managing mainframe systems, running hybrid cloud Db2, or tuning enterprise OLTP/OLAP.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- anurag-azure/skillstheir own version, first seen Jun 27, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- anurag-azure/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- llamaSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- pandasSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- sparkSkill
- stable-diffusionSkill
- tensorflowSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- rest-apiSkill
- sagaSkill
- serverlessSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 91
Update catalog statistics and rebind packages:
- Very specific: line 105
Run RUNSTATS Regularly: Ensure optimizer statistics are current (RUNSTATS ON TABLE schema.table WITH DISTRIBUTION AND DETAILED INDEXES ALL).
- Very specific: line 107
Use Lock Avoidance Techniques: Set DB2_EVALUNCOMMITTED=YES to skip rows that do not satisfy search predicates during scans.
- Distinctive: line 112
Use unindexed foreign keys: Unindexed child foreign keys cause table-level locks during parent row deletions.
- Distinctive: line 113
Run long-running analytical queries against the OLTP primary: Direct analytical queries to HADR read-on-standby replicas.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
IBM Db2
Db2 is a family of data management products, including the relational database. It is famous for running on Mainframes (z/OS) but also runs on Linux/Unix/Windows (LUW).
When to Use
- Mission-Critical Enterprise Systems: Running core banking, financial transaction processing, and mainframe legacy enterprise workloads.
- PureXML & Hybrid Relational Workloads: Storing and indexing hierarchical XML and JSON documents alongside relational SQL tables.
- IBM z/OS Mainframe & Linux/Power Integration: Interfacing with enterprise IBM infrastructure with absolute data durability.
- High Availability Disaster Recovery (HADR): Mission-critical zero-data-loss failover architectures across physical datacenters.
Quick Start
-- Minimal Db2 Table Creation with Index
CREATE TABLE HR.EMPLOYEES (
EMP_ID INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1000 INCREMENT BY 1),
FIRST_NAME VARCHAR(50) NOT NULL,
LAST_NAME VARCHAR(50) NOT NULL,
DEPARTMENT VARCHAR(50),
HIRE_DATE DATE DEFAULT CURRENT DATE,
SALARY DECIMAL(10,2),
PRIMARY KEY (EMP_ID)
);
CREATE INDEX HR.IDX_EMP_DEPT ON HR.EMPLOYEES (DEPARTMENT, SALARY DESC);Core Concepts
Table Spaces & Storage Groups Architecture
Fine-grained control over physical storage containers, buffer pools, and disk layouts:
-- Create Enterprise Storage Space
CREATE TABLESPACE TS_ORDERS
PAGESIZE 32K
MANAGED BY AUTOMATIC STORAGE
BUFFERPOOL BP32K;
CREATE TABLE ENTERPRISE.ORDERS (
ORDER_ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1000, INCREMENT BY 1),
CUSTOMER_ID VARCHAR(32) NOT NULL,
ORDER_DATE TIMESTAMP NOT NULL DEFAULT CURRENT TIMESTAMP,
TOTAL_AMOUNT DECIMAL(15,2) NOT NULL,
CONSTRAINT PK_ORDERS PRIMARY KEY (ORDER_ID)
) IN TS_ORDERS;pureQuery & Static SQL Execution
Pre-compiles and optimizes SQL queries into static execution plans for maximum mainframe execution efficiency:
-- Optimized Stored Procedure
CREATE OR REPLACE PROCEDURE GET_CUSTOMER_SUMMARY (
IN p_customer_id VARCHAR(32),
OUT p_total_orders INT,
OUT p_total_spend DECIMAL(15,2)
)
LANGUAGE SQL
BEGIN
SELECT COUNT(*), COALESCE(SUM(TOTAL_AMOUNT), 0.0)
INTO p_total_orders, p_total_spend
FROM ENTERPRISE.ORDERS
WHERE CUSTOMER_ID = p_customer_id;
END@High Availability Disaster Recovery (HADR)
Replicates transaction log buffers synchronously from primary to standby instances:
[ Primary DB2 Server ] ──Synchronous Log Shipping (HADR)──→ [ Standby DB2 Server ]Common Patterns
Runstats and Optimizer Plan Refresh
Problem: The Db2 cost-based optimizer selects inefficient table-scan access plans after bulk inserts.
Solution: Update catalog statistics and rebind packages:
-- Collect detailed distribution statistics for indexes and data pages
RUNSTATS ON TABLE HR.EMPLOYEES WITH DISTRIBUTION AND DETAILED INDEXES ALL;
-- Flush package cache to force plan recompilation
FLUSH PACKAGE CACHE DYNAMIC;Best Practices
Do:
- Run
RUNSTATSRegularly: Ensure optimizer statistics are current (RUNSTATS ON TABLE schema.table WITH DISTRIBUTION AND DETAILED INDEXES ALL). - Tune Buffer Pools: Allocate adequate physical memory to buffer pools to minimize disk I/O wait times.
- Use Lock Avoidance Techniques: Set
DB2_EVALUNCOMMITTED=YESto skip rows that do not satisfy search predicates during scans. - Implement Reorg Checks: Monitor table and index fragmentation and schedule automated reorganizations (
REORG TABLE).
Don't:
- Use unindexed foreign keys: Unindexed child foreign keys cause table-level locks during parent row deletions.
- Run long-running analytical queries against the OLTP primary: Direct analytical queries to HADR read-on-standby replicas.
- Omit isolation levels: Explicitly declare isolation levels (
WITH CS,WITH UR) to prevent unnecessary row locking.
Troubleshooting
| Error | Cause | Solution |
SQL0911N Deadlock or timeout (Reason code 68) | Lock escalation or concurrent transactions contending on same pages. | Commit transactions frequently; check LOCKLIST and MAXLOCKS settings. |
SQL0204N Undefined name | Table or schema does not exist or user lacks schema qualification. | Qualify tables explicitly (e.g. SCHEMA.TABLENAME) or set CURRENT SCHEMA. |
SQL0286N Default table space cannot be found | Table row size exceeds maximum page size of default tablespace. | Create a tablespace with a larger page size (16K or 32K) for wide tables. |
References
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.

