How can you use db2evmonfmt tool to monitor database information?
The db2evmonfmt tool is a java based tool that requires java to work correctly. This tool must be setup to view unformatted event table data.
First you must have an event monitor that uses an unformatted event table. This example illustrates how to setup the event monitor for UOW. But this tool can be used for any event monitor that utilizes an unformatted event table.
1. Create the event monitor.
db2 "create event monitor my_uow_evmon for unit of work write to unformatted event table (in userspace1)"
2. Update the monitor switches.
db2 udpate dbm cfg for DFT_MON_UOW using on
3. Then update the db cfg setting mon_uow_data
db2 update db cfg for dbname using mon_uow_data base
4. Run some queries. To add data to the event monitor table.
5. Setup the db2evmonfmt tool.
Now after an install the java classes and pathes should be setup. So this may be done in your env as well. Check by doing this.
This will show you the paths setup for this. And if you have to alter them. They should look something like this.
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.9) (rhel-126.96.36.199.9.el5_9-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
If any of these are not setup like this you will have to export them to your env manually.
6. After you verify these paths are correct. Then you need to move the app and compile it. You will need to move these files to the location you will wish to run this at.
cp db2evmonfmt.java /home/db2v97
cp DB2EvmonUOW.xsl /home/db2v97 <-----------------------------You need to copy all the xsl that you plan to use. For this I only did UOW.
7. A java compiler maybe needed, one option would be to use the open java development kit. To install it you must be root and run something similar to:
yum install java-1.6.0-openjdk-devel
Once this is done then you should be able to compile it.
8. After the compiler is installed run the following command to complete the process:
As the instance id used to create the event.
9. To view the output you can run something like:
java db2evmonfmt -d sample -ue MY_UOW_EVMON -ftext