iis服务器助手广告广告
返回顶部
首页 > 资讯 > 数据库 >Zabbix-Server数据库mysql的libdata1 mysqllog文件过大
  • 615
分享到

Zabbix-Server数据库mysql的libdata1 mysqllog文件过大

2024-04-02 19:04:59 615人浏览 八月长安
摘要

        今天我们的zabbix-server机器上线半年时间,占用了500G空间,我一步步排查结果发现是/var/li

        今天我们的zabbix-server机器上线半年时间,占用了500G空间,我一步步排查结果发现是/var/lib/Mysql/下的libdata1文件过大,已经达到了300G。我立即想到了zabbix的数据库原因,zabbix的数据库他的表模式是共享表空间模式,随着数据增长,ibdata1 越来越大,性能方面会有影响,而且innodb把数据和索引都放在ibdata1下。

共享表空间模式:

InnoDB 默认会将所有的数据库InnoDB引擎的表数据存储在一个共享空间中:ibdata1,这样就感觉不爽,增删数据库的时候,ibdata1文件不会自动收缩,单个数据库的备份也将成为问题。通常只能将数据使用mysqldump 导出,然后再导入解决这个问题。

独立表空间模式:

优点:

1.每个表都有自已独立的表空间。

2.每个表的数据和索引都会存在自已的表空间中。

3.可以实现单表在不同的数据库中移动。

4.空间可以回收(drop/truncate table方式操作表空间不能自动回收)

5.对于使用独立表空间的表,不管怎麽删除,表空间的碎片不会太严重的影响性能,而且还有机会处理。

缺点:

单表增加比共享空间方式更大。

结论:

共享表空间在Insert操作上有一些优势,但在其它都没独立表空间表现好,所以我们要改成独立表空间。

当启用独立表空间时,请合理调整一下innodb_open_files 参数。

下面我们来讲下如何讲zabbix数据库修改成独立表空间模式

  1. 查看文件大小

  2. l  查看系统空间利用率

[root@zabbix ~]# df -h

Filesystem                     Size  Used Avail Use% Mounted on

/dev/mapper/vg_zabbix-lv_root 1000G  468G 482G  50% /

tmpfs                          7.8G     0 7.8G   0% /dev/shm

/dev/sda1                      485M   39M 421M   9% /boot

  • 查看文件空间占用情况

[root@zabbix ~]# du / -h --max-depth=1

12K     /.dbus

4.0K    /selinux

1.7M    /tmp

du: cannot access `/proc/7012/task/7012/fd/4': No suchfile or directory

du: cannot access `/proc/7012/task/7012/fdinfo/4': Nosuch file or directory

du: cannot access `/proc/7012/fd/4': No such file ordirectory

du: cannot access `/proc/7012/fdinfo/4': No such fileor directory

0       /proc

4.0K    /media

4.0K    /srv

8.0K    /mnt

1.2G    /root

0       /net

36K     /home

39M     /etc

462G    /var

29M     /boot

1.1G    /backup

7.7M    /bin

16K    /lost+found

3.5G    /usr

0       /misc

27M     /lib64

0       /sys

8.0K    /opt

15M     /sbin

164K    /dev

149M    /lib

468G    /

 

[root@zabbix ~]# cd /var/

[root@zabbix var]# du . -h --max-depth=1 

504K    ./spool

139G    ./log

4.0K    ./tmp

8.0K    ./db

103M    ./www

244K    ./run

16K     ./lock

4.0K    ./crash

4.0K   ./account

4.0K    ./local

12K     ./yp

33M     ./cache

4.0K   ./preserve

4.0K    ./cvs

4.0K    ./games

4.0K    ./gdm

4.0K    ./opt

8.0K    ./empty

324G    ./lib

4.0K    ./nis

463G    .

 

[root@zabbix var]# cd log/

[root@zabbix log]# ll

total 145373448

