Tablespace backups in a DB2 LUW DPF database

In this blog post, I will share about few gotchas to look out for when backing up tablespaces in a DB2 DPF database. What is DPF? I wrote a detailed blog post on

Why Tablespace backups?

Why should we look into backing up tablespaces instead of the entire database? Below are couple of instances when we want to backup tablespaces:

  • You just created a new tablespace; Before taking an incremental/delta backup, the newly created tablespace needs to be backed-up.
  • Tablespace is in BACKUP PENDING state. This can happen when we perform a load operation for a recoverable database and specify the COPY NO parameter. We can remove the tablespace from the BACKUP PENDING state by backing up the tablespace.
  • Is it practical to do database backups? A database backup for a multi-terabyte database (think Data Warehouse) is not practical all the time. It consumes too many resources (CPU, storage, lock contention etc.). If the recovery effort is well thought out, we can get away with performing tablespace level backups.

Continue reading


Creating a DB2 LUW (Linux, Unix and Windows) Sandbox database

Merriam Webster Dictionary defines ‘Sample’ as “a small amount of something that is given to people to try” and that is exactly what the SAMPLE database that is shipped along with every IBM’s DB2 LUW installation is. This database has objects that reflect a real world like data model along with sample data. It could be a nice play ground for someone who is looking to experiment with or to learn new features in DB2 LUW.

In this blog post, we will look at how simple it is to create this sample database. We will also look at what this database has to offer to us.

Continue reading

A primer in awk for DB2 LUW DBAs

Although awk and awkward start with the same three letters, awk by no means is awkward. Well, from the syntax of it (and I agree, sometimes, from its learning curve), it could be appear to be so. In this blog post, I share how awk’s most basic features could be powerful tools to get things done faster.

I use awk in many of my UNIX scripts that I write to automate routine tasks. In addition to this, I routinely write awk one-liners to save time. Many times, these one-liners are throw-away in that the same exact awk command might not be used again.

Continue reading

DBA tip – Easy way to handle single quotes in awk

It is no wonder that I cannot live without awk even a single (working) day in my life. Such is the power of awk (or AWK). It is simply the most powerful utility that I use on *IX (Linux/AIX) systems. awk makes my life easy when dealing with daily DBA tasks. I learned awk almost 10 years ago and I admit that it was tough to get used to its syntax. However, once I knew few basics, it was fun.

Continue reading

DBA’s friend — UNIX’s crontab utility

There are many tools and utilities that simplify routine tasks and empower DBAs to automate tasks and get the job done. One of them is UNIX’s crontab utility. Colloquially, this is referred to as ‘Cron’ . In this  blog post, first I will introduce few basics about crontab. We will then look at few gotchas to watch out for when using crontab in UNIX environments. Continue reading