DB2 Merge Query Example (Adding WC SHPARRANGE Records)

DB2 Merge Query Example (Adding WC SHPARRANGE Records)

So, I was recently working on a client engagement and was needing to update the WebSphere Commerce SHPARRANGE table, to enable certain functionality in an external application. Not knowing what data already existed in the production system, I wanted the ability to write a query that would update existing or insert new data, to verify the records that I needed to exist.

[ Read More ]

DB2 Database Backup and Restore Using the Command Line

DB2 Database Backup and Restore Using the Command Line

I was recently working with an off-shore developer, trying to get their WebSphere Commerce database updated to a state that it can be used with the current state of the WebSphere Commerce project I’m currently working on. They were having permission issues when attempting to run a database backup and restore through the IBM Control Center for DB2 on Windows. As a result of the need to control the user credentials that will be backing up and restoring the database, I put together the following commands that can be ran on the command line to perform database backup and restore operations, and figured I’d share these with everyone.

[ Read More ]

Truncate Table with 'ALTER TABLE' Statement in DB2

Truncate Table with ‘ALTER TABLE’ Statement in DB2

I was recently trying to clear out an entire table within a DB2 database, actually the CACHEIVL table within my local WebSphere Commerce toolkit instance containing roughly 9,000,000+ records, and I wanted to simply remove the data. I was attempting to run a TRUNCATE statement; however, that kept failing miserably, and realized that there was another way to truncate a table, without having to run a TRUNCATE statement.

[ Read More ]

Delete Using Commit Count DB2 Stored Procedure

Delete Using Commit Count DB2 Stored Procedure

I recently have come across the need to delete millions of rows from a variety of tables within my WebSphere Commerce instance, but have been unable to as the transaction log fills all the way up and the transaction errors out. Granted, there are several options that I could have taken such as to increase the transaction log size; however, that isn’t always feasible depending upon the environment you are working with.

[ Read More ]

Quick Lookup of SQL Error Codes in DB2

Quick Lookup of SQL Error Codes in DB2

I was recently writing some DB2 SQL queries, and was seeing some DB2 error codes returned when attempting to run those queries. Typically I lookup the error codes on the DB2 InfoCenter; however, I recently just discovered a significantly quicker way to determine what the cryptic DB2 error codes are trying to say without using InfoCenter.

[ Read More ]