-rw-------. 1 root  root           2368 Oct 24  2016 anaconda.ifcfg.log

-rw-------. 1 root  root          35914 Oct 24  2016 anaconda.log

-rw-------. 1 root  root         181001 Oct 24  2016 anaconda.program.log

-rw-------. 1 root  root         300366 Oct 24  2016 anaconda.storage.log

-rw-------. 1 root  root         114857 Oct 24  2016 anaconda.syslog

-rw-------. 1 root  root          28547 Oct 24  2016 anaconda.xlog

-rw-------. 1 root  root         115596 Oct 24  2016 anaconda.yum.log

drwxr-x---. 2 root  root           4096 May  5 19:50 audit

-rw-r--r--  1root   root           2607 Jun  5 07:00 boot.log

-rw-------  1root   utmp              0 Jun  1 03:31 btmp

-rw-------  1root   utmp            768 May  5 18:38 btmp-20170601

drwxr-xr-x. 2 root  root           4096 Oct 24  2016 ConsoleKit

-rw-------  1root   root          24280 Jun  5 10:30 cron

-rw-------  1root   root         128516 May 14 03:23 cron-20170514

-rw-------  1root   root         129746 May 21 03:40 cron-20170521

-rw-------  1root   root         128931 May 28 03:12 cron-20170528

-rw-------  1root   root         129139 Jun  4 03:31 cron-20170604

drwxr-xr-x. 2 lp    sys            4096 Aug 17  2013 cups

-rw-r--r--  1root   root          69891 Jun  5 07:00 dmesg

-rw-r--r--  1root   root          69891 May 29 07:00 dmesg.old

-rw-------  1root   root              0 Jan  1 03:32 dracut.log

-rw-r--r--. 1 root  root         345367 Oct 24  2016 dracut.log-20170101

drwxrwx--T. 2 root  gdm            4096 Oct 24  2016 gdm

drwx------. 2 root  root           4096 Jun  4 03:31 Httpd

-rw-r--r--. 1 root  root         145708 Jun  5 10:03 lastlog

-rw-------  1root   root           1629 Jun  5 07:00 maillog

-rw-------  1root   root           4465 May 13 08:19 maillog-20170514

-rw-------  1root   root           5153 May 20 06:42 maillog-20170521

-rw-------  1root   root           5153 May 27 06:30 maillog-20170528

-rw-------  1root   root           5158 Jun  3 06:28 maillog-20170604

-rw-------  1root   root          78017 Jun  5 10:05 messages

-rw-------  1root   root        1317112 May 14 03:05 messages-20170514

-rw-------  1root   root        1068946 May 21 03:06 messages-20170521

-rw-------  1root   root          86245 May 28 03:05 messages-20170528

-rw-------  1root   root          86065 Jun  4 03:06 messages-20170604

-rw-r-----. 1 mysql  mysql 148857106048 Jun  5 10:30mysqld.log

drwxr-xr-x. 2 ntp   ntp            4096 Nov 24  2013 ntpstats

-rw-r--r--. 1 root  root             89 Oct 24  2016 pm-powersave.log

drwx------. 2 root  root           4096 Aug 23  2010 ppp

drwxr-xr-x. 2 root  root           4096 Oct 24  2016 prelink

drwxr-xr-x. 2 root  root           4096 Jun  5 00:00 sa

drwx------. 3 root  root           4096 Oct 24  2016 samba

-rw-------  1root   root            855 Jun  5 10:03 secure

-rw-------  1root   root           1855 May 12 18:54 secure-20170514

-rw-------  1root   root            207 May 15 07:00 secure-20170521

-rw-------  1root   root           1455 May 27 19:02 secure-20170528

-rw-------  1root   root           1503 May 31 23:22 secure-20170604

-rw-------. 1 root  root              0 Oct 24  2016 spice-vdagent.log

-rw-------  1root   root              0 Jun  4 03:31 spooler

-rw-------  1root   root              0 May  7 03:47 spooler-20170514

