Remove Duplicate Records from a DB2 Table

Remove Duplicate Records from a DB2 Table

I was recently trying to add a unique index on a table, and it gave me an error that the index could not be created because the table contained duplicate records across the fields I was trying to use in my unique index. As a result I found a need to remove duplicate records from my table, and decided to share the code I used to do so below.

[ Read More ]

DB2 Maintenance Script (RUNSTATS, REORG)

DB2 Maintenance Script (RUNSTATS, REORG)

I had a local copy of a WebSphere Commerce database that was performing horribly, and I decided to create a script that would retrieve a list of all available tables for all non-system schemas, and perform a RUNSTATS and REORG for those tables.

[ Read More ]

SQL Query to Determine a Master Catalog ID

SQL Query to Determine a Master Catalog ID

Working on a project recently I found the need to determine the master catalog for a list of stores within a WebSphere Commerce database. Seeing as a WebSphere Commerce instance can contain a variety of stores, ranging from your traditional Consumer Direct model to a more extensible Extended Site model, I generated the following query which can be run against the WebSphere Commerce database to properly determine the master catalog identifier for each store.

[ Read More ]