use information_schema; SELECT DISTINCT t.table_name, t.engine '表引擎', t.table_rowsFROM TABLES tWHERE 1 = 1AND t.table_schema = 'mysql_database_name'-- 自己数据库的名字 AND t. ENGINE IS NOT NULLORDER BY t.table_name,t.table_rows ; SELECTt.TABLE_SCHEMA '数据库',t…
use information_schema; select table_name,table_rows from tables where TABLE_SCHEMA = 'testdb'  order by table_rows desc;…
1.Oracle查询数据库中所有表的记录数,但是有可能不准建议用第二种方式进行查询 select t.table_name,t.num_rows from user_tables t 2.创建oracle函数,通过函数中查询词表记录数显示当前记录数 create or replace function count_rows(table_name in varchar2, owner in varchar2 default null) return number authid current_us…
select TABLE_NAME, concat(truncate(data_length/1024/1024,2),'MB') as data_size, concat(truncate(index_length/1024/1024,2),'MB') as index_size from information_schema.tables where TABLE_SCHEMA = '数据库名称' group by TABLE_NAME order by data_length desc;…
select t.table_name,t.num_rows from user_tables t…
查询数据库中所有表名select table_name from information_schema.tables where table_schema='数据库名' and table_type='base table';查询指定数据库中指定表的所有字段名column_nameselect column_name from information_schema.columns where table_schema='数据库名' and table_name='表名'; #查看分布式系统中不同…
查询数据库中所有表名select table_name from information_schema.tables where table_schema='csdb' and table_type='base table'; 查询指定数据库中指定表的所有字段名column_nameselect column_name from information_schema.columns where table_schema='csdb' and table_name='users'…
查看数据库表基本信息. select * from information_schema.TABLES where information_schema.TABLES.TABLE_SCHEMA = '数据库名' and information_schema.TABLES.TABLE_NAME = '表名'; 查看mysql数据库大小 SELECT sum(DATA_LENGTH)+sum(INDEX_LENGTH) FROM information_schema.TABLES where TAB…
查看所有表对应的数据量 SELECT a.name AS 表名, MAX(b.rows) AS 记录条数 FROM sys.sysobjects AS a INNER JOIN sys.sysindexes AS b ON a.id = b.id WHERE (a.xtype = 'u') GROUP BY a.name ORDER BY 记录条数 DESC 查看数据库的总数据量 SELECT SUM(记录条数) AS 总记录数 ) a.name AS 表名, MAX(b.rows) AS 记录…
要想知道每个数据库的大小的话,步骤如下: 1.进入information_schema 数据库(存放了数据库的信息) use information_schema; 2.查询所有数据库的大小: select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables; 3.查看指定数据库的大小: 比如查看数据库home的大小 select concat(round(sum(data_length/1024/1024),…