-rw-------  1root   root              0 May 14 03:23 spooler-20170521

-rw-------  1root   root              0 May 21 03:40 spooler-20170528

-rw-------  1root   root              0 May 28 03:12 spooler-20170604

drwxr-x---. 2 root  root           4096 Nov 23  2013 sssd

-rw-------. 1 root  root              0 Oct 24  2016 tallylog

-rw-r--r--. 1 root  root              0 Oct 24  2016 wpa_supplicant.log

-rw-rw-r--. 1 root  utmp         325632 Jun  5 10:03 wtmp

-rw-r--r--. 1 root  root          45892 Oct 25  2016 Xorg.0.log

-rw-r--r--. 1 root  root          44521 Oct 24  2016 Xorg.0.log.old

-rw-r--r--. 1 root  root          26974 Oct 24  2016 Xorg.9.log

-rw-------  1root   root           1663 Apr 12 15:04 yum.log

-rw-------. 1 root  root           6936 Dec  2  2016yum.log-20170101

drwxr-xr-x. 2 zabbix zabbix         4096 Oct 28  2016 zabbix

 

  • mysql.log日志文件占用空间过大,查看详细日志内容

[root@zabbix log]# tail mysqld.log

InnoDB: Your database may be corrupt or you may havecopied the InnoDB

InnoDB: tablespace but not the InnoDB log files. See

InnoDB:http://dev.mysql.com/doc/refman/5.1/en/forcing-innodb-recovery.html

InnoDB: for more infORMation.

170605 10:30:29 InnoDB: Error: page 14091764 log sequence number 462 2253153679

InnoDB: is in the future! Current system log sequencenumber 76 3553747713.

InnoDB: Your database may be corrupt or you may havecopied the InnoDB

InnoDB: tablespace but not the InnoDB log files. See

InnoDB:http://dev.mysql.com/doc/refman/5.1/en/forcing-innodb-recovery.html

InnoDB: for more information.

 

  • 查看数据库文件夹硬盘空间使用情况

[root@zabbix log]# cd /var/lib/mysql

[root@zabbix mysql]# ll -h

total 324G

-rw-rw----. 1 mysql mysql 324G Jun  5 15:15 ibdata1

-rw-rw----  1mysql mysql 5.0M Jun  5 15:15 ib_logfile0

-rw-rw----  1mysql mysql 5.0M Jun  5 15:15 ib_logfile1

drwx------. 2 mysql mysql 4.0K Oct 28  2016 mysql

srwxrwxrwx  1mysql mysql    0 Jun  5 14:54 mysql.sock

drwx------. 2 mysql mysql 4.0K Jun  5 12:39 zabbix

-rw-r--r--  1root  root  251M Jun 5 15:15 zabbix02.sql

-rw-r--r--  1root  root     0 Jun 5 15:06 zabbix.sql

                  

发现ibdata1 文件占用空间过大

2.清除zabbix数据库历史数据

1)查看哪些表的历史数据比较多

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 |

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

| events                     |  181851.00 |

| history_uint               |   92227.30 |

| history                    |    4590.27 |

| trends_uint                |    3851.88 |

| history_str                |     309.39 |

| trends                     |     156.75 |

| history_log                |      89.17 |

| items                      |      36.41 |

| item_discovery             |       6.23 |

| items_applications         |      6.17 |

| alerts                     |       3.45 |

| triggers                   |       1.69 |

| p_w_picpaths                     |       1.53 |

| application_template       |      0.63 |

| auditlog                   |       0.55 |

| acknowledges               |       0.55 |

| functions                  |       0.48 |

| graphs                     |       0.47 |

| graphs_items               |       0.44 |

| applications               |       0.41 |

| hosts                      |       0.33 |

| hosts_groups               |       0.27 |

| hostMacro                  |      0.22 |

| history_text               |       0.22 |

| trigger_discovery          |       0.20 |

