因为Zabbix的数据库中很多问题是当初设置的问题导致,属于无效数据,现在想要清空历史冗余数据。
建议可以运行以下语句,清空历史数据。
SET foreign_key_checks=0;
truncate table history;
optimize table history;
truncate table history_uint;
optimize table history_uint;
truncate table history_str;
optimize table history_str;
truncate table history_text;
optimize table history_text;
truncate table history_log;
optimize table history_log;
truncate table trends;
optimize table trends;
truncate table trends_uint;
optimize table trends_uint;
truncate table problem;
optimize table problem;
truncate table events;
optimize table events;
truncate table event_recovery;
optimize table event_recovery;
SET foreign_key_checks=1;