Chinaunix首页 | 论坛 | 博客
  • 博客访问: 37250
  • 博文数量: 7
  • 博客积分: 468
  • 博客等级: 下士
  • 技术积分: 95
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-13 13:44
文章分类

全部博文(7)

文章存档

2010年(2)

2009年(5)

我的朋友

分类: Mysql/postgreSQL

2009-08-21 13:30:12

    近日在运行下面的命令发现无效,经查询发现是mysql早期版本不支持数据字典功能,仅在5.0及更高版本才能使用数据字典查询所占磁盘空间,下面给出各种数据库支持数据字典的版本。
 
Microsoft SQL Server - Supported in Version 7 and up
MySQL - Supported in Version 5 and up
PostgreSQL - Supported in Version 7.4 and up
Oracle - Does not appear to be supported
Apache Derby - NOT Supported As of Version 10.3
 
附转载网址:
 
查整个库的状态:
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';
 
 
 
 
阅读(2002) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:2>&1 的用法说明。

给主人留下些什么吧!~~