| screens_items              |       0.16 |

| profiles                   |       0.16 |

| graph_discovery            |       0.13 |

| auditlog_details          |       0.13 |

| hosts_templates            |       0.11 |

| sysmaps_elements           |       0.09 |

| host_discovery             |       0.09 |

| interface                  |       0.09 |

| httptest                   |       0.08 |

| sysmaps                    |       0.08 |

| sysmaps_links              |       0.06 |

| scripts                    |       0.06 |

| group_prototype            |       0.06 |

| interface_discovery        |      0.06 |

| drules                     |       0.05 |

| icon_mapping               |       0.05 |

| users_groups               |       0.05 |

| slideshows                 |       0.05 |

| media                      |       0.05 |

| icon_map                   |       0.05 |

| service_alarms             |       0.05 |

| opgroup                    |       0.05 |

| slideshow_usrgrp           |       0.05 |

| httptestitem               |       0.05 |

| sysmaps_link_triggers      |      0.05 |

| item_application_prototype |       0.05 |

| slideshow_user             |       0.05 |

| application_prototype      |      0.05 |

| maintenances_windows       |      0.05 |

| slides                     |       0.05 |

| application_discovery      |      0.05 |

| maintenances_hosts         |      0.05 |

| httpstepitem              |       0.05 |

| screens                    |       0.05 |

| config                     |       0.05 |

| trigger_depends            |       0.05 |

| optemplate                 |       0.05 |

| maintenances_groups        |      0.05 |

| sysmap_usrgrp              |       0.05 |

| screen_usrgrp              |       0.05 |

| opcommand_hst              |       0.05 |

| opmessage_usr              |       0.05 |

| actions                    |       0.05 |

| maintenances               |       0.05 |

| sysmap_user                |       0.05 |

| screen_user                |       0.05 |

| opcommand_grp              |       0.05 |

| services_links             |       0.05 |

| dservices                  |       0.05 |

| opmessage_grp              |       0.05 |

| rights                     |       0.05 |

| services                   |       0.03 |

| opmessage                  |       0.03 |

| usrgrp                     |       0.03 |

| sysmap_element_url         |      0.03 |

| regexps                   |       0.03 |

| media_type                 |       0.03 |

| dhosts                     |       0.03 |

| proxy_history              |       0.03 |

| item_condition             |       0.03 |

| users                      |       0.03 |

| globalmacro                |       0.03 |

| proxy_dhistory             |       0.03 |

| mappings                   |       0.03 |

| groups                     |       0.03 |

| dchecks                    |       0.03 |

| proxy_autoreg_host         |      0.03 |

| operations                 |       0.03 |

| expressions                |       0.03 |

| group_discovery            |       0.03 |

| opconditions               |       0.03 |

| sessions                   |       0.03 |

| httpstep                   |       0.03 |

| conditions                 |       0.03 |

| services_times             |       0.03 |

| eScalations                |       0.03 |

| autoreg_host               |       0.03 |

| valuemaps                  |       0.03 |

| sysmap_url                 |       0.03 |

| graph_theme                |       0.03 |

| opcommand                  |       0.03 |

| timeperiods                |       0.02 |

| opinventory                |       0.02 |

| globalvars                 |       0.02 |

| host_inventory             |      0.02 |

| dbversion                  |       0.02 |

| housekeeper                |       0.02 |

| ids                        |       0.02 |

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

113 rows in set (7.31 sec)

可以看到events、history和history_uint这三个表的历史数据最多。

由于数据量太大,按照普通的方式delete数据的话基本上不太可能。

所以决定直接采用truncatetable的方式来快速清空这些表的数据,再使用mysqldump导出数据,删除共享表空间数据文件,重新导入数据。其中events空间过大,尝试truncatetable无果,果断抛弃

2)停止相关服务,避免写入数据

[root@zabbix ~]#/etc/init.d/zabbix_server stop

