当前位置:网站首页>MySQL database monthly growth problem
MySQL database monthly growth problem
2022-08-10 06:50:00 【DBAjack】
How to count the monthly data growth of a database in a mysql database?For example, now the database is 5G, find out the database size of the previous month, and then subtract it to get the monthly growth
Other Answer 1:
If there is no historical monitoring data, MySQL cannot record it internally.
Other Answer 2:
Write a monitoring script, du a data directory every day.The database itself does not record data increments
Other Answer 3:
You can roughly count the amount of data at the table or library level, collect it twice, and calculate the difference.
select table_schema, table_name, engine, table_type, sum(table_rows) as rows, round(sum(data_length)/1024/1024, 2) as `data(MB)`, round(sum(index_length)/1024/1024, 2) as `index(MB)`, round(sum(data_length+index_length)/1024/1024, 2) as `total_size(MB)`from information_schema.tableswhere table_schema not in ('mysql', 'information_schema', 'performance_schema', 'sys') and table_type not in('VIEW')group by table_schema, table_name, engine, table_typeorder by table_schema, table_name; Other Answer 4:
If there is a delete, it is not allowed, of course, if you want an overview, it is OK
Other Answer 5:
- For a single instance, the size of each database of the instance can be counted by the following statement:
SELECT table_schema,SUM(AVG_ROW_LENGTH*TABLE_ROWS+INDEX_LENGTH)/1024/1024 AS total_mb FROM information_schema.TABLES group by table_schema- The next thing to do is to write the results of the current day/month into the database table, such as dba_statistic.tmp_database_info:
insert into tmp_database_info (instance_id,business_ip,database_name,db_size,createdate)- If you want to count multiple instances, you need to loop through all instances through an automated script, and each instance performs the above select and insert operations
- We write clickhouse, the script is written in python
边栏推荐
- 结构体初阶
- 2022 Henan Mengxin League Game (5): University of Information Engineering C - Throwing a Handkerchief
- 机器学习_LGB调参汇总(开箱即食)
- BUUCTF Notes (web)
- 请问为什么sqlserver cdc,任务启动过了一天,会报这个错误,明明已经开启cdc了。
- 761. 特殊的二进制序列
- 如何正确理解线程机制中常见的I/O模型,各自主要用来解决什么问题?
- 个人博客系统
- 复现dns外带数据结合sqlmap
- ES13 - ES2022 - 第 123 届 ECMA 大会批准了 ECMAScript 2022 语言规范
猜你喜欢
随机推荐
Qt程序字体初始化引起的白屏问题
CuteOneP 一款php的OneDrive多网盘挂载程序 带会员 同步等功能
Ladies and gentlemen, oracle11g, cdc2.2, flink1.13.6, single-table incremental synchronization.Without adding data
2022河南萌新联赛第(五)场:信息工程大学 J - AC自动机
修改 QtCreator 配置解决 “无法运行 rc.exe” 问题
2022河南萌新联赛第(五)场:信息工程大学 H - 小明喝奶茶
order by injection and limit injection, and wide byte injection
神经网络可视化有3D版本了,美到沦陷 已开源
交换机的功能和ipv4
I would like to ask you guys, when FLink SQL reads the source, specify the time field of the watermark. If the specified field is in the grid
IDLE开发wordCount程序(第五弹)
3.事务篇【mysql高级】
求职
Unity3d famous project-Dark Tree translation
添加spark的相关依赖和打包插件(第六弹)
Qt使用私有接口绘制窗口阴影
tqdm高级使用方法(类keras进度条)
Regular backup of mysql database (retain backups for nearly 7 days)
2022 Henan Mengxin League Game (5): University of Information Engineering F - Split Turf
请问一下。Oracle CDC 连接器支持 LogMiner 和 XStream API 两种方式捕








