Checking and Repairing the tables in the Zimbra logger database

Posted by aionman on Oct 29, 2009 in Zimbra |

Here is an example, using the “raw_logs” table:

$ logmysql zimbra_logger

mysql> check table raw_logs;
+————————+——-+———-+———-+
| Table                  | Op    | Msg_type | Msg_text |
+————————+——-+———-+———-+
| zimbra_logger.raw_logs | check | status   | OK       |

+————————+——-+———-+———-+
1 row in set (1.06 sec)
If a table does not show OK status, try repairing:

mysql> repair table raw_logs;
+————————+——–+———-+———-+
| Table                  | Op     | Msg_type | Msg_text |
+————————+——–+———-+———-+
| zimbra_logger.raw_logs | repair | status   | OK       |
+————————+——–+———-+———-+

1 row in set (2.32 sec)

How to shrink logger database
For first time is good to clean db manually if the database is very big. The commands bellow will delete all data in three tables (mta, amavis, raw_logs). If you need this data don’t execute them!

$zmlogswatchctl stop (don’t execute “zmloggerctl stop” this also stops logger mysqld)
$logmysql -D zimbra_logger
mysql> delete from amavis;
mysql> optimize table amavis;
mysql> delete from mta;
mysql> optimize table mta;
mysql> delete from raw_logs;
mysql> optimize table raw_logs;
mysql> quit
$zmlogswatchctl start

Comments are closed.

Copyright © 2012 IT Support Blog All rights reserved. Theme by Laptop Geek.