[root@zabbix ~]#/etc/init.d/httpd stop

3)清空历史数据

[root@zabbix ~]#mysql -uroot -p

mysql > use zabbix;

Database changed

 

mysql > truncate table history;

Query OK, 123981681 rows affected (0.23 sec)

 

mysql > optimize table history;

1 row in set (0.02 sec)

 

mysql > truncate table history_uint;

Query OK, 57990562 rows affected (0.12 sec)

 

mysql > optimize table history_uint;

1 row in set (0.03 sec)

3.备份数据库

[root@zabbix~]#mysqldump -uroot -p zabbix > /data/zabbix.sql

4.停止数据库并删除共享表空间数据文件

1)停止数据库

[root@zabbix ~]#/etc/init.d/mysqld stop

2)删除共享表空间数据文件

[root@zabbix ~]#cd /var/lib/mysql

[root@zabbix ~]#rm -rf ib*

[root@zabbix ~]#mkdir /tmp/zabbix

 

[root@zabbix ~]#mv zabbix/* /tmp/zabbix

 

5.增加innodb_file_per_table参数

[root@zabbix ~]#vi /etc/my.cnf

在[mysqld]下设置

innodb_file_per_table=1

6.启动mysql

[root@zabbix ~]#/etc/init.d/mysqld start

7.查看innodb_file_per_table参数是否生效

[root@zabbix ~]#mysql -uroot -p

mysql> show variables like '%per_table%';

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

| Variable_name | Value |

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

| innodb_file_per_table | ON |

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

1 row in set (0.00 sec)

8.重新导入数据库

mysql >use zabbix;

mysql >source mysql.sql

9.最后,恢复相关服务进程

[root@zabbix ~]#/etc/init.d/zabbix_server start

[root@zabbix ~]#/etc/init.d/httpd start

恢复完服务之后,查看/分区的容量就下去了,之前是50%,处理完之后变成了2%。可见其成效

[root@zabbix ~]# df -h

Filesystem                     Size  Used Avail Use% Mounted on

/dev/mapper/vg_zabbix-lv_root 1000G   13G 936G   2% /

tmpfs                          7.8G     0 7.8G   0% /dev/shm

/dev/sda1                      485M   39M 421M   9% /boot

 

 

mysql> select table_name, (data_length+index_length)/1024/1024 as total_mb,table_rows from information_schema.tables where table_schema='zabbix' order bytable_rows;

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

| table_name                 | total_mb      | table_rows |

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

| slideshows                 |    0.04687500 |          0 |

| globalvars                |    0.01562500 |          0 |

| proxy_history              |    0.03125000 |          0 |

| icon_map                   |    0.04687500 |          0 |

| sysmaps_links              |    0.06250000 |          0 |

| service_alarms             |    0.04687500 |          0 |

| opinventory                |    0.01562500 |          0 |

| slideshow_usrgrp           |   0.04687500 |          0 |

| proxy_dhistory             |    0.03125000 |          0 |

| sysmaps_link_triggers      |   0.04687500 |          0 |

| proxy_autoreg_host         |   0.03125000 |          0 |

| application_prototype      |   0.04687500 |          0 |

| maintenances_windows       |   0.04687500 |          0 |

| item_application_prototype |    0.04687500 |          0 |

| host_inventory             |    0.01562500 |          0 |

| slideshow_user             |    0.04687500 |          0 |

| application_discovery      |   0.04687500 |          0 |

| maintenances_hosts         |   0.04687500 |          0 |

| opconditions               |    0.03125000 |          0 |

| slides                     |    0.04687500 |          0 |

| maintenances_groups        |   0.04687500 |          0 |

| sysmap_usrgrp              |    0.04687500 |          0 |

| screen_usrgrp              |   0.04687500 |          0 |

| opcommand_hst              |    0.04687500 |          0 |

| maintenances               |    0.04687500 |          0 |

| housekeeper                |    0.01562500 |          0 |

