清除zabbix歷史緩存

MySQL>use zabbix;

為樅陽等地區(qū)用戶提供了全套網(wǎng)頁設計制作服務,及樅陽網(wǎng)站建設行業(yè)解決方案。主營業(yè)務為成都網(wǎng)站設計、成都網(wǎng)站制作、樅陽網(wǎng)站設計,以傳統(tǒng)方式定制建設網(wǎng)站,并提供域名空間備案等一條龍服務,秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務。我們深信只要達到每一位用戶的要求,就會得到認可,從而選擇與我們長期合作。這樣,我們也可以走得更遠!

顯示zabbix數(shù)據(jù)庫中的表大??;

mysql>SELECT table_name AS "Tables", round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" FROM information_schema.TABLES WHERE table_schema = 'zabbix' ORDER BY (data_length + index_length) DESC;

+----------------------------+------------+

| Tables                     | Size in MB |

+----------------------------+------------+

| history_uint               |     887.00 |

| history                    |     674.05 |

| trends_uint                |      22.38 |

| trends                     |      19.39 |

| events                     |       4.55 |

| images                     |       1.53 |

| items                      |       0.72 |

| history_str                |       0.33 |

| alerts                     |       0.25 |

| items_applications         |       0.23 |

| profiles                   |       0.22 |

| auditlog                   |       0.17 |

| triggers                   |       0.14 |

| graphs                     |       0.13 |

| hosts                      |       0.11 |

| graphs_items               |       0.11 |

| sysmaps_elements           |       0.09 |

| item_discovery             |       0.09 |

| sysmaps                    |       0.08 |

| httptest                   |       0.08 |

| functions                  |       0.08 |

| sysmaps_links              |       0.06 |

| acknowledges               |       0.06 |

| group_prototype            |       0.06 |

| scripts                    |       0.06 |

| actions                    |       0.06 |

| slideshows                 |       0.05 |

| config                     |       0.05 |

| item_application_prototype |       0.05 |

| slideshow_usrgrp           |       0.05 |

| sysmaps_link_triggers      |       0.05 |

| optemplate                 |       0.05 |

| hosts_templates            |       0.05 |

| slideshow_user             |       0.05 |

| media                      |       0.05 |

| opmessage_usr              |       0.05 |

| hosts_groups               |       0.05 |

| users_groups               |       0.05 |

| interface                  |       0.05 |

| slides                     |       0.05 |

| screens                    |       0.05 |

| dservices                  |       0.05 |

| opmessage_grp              |       0.05 |

| maintenances_windows       |       0.05 |

| screen_usrgrp              |       0.05 |

| sysmap_usrgrp              |       0.05 |

| drules                     |       0.05 |

| maintenances_hosts         |       0.05 |

| screen_user                |       0.05 |

| icon_mapping               |       0.05 |

| opgroup                    |       0.05 |

| rights                     |       0.05 |

| services_links             |       0.05 |

| maintenances_groups        |       0.05 |

| application_template       |       0.05 |

| host_discovery             |       0.05 |

| icon_map                   |       0.05 |

| trigger_depends            |       0.05 |

| application_prototype      |       0.05 |

| httptestitem               |       0.05 |

| sysmap_user                |       0.05 |

| service_alarms             |       0.05 |

| application_discovery      |       0.05 |

| history_text               |       0.05 |

| opcommand_hst              |       0.05 |

| httpstepitem               |       0.05 |

| opcommand_grp              |       0.05 |

| httpstep                   |       0.03 |

| opcommand                  |       0.03 |

| expressions                |       0.03 |

| media_type                 |       0.03 |

| conditions                 |       0.03 |

| usrgrp                     |       0.03 |

| groups                     |       0.03 |

| interface_discovery        |       0.03 |

| autoreg_host               |       0.03 |

| escalations                |       0.03 |

| mappings                   |       0.03 |

| group_discovery            |       0.03 |

| auditlog_details           |       0.03 |

| users                      |       0.03 |

| sessions                   |       0.03 |

| opmessage                  |       0.03 |

| hostmacro                  |       0.03 |

| services_times             |       0.03 |

| dhosts                     |       0.03 |

| applications               |       0.03 |

| trigger_discovery          |       0.03 |

| graph_theme                |       0.03 |

| operations                 |       0.03 |

| services                   |       0.03 |

| graph_discovery            |       0.03 |

| regexps                    |       0.03 |

| opconditions               |       0.03 |

| sysmap_url                 |       0.03 |

| valuemaps                  |       0.03 |

| dchecks                    |       0.03 |

| sysmap_element_url         |       0.03 |

| screens_items              |       0.03 |

| item_condition             |       0.03 |

| housekeeper                |       0.02 |

| ids                        |       0.02 |

| opinventory                |       0.02 |

| host_inventory             |       0.02 |

| maintenances               |       0.02 |

| globalvars                 |       0.02 |

| proxy_history              |       0.02 |

| globalmacro                |       0.02 |

| proxy_dhistory             |       0.02 |

| timeperiods                |       0.02 |

| proxy_autoreg_host         |       0.02 |

| dbversion                  |       0.02 |

| history_log                |       0.02 |

+----------------------------+------------+

113 rows in set (0.14 sec)

描述表結構:

mysql>desc history_uint;

+--------+---------------------+------+-----+---------+-------+

| Field  | Type                | Null | Key | Default | Extra |

+--------+---------------------+------+-----+---------+-------+

| itemid | bigint(20) unsigned | NO   | MUL | NULL    |       |

| clock  | int(11)             | NO   |     | 0       |       |

| value  | bigint(20) unsigned | NO   |     | 0       |       |

| ns     | int(11)             | NO   |     | 0       |       |

+--------+---------------------+------+-----+---------+-------+

4 rows in set (0.00 sec)

清除歷史緩存:

mysql> truncate table history;

Query OK, 0 rows affected (0.15 sec)

mysql> truncate table history_uint;

Query OK, 0 rows affected (0.13 sec)

有時候我們會需要清除一個表格中的所有資料。要達到者個目的,一種方式是我們在 SQL DROP 那一頁 看到 的 DROP TABLE 指令。不過這樣整個表格就消失,而無法再被用了。另一種方式就是運用 TRUNCATE TABLE 的指令。在這個指令之下,表格中的資料會完全消失,可是表格本身會繼續(xù)存在。 TRUNCATE TABLE 的語法為下:

TRUNCATE TABLE "表格名";

所以,我們?nèi)绻宄?nbsp;SQL Create Table 那一頁建立的顧客表格之內(nèi)的資料,我們就打入:

TRUNCATE TABLE Customer;

新聞名稱:清除zabbix歷史緩存
URL網(wǎng)址:http://bm7419.com/article46/igdseg.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供營銷型網(wǎng)站建設、網(wǎng)站營銷定制網(wǎng)站、外貿(mào)建站、網(wǎng)站制作、品牌網(wǎng)站設計

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

營銷型網(wǎng)站建設