博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
定时删除zabbix mysql数据
阅读量:6142 次
发布时间:2019-06-21

本文共 897 字,大约阅读时间需要 2 分钟。

hot3.png

use zabbix; DELIMITER // create PROCEDURE delete_history() begin delete from history_log where to_days(now())-to_days(from_unixtime(clock))>90; delete from history_text where to_days(now())-to_days(from_unixtime(clock))>90; delete from history_str where to_days(now())-to_days(from_unixtime(clock))>90; delete from events where to_days(now())-to_days(from_unixtime(clock))>365; delete from auditlog where to_days(now())-to_days(from_unixtime(clock))>365; delete from alerts where to_days(now())-to_days(from_unixtime(clock))>365; delete from trends where to_days(now())-to_days(from_unixtime(clock))>365; delete from trends_uint where to_days(now())-to_days(from_unixtime(clock))>365; end; // DELIMITER ; SET GLOBAL event_scheduler = ON; create event deletehistoryplan ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY do call delete_history();

转载于:https://my.oschina.net/birdlovecloud/blog/339303

你可能感兴趣的文章
数据持久层
查看>>
极光推送发送控制/别名/取值
查看>>
ArcGIS Engine开发前基础知识(4)
查看>>
Vivado Logic Analyzer的使用(二)
查看>>
[Git] git merge之squash
查看>>
C++/CLI
查看>>
Kerberos安全体系详解---Kerberos的简单实现
查看>>
Vuex demo
查看>>
新建swap分区的规划、挂载和自动挂载示例
查看>>
MySQL用户授权【转】
查看>>
我算是优秀的程序员吗?
查看>>
链表合并
查看>>
Delphi应用程序的调试(五)其他调试工具
查看>>
如何编写可维护的面向对象JavaScript代码
查看>>
win8: html5+css3+js
查看>>
Emacs 24.3支持cygwin上使用Win32 GUI
查看>>
对于一个排序数组,创建最低高度的Binary Tree
查看>>
Android-----判断是否有服务运行
查看>>
poj2392 Space Elevator(多重背包)
查看>>
oracle中恢复删除的表
查看>>