| sysmap_user                |    0.04687500 |          0 |

| screen_user                |    0.04687500 |          0 |

| opcommand_grp              |    0.04687500 |          0 |

| services_times             |    0.03125000 |          0 |

| escalations                |    0.03125000 |          0 |

| sysmap_url                 |    0.03125000 |          0 |

| opcommand                  |    0.03125000 |          0 |

| services_links             |    0.04687500 |          0 |

| sysmap_element_url         |   0.03125000 |          0 |

| icon_mapping              |    0.04687500 |          0 |

| timeperiods                |    0.01562500 |          0 |

| services                   |    0.03125000 |          0 |

| httptest                   |    0.07812500 |          1 |

| sysmaps_elements           |   0.09375000 |          1 |

| dbversion                  |    0.01562500 |          1 |

| sysmaps                    |    0.07812500 |          1 |

| config                     |    0.04687500 |          1 |

| autoreg_host               |    0.03125000 |          1 |

| globalmacro                |    0.03125000 |          2 |

| optemplate                 |    0.04687500 |          2 |

| opmessage_usr              |    0.04687500 |          2 |

| graph_theme                |    0.03125000 |          2 |

| media                      |    0.04687500 |          3 |

| users_groups               |    0.04687500 |          3 |

| httptestitem               |    0.04687500 |          3 |

| scripts                    |    0.06250000 |          3 |

| dchecks                    |    0.03125000 |          3 |

| opgroup                    |    0.04687500 |          3 |

| users                      |    0.03125000 |          3 |

| httpstep                   |    0.03125000 |          3 |

| regexps                    |    0.03125000 |          3 |

| media_type                 |    0.03125000 |          3 |

| drules                     |    0.04687500 |          3 |

| expressions                |    0.03125000 |          4 |

| opmessage_grp              |    0.04687500 |          4 |

| usrgrp                     |    0.03125000 |          5 |

| opmessage                  |    0.03125000 |          6 |

| httpstepitem               |    0.04687500 |          9 |

| actions                   |    0.04687500 |          9 |

| dhosts                     |    0.03125000 |         12 |

| operations                 |    0.03125000 |         14 |

| dservices                  |    0.04687500 |         14 |

| group_prototype            |   0.06250000 |         15 |

| conditions                 |    0.03125000 |         17 |

| rights                     |    0.04687500 |         17 |

| group_discovery            |   0.03125000 |         19 |

| valuemaps                  |    0.03125000 |         21 |

| screens                    |    0.04687500 |         24 |

| groups                     |    0.03125000 |         31 |

| item_condition             |    0.03125000 |         31 |

| sessions                   |    0.03125000 |         39 |

| ids                        |    0.01562500 |         46 |

| trigger_depends            |   0.04687500 |         51 |

| mappings                   |    0.03125000 |        100 |

| hosts_templates            |   0.12500000 |        181 |

| p_w_picpaths                     |    1.53125000 |        192 |

| host_discovery             |    0.09375000 |        361 |

| interface_discovery        |   0.06250000 |        515 |

| hosts                      |    0.32812500 |        516 |

| profiles                   |    0.17187500 |        659 |

| interface                  |    0.09375000 |        691 |

| auditlog_details           |   0.12500000 |        707 |

| events                     |    0.17187500 |        759 |

| screens_items              |    0.15625000 |        805 |

| history_text               |    0.18750000 |       1201 |

| graph_discovery            |   0.12500000 |       1217 |

| graphs                     |    0.46875000 |       1330 |

| hosts_groups              |    0.26562500 |       1381 |

| hostmacro                  |    0.21875000 |       1569 |

| trigger_discovery          |   0.20312500 |       2017 |

| acknowledges               |    0.54687500 |       2408 |

| auditlog                   |    0.53125000 |       2546 |

| graphs_items               |    0.43750000 |       2706 |

| triggers                   |    0.68750000 |       2900 |

