Wednesday, March 12, 2008

Exporting history data in CSV format

It is very easy to export the history data in TDW using database tools such as DB2 Command Line Editor. However, sometimes you might want to export the history data BEFORE it is collected by Warehouse. This article explains how to take a sneak-peak at the history data on the managed system/TEMS before it goes to data warehouse.

Overview

The history data on the managed system is located under \tmaitm6\logs directory in Windows systems. Unix/Linux systems have the history data stored under ///hist directory. For example, on my linux system, the history data is stored under /opt/IBM/ITM/li6263/lz/hist.

The krarloff program

You will see two files, a header file and data file, for each attribute group eligible for history collection in the history data directory. The data file is stored in a binary format and you can't extract the data using conventional tools. ITM provides a tool called krarloff for this purpose.

A word of caution though. This program renames the data file with .old extension causing the data to be skipped by the Warehouse proxy. You have to rename the file back removing the .old extension for the data collection to happen.

The following command exports the collected data into a csv file and renames the file back without .old extension for data collection.

C:\ibm\itm\tmaitm6\logs> krarloff -d , -o WTPROCESS.CSV -s WTPROCESS
C:\ibm\itm\tmaitm6\logs> move WTPROCESS.old WTPROCESS

No comments: