mysql查看表大小 一:命令 show table status like 'table_name'\G; mysql> show table status like 'x'\G; . row *************************** Name: x Engine: InnoDB Version: Row_format: Compact Rows: Avg_row_length: Data_length: Max_data_length: Index_length: Data_f
查看SqlServer 数据库中各个表多少行 : SELECT A.NAME ,B.ROWS FROM sysobjects A JOIN sysindexes B ON A.id = B.id WHERE A.xtype = 'U' AND B.indid IN(0,1) ORDER BY B.ROWS DESC 数据库磁盘占用量: select name, CAST(convert(float,size) * (8192.0/1024.0)/1024 AS nvarchar)+'MB' AS
SELECT table_name, pg_size_pretty(table_size) AS table_size, pg_size_pretty(indexes_size) AS indexes_size, pg_size_pretty(total_size) AS total_size FROM ( SELECT table_name, pg_table_size(table_name) AS table_size, pg_indexes_size(table_name) AS inde
1.返回所有数据库信息(数据库名,创建日期,存储路径等). use master; GO select * from dbo.sysdatabases 2.返回当前数据库所有对象(可根据type字段过滤出用户表,索引等). USE AdventureWorks2008R2; GO SELECT * FROM SYS.objects WHERE TYPE='U' 3.查询指定库中所有表信息(记录数,使用空间等). USE AdventureWorks2008R2; GO exec sp_MSF
SELECT DISTINCT d.name, f.value FROM syscolumns a LEFT JOIN systypes b ON a.xusertype= b.xusertype INNER JOIN sysobjects d ON a.id= d.id AND d.xtype= 'U' AND d.name<> 'dtproperties' LEFT JOIN syscomments e ON a.cdefault= e.id LEFT JOIN sys.extended_
--1.查看表空间的名称及大小 )), ) ts_size FROM dba_tablespaces t, dba_data_files d WHERE t.tablespace_name = d.tablespace_name GROUP BY t.tablespace_name; --2.查看表空间物理文件的名称及大小 SELECT tablespace_name, file_id, file_name, ), ) total_space FROM dba_data_files ORDER
一.查看表名和对应的数据行数select a.name as '表名',b.rows as '表数据行数'from sysobjects a inner join sysindexes bon a.id = b.idwhere a.type = 'u'and b.indid in (0,1)--and a.name not like 't%'order by b.rows desc 二.查看表名和表占用空间信息--判断临时表是否存在,存在则删除重建if exists(select 1 fr
1.查看表所占空间 SELECT TABLESPACE_NAME,TO_CHAR(SUM(BYTES)/(1024*1024),'999G999D999') CNT_MB FROM DBA_EXTENTS WHERE OWNER='&OWNER' AND SEGMENT_NAME='&TABLE_NAME' AND SEGMENT_TYPE LIKE 'TABLE%' GROUP BY TABLESPACE_NAME;