file0001332675785 0

A Physical DBA Reviewing DDL

My background comes largely from the physical DBA world, though I’ve gained logical DBA skills over the years. Any reasonably mature IT organization will have a DBA at some level or another review SQL and DDL before it is implemented in production. Why Reviewing SQL and DDL is Important Reviewing SQL and DDL is important because there are some very...

DSC04677 2

DB2 Basics: Patching DB2

Like any software, DB2 requires frequent patching. A database should be one of the most secure parts of any enterprise, and keeping it secure means keeping up with the fixes that are delivered in fix packs. Fix Packs DB2 delivers many things through fixpacks, including: Security Fixes Bug Fixes New Functionality – though IBM goes back and forth on this...

PA281185 1

DB2 Basics: Stored Procedures, Functions, Modules, Oh My!

DB2 has a number of objects where that use procedural SQL. IBM calls this SQL PL, not to be confused with PL/SQL or TSQL, both similar concepts. Much PL/SQL also works in DB2, if you have the Oracle compatibility vector enabled. The various types of objects have different places and purposes, and it can be useful to understand the use...

IanB 2

Monitoring Extent Movement Progress

Since DB2 9.7, you have been able to reduce the size of tablespaces using the statement: ALTER TABLESPACE USERSPACE1 REDUCE MAX Using this functionality, however, requires that the tablespace uses automatic storage and that it was created with the reclaimable storage attribute. Unfortunately, tablespaces created in DB2 9.5 or earlier will not have the reclaimable storage attribute, and it’s not...

DSC03515 0

Funny SQL I Have Seen Lately

I’ve run across a few strange SQL statements lately, and while the mistakes they make are not the most impactful, I thought I’d share how I think they could be better written. Unnecessary use of a Common Table Expression This query isn’t really wrong, it just doesn’t make much sense. Here it is as I discovered it: with sortsnap as...

IsolationLevels 0

DB2 Basics: Isolation Levels and Concurrency Phenomena

Isolation levels are such a critical concept to maximizing concurrency for transaction processing databases where ACID is so critical. What is ACID? ACID stands for Atomicity, Consistency, Isolation, Durability. This is a set of concepts that applies to any transaction processing system, whether it is a Relational Database Management System (like DB2) or not. ACID is one of the big...

3

Happy 6th Blogiversary to db2commerce.com!

It has been 6 years since I started to blog, and about four and a half years of weekly blogging! Over that time, I have published over 460,000 words in more than 410 posts! That’s 4-8 books worth of content! I’m a whole reference shelf! Nearly 50,000 of those words were written by 6 guest bloggers: Mike Krafick Ian Bjorhovde...

DSC06398 0

Calculating Row Size for a Table

There are several scenarios with DB2 where we need to know what the “worst-case” row length is. That is, if all varying fields are completely full and any LOBs are maximally inlined, how much space could a single row actually take up? SYSCAT.TABLES gives us the average row size, which is useful for some use cases, but not all of...