因为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;
本文介绍如何使用SQL语句在Zabbix中清除无效的历史数据,包括truncating和optimizing多个相关表,以保持数据库整洁高效。
1899

被折叠的 条评论
为什么被折叠?



