1、mysql 查看数据库中每张表的记录数 : use information_schema; select table_name,table_rows from tables where TABLE_SCHEMA = 'testdb' order by table_rows desc;
2、Mysql查看数据库中所有表的总记录数 select sum(a.table_rows) from (select table_rows from tables where TABLE_SCHEMA = 'ymt')a
3、查询MySQL某个数据库中所有表占用磁盘大小: select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from information_schema.tables where table_schema='apoyl';
4、查询MySQL某个某张表占用磁盘大小: select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from information_schema.tables where table_schema='apoyl' and table_name='';
5、查询Mongo数据库大小: db.stats(); { "db" : "test", //当前数据库
"collections" : 3, //当前数据库多少表 "objects" : 4, //当前数据库所有表多少条数据 "avgObjSize" : 51, //每条数据的平均大小 "dataSize" : 204, //所有数据的总大小 "storageSize" : 16384, //所有数据占的磁盘大小 "numExtents" : 3, "indexes" : 1, //索引数 "indexSize" : 8176, //索引大小 "fileSize" : 201326592, //预分配给数据库的文件大小 "nsSizeMB" : 16, "dataFileVersion" : { "major" : 4, "minor" : 5 }, "ok" : 1 } 6、查询Mongo某个数据表大小: db.posts.stats(); { "ns" : "test.posts", "count" : 1, "size" : 56, "avgObjSize" : 56, "storageSize" : 8192, "numExtents" : 1, "nindexes" : 1, "lastExtentSize" : 8192, "paddingFactor" : 1, "systemFlags" : 1, "userFlags" : 0, "totalIndexSize" : 8176, "indexSizes" : { "id" : 8176 }, "ok" : 1 } Linux 查看搜索词在指定文件中的行号:cat -n data.manager.ui-warn-20160811.log |grep '6212261001010895875' 将指定文件的起始行号和结束行号的内容输出到指定文件:sed -n '3473165,3473265p' data.manager.ui-warn-20160811.log > qe.txt