一.查询所有数据库占用空间大小 SELECT TABLE_SCHEMA, CONCAT( TRUNCATE(SUM(data_length) / 1024 / 1024, 2), ' MB' ) AS data_size, CONCAT( TRUNCATE(SUM(index_length) / 1024 / 1024, 2), 'MB' ) AS index_size FROM information_schema.tables GROUP BY TABLE_SCHEMA ORDER BY d
select pg_size_pretty(pg_database_size('lrisk')); --查询数据库剩余空间 select pg_database.datname,pg_size_pretty(pg_database_size('lrisk')) AS sizefrom pg_database; select * from pg_database; SELECT relname, relpages FROM pg_class ORDER BY relpages DESC; --查询
--表名,表占用空间大小(MB),行数select table_name, round(num_rows * avg_row_len /1024/1024, 8) as total_len, num_rows from user_tables where table_name = '表名' order by table_name; --表名,列名,列占用空间大小(MB),非空行数 select c.table_name, c.column_name, round((t.num_rows - c.
原文网址:http://blog.csdn.net/wangjunjun2008/article/details/19840671 du(disk usage),顾名思义,查看目录/文件占用空间大小 #查看当前目录下的所有目录以及子目录的大小$ du -h $ du -ah #-h:用K.M.G的人性化形式显示 #-a:显示目录和文件 du -h tmp du -ah tmp#只查看当前目录下的tmp目录(包含子目录)的大小 #查看当前目录及其指定深度目录的大小du -h –-max-dep
原文:使用一个T-SQL语句批量查询数据表占用空间及其行数 要找到数据库中数据表占用的空间和存在的行数.可以使用sp_spaceused搭配数据表的名称.就可以产生该表耗用的空间和现有行数. 如: USE ADVENTUREWORKS GO EXEC sp_spaceused [Sales.SalesOrderHeader] GO 但如果数据库中包含数千的数据表,如何能利用一句SQL语句来实现? 解决方法: 一.动态SQL: 先用T-SQL动态产生表达式,然后放到一个查询中执行.如: USE A
一: 执行sql语句,返回受影响的行数 在mysql里面,如果没有影响,那么返回行数为 -1 ,sqlserver 里面 还没有测试过 using (var ctx = new MyDbContext()) { ctx.Database.ExecuteSqlCommand("UPDATE Person SET Name = 'Michael' WHERE PersonID = 1"); } 二 : Database.SqlQuery<T> EF5执行sql查询语句
转载自:<du命令>-linux命令五分钟系列之三 du(disk usage),顾名思义,查看目录/文件占用空间大小 #查看当前目录下的所有目录以及子目录的大小$ du -h $ du -ah # -h 用K,M,G,的人性化形式显示 # -a 显示目录和文件 du -h tmp du -ah tmp#只查看当前目录下的tmp目录(包含子目录)的大小 #查看当前目录及其指定深度目录的大小du -h –-max-depth=0#-–max-depth=n:只深入到第n层目录,此处设置为0,即表
C语言中,可以使用sizeof()计算变量或类型占用的内存大小.在Go语言中,也提供了类似的功能, 不过只能查看变量占用空间大小.具体使用举例如下. package main import ( "fmt" "unsafe" ) type Man struct { Name string Age int } func main() { m := Man{Name:"John", Age:20} fmt.Println("man size:
//先进去MySQL自带管理库:information_schema //自己的数据库:rokid_cas_music_test //自己的表:data_song_thirdparty mysql> use information_schema; Database changed mysql> select data_length,index_length from information_schema.tables where table_schema='rokid_cas_music_te