Tuesday, April 13, 2010

Truncating logging tables in XMETA

Question>
Our customer forgot to purge logs in DB so in several days
LOGGING_XMETAGEN_LOGGINGEVENT1466CB5F table growed to enormous size. They
switched to FS logging and set up log purging. Now they want to get rid of
the data in that table.

I think it will be safe enough to delete rows from there (using db load of
course) and they to reorginize it to free up the space. Table reorg will
drop the table and recreate it and this part worries me a bit. AFAIK there
are no foreign keys and if WAS is down, I don't think there will be a
problem to drop and recreate the table, but still ... What are the
official procedure to do this task?

I saw an email about using LoggingAdmin.sh and then reorg, but I wanted to
be sure that reorg (that will DROP the table) doesn't cause any problems
(it's production environment).

Answer>
You can use the purge function available in web console but this will take long time to finish for this data size

This is what i use to delete all logging events from xmeta table

1. Create an empty file "empty.id"

2. execute this command. File empty.id should be in this directory

db2 import from empty.id of del replace into xmeta.logging_xmetagen_loggingEvent1466cb5f

No comments:

Post a Comment