查整个库的状态:
select concat(truncate(sum(data_length)/1024/1024,2),‘MB‘) as data_size,
concat(truncate(sum(max_data_length)/1024/1024,2),‘MB‘) as max_data_size,
concat(truncate(sum(data_free)/1024/1024,2),‘MB‘) as data_free,
concat(truncate(sum(index_length)/1024/1024,2),‘MB‘) as index_size
from information_schema.tables
where TABLE_SCHEMA = ‘databasename‘;
查单表:
select concat(truncate(sum(data_length)/1024/1024,2),‘MB‘) as data_size,
concat(truncate(sum(max_data_length)/1024/1024,2),‘MB‘) as max_data_size,
concat(truncate(sum(data_free)/1024/1024,2),‘MB‘) as data_free,
concat(truncate(sum(index_length)/1024/1024,2),‘MB‘) as index_size
from information_schema.tables
where TABLE_NAME = ‘tablename‘;
相关文章
- 07-13python网络编程 day40 数据库——连表查询和子查询
- 07-13hbase数据导出和恢复 设置双master + 查看hbase表占用磁盘大小
- 07-13Java学习日志Day31_ResultSet_jdbc查询员工表_Statement执行DDL,DML语句的弊端_PreparedStatement_数据库连接池(初窥)
- 07-13数据库系统实训——实验二——单表查询
- 07-13查询某个数据库下所有用户数据表名及各数据表字段信息
- 07-13【2020-2021春学期】数据库作业5:单表查询例题练习
- 07-13Python学习day44-数据库(单表及多表查询)
- 07-13ORA-01219:数据库未打开:仅允许在固定表/视图中查询-可用
- 07-13Sql-Server数据库单表查询 4.3实验课
- 07-13SQL查询表占用空间大小