| functions                  |    0.50000000 |       3134 |

| application_template       |   0.51562500 |       4364 |

| applications               |    0.42187500 |       4512 |

| history                    |    0.46875000 |       4780 |

| alerts                     |    3.46875000 |       6242 |

| item_discovery             |    5.54687500 |      26567 |

| items_applications         |   6.54687500 |      30181 |

| items                      |   24.12500000 |      34425 |

| history_uint               |   12.03125000 |     123327 |

| history_log                |   88.67187500 |     479448 |

| history_str                |   76.17187500 |     743970 |

| trends                     |  122.68750000 |    2023329 |

| trends_uint                | 3076.00000000 |   51097289 |

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

113 rows in set (0.55 sec)


备注:truncate table events,太久没看到效果,尝试用delete shell脚本

#!/bin/bash

#delete events table

# edit by john zheng 20170606

i=1

while [ $i -lt events_id最大值 ];

do

echo "$i"

mysql -uroot -p密码 -e"

use zabbix;

delete from events where  eventid < $i;"

i=`expr $i '+' 100000`

done


尝试失败,时间更久,直接放弃,只保留events创建表语句

mysql> show create table events;

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

| Table  | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

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

| events | CREATE TABLE `events` (

  `eventid` bigint(20) unsigned NOT NULL,

  `source` int(11) NOT NULL DEFAULT '0',

  `object` int(11) NOT NULL DEFAULT '0',

  `objectid` bigint(20) unsigned NOT NULL DEFAULT '0',

  `clock` int(11) NOT NULL DEFAULT '0',

  `value` int(11) NOT NULL DEFAULT '0',

  `acknowledged` int(11) NOT NULL DEFAULT '0',

  `ns` int(11) NOT NULL DEFAULT '0',

  PRIMARY KEY (`eventid`),

  KEY `events_1` (`source`,`object`,`objectid`,`clock`),

  KEY `events_2` (`source`,`object`,`clock`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |

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

1 row in set (0.00 sec)


您可能感兴趣的文档:

--结束END--

本文标题: Zabbix-Server数据库mysql的libdata1 mysqllog文件过大

本文链接: https://www.lsjlt.com/news/38655.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • zabbix配置监控MySQL数据库的过程
    本篇内容介绍了“zabbix配置监控MySQL数据库的过程”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成! ...
    99+
    2024-04-02
  • Mysql数据库文件太大无法导入数据库
    mysql导入数据库的文件太大的解决办法: 第一步: 打开php.ini,找到 upload_max_filesize 、memory_limit 、post_max_size 这三个参数! upload_max_filesize:限制上传...
    99+
    2023-09-16
    mysql 数据库 php
  • mysql通过.frm和.ibd 文件恢复数据库
     问题背景:由于强制在服务关闭mysql导致部分数据表以及数据丢失 如下图只有.frm .ibd的文件为我的问题文件 查找不到表结构和表数据目录D:XXXX\mysql-5.7.24-winx64\data\mydata  从frm文件中...
    99+
    2023-09-21
    数据库 mysql
  • MSSQL数据库ndf文件大小变为0KB数据恢复过程
    一、故障描述 成都某客户,存储损坏,数据库崩溃。重组存储,恢复数据库文件,发现有四个ndf文件大小变为0 KB。数据库大小约80TB。数据库中有1223个文件,数据库每10天生成一个NDF文件,每个NDF大...
    99+
    2024-04-02
  • 数据库日志文件过大清理的方法有哪些
    这篇文章主要介绍“数据库日志文件过大清理的方法有哪些”,在日常操作中,相信很多人在数据库日志文件过大清理的方法有哪些问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”数据库日志文...
    99+
    2024-04-02
  • 通过Python实现对SQL Server 数据文件大小的监控告警功能
    1.需求背景 系统程序突然报错,报错信息如下: The transaction log for database '@dbname' is full. To find out wh...
    99+
    2024-04-02
  • Sql Server 压缩数据库日志文件的方法
    Sql Server 日志 _log.ldf文件太大,数据库文件有500g,日志文件也达到了500g,占用磁盘空间过大,且可能影响程序性能,需要压缩日志文件。 压缩日志脚本里要填的名字从要压缩的数据库属性里查看 脚本文...
    99+
    2022-11-24
    SqlServer压缩数据库 SqlServer日志文件
  • mysql的数据库文件在哪里
    小编给大家分享一下mysql的数据库文件在哪里,希望大家阅读完这篇文章后大所收获,下面让我们一起去探讨吧!mysql的数据库文件在哪里MySQL的数据文件就存放在Data目录。默认路径是“C:\Progra...
    99+
    2024-04-02
  • MySQL Server占用的句柄数过大怎么办
    这篇文章主要讲解了“MySQL Server占用的句柄数过大怎么办”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“MySQL S...
    99+
    2024-04-02
  • 【mysql数据损坏,通过ibd和frm文件批量恢复数据库数据】
    问题描述 客户那边的测试服务器下午3:00左右因不明原因,所有服务访问不了,ssh也无法连接,客户手动进行强制重启服务器,重启后将所有应用、中间件重启,重启nacos时发现无法连接数据库,通过账号密码...
    99+
    2023-09-02
    数据库 mysql
  • 如何解决mysql导入数据库文件太大的问题
    这篇文章给大家分享的是有关如何解决mysql导入数据库文件太大的问题的内容。小编觉得挺实用的,因此分享给大家做个参考。一起跟随小编过来看看吧。mysql导入数据库的文件太大的解决办法:首先打开【php.in...
    99+
    2024-04-02
  • SQL Server大战MySQL:谁将傲领数据库领域的宝座?
    SQL Server大战MySQL:谁将傲领数据库领域的宝座?随着信息时代的快速发展,数据库成为了各个行业中不可或缺的重要组成部分。在数据库领域,有两个独占鳌头的巨头SQL Server和MySQL,它们之间的竞争不仅仅是技术的较量,更是对...
    99+
    2023-10-22
    MySQL 数据库 sql server
  • Sql Server 数据库中怎么调用dll文件
    Sql Server 数据库中怎么调用dll文件,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。1.首先新建一个空的解决方案,并...
    99+
    2024-04-02
  • 怎么恢复SQL Server 2000损坏的数据库文件
    这篇文章主要讲解了“怎么恢复SQL Server 2000损坏的数据库文件”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“怎么恢复SQL Server 200...
    99+
    2024-04-02
  • mysql数据库存储数据的过程
    这篇文章主要讲解了“mysql数据库存储数据的过程”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“mysql数据库存储数据的过程”吧! 存储过程如下: J...
    99+
    2024-04-02
  • mysql数据库有哪些文件
    本篇内容介绍了“mysql数据库有哪些文件”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!1.1. ...
    99+
    2024-04-02
  • 怎么在Sql Server 数据库中调用dll文件
    怎么在Sql Server 数据库中调用dll文件?相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。1.首先新建一个空的解决方案,并添加一个类库,...
    99+
    2024-04-02
  • Sql Server中怎么删除数据库备份文件
    这篇文章将为大家详细讲解有关Sql Server中怎么删除数据库备份文件,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。代码如下: --可以先备份数据库[T...
    99+
    2024-04-02
  • mysql的.ibd文件过大如何处理
    这篇文章主要介绍了mysql的.ibd文件过大如何处理的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇mysql的.ibd文件过大如何处理文章都会有所收获,下面我们一起来看看吧。一条zabbix微信的磁盘告警打破...
    99+
    2023-07-02
  • Sql Server数据库文件丢失要怎么恢复
    这篇文章主要讲解了“Sql Server数据库文件丢失要怎么恢复”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Sql Server数据库文件丢失要怎么恢复”...
    99+
    2024-04-02
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作