- 2023-11-27MYSQL 查询数据库各表的数据量大小
--your_database_name替换为你的数据库名SELECTtable_schemaAS`数据库`,table_nameAS`表名`,CONCAT(ROUND(table_rows/1000000,2),'M')AS`行数`,CONCAT(ROUND(data_length/(1024*1024),2),'MB')AS`数据大小`,CONCAT(ROUND(index_length/(1024*1024
- 2023-10-09Sql Server 2008查询数据库中各表记录行数
RT SELECTa.name,b.rows,LTRIM(STR(b.used*8/(casewhenb.used<1000then1else1024end),15,0)+(casewhenb.used<1000then'KB'else'MB'end))as[使用空间],LTRIM(STR(b.reserved*8/(casewhenb.reserved<1000th
- 2023-09-20oracle数据库中查看表空间下各表占用表空间的大小
背景:在做数据库巡检时,检查大表是必不可少的操作,可以查看各表占用表空间的大小,下面直接上例子,然后表空间名字我写成实际的了selectt.owner,t.segment_name,t.tablespace_name,bytes/1024/1024/1024assizes,q.num_rows,t.segment_typefromdba_segmentstleftjoindba_tablesq
- 2023-07-25SQL 语句获取数据库各表分配空间、占用空间、记录行数
SELECT t.NAME AS TableName, s.Name AS SchemaName, p.rows AS RowCounts, SUM(a.total_pages)*8 AS TotalSpaceKB, CAST(ROUND(((SUM(a.total_pages)*8)/1024.00),2) AS NUMERIC(36,2)) AS TotalSpaceMB, SUM(a.