查看分区数据量,查看全库数据量 USE information_schema; SELECT PARTITION_NAME,TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 'sale_data'; SELECT table_name,table_rows FROM TABLES WHERE TABLE_SCHEMA = 'db_name' ORDER BY table_rows DESC ; http://my
在使用桦仔的分享一个SQLSERVER脚本(计算数据库中各个表的数据量和每行记录所占用空间)的脚本时,遇到下面一些错误 这个是因为这些表的Schema是Maint,而不是默认的dbo,造成下面这段SQL在执行EXEC sp_spaceused @tablename时出现 Msg 15009, Level 16, State 1, Procedure sp_spaceused, Line 75 The object 'xxxx' does not exist in database 'YourSQ
Hive 表分区 Hive表的分区就是一个目录,分区字段不和表的字段重复 创建分区表: create table tb_partition(id string, name string) PARTITIONED BY (month string) row format delimited fields terminated by '\t'; 加载数据到hive分区表中 方法一:通过load方式加载 load data local inpath '/home/hadoop/files/namein
Hive表的分区就是一个目录,分区字段不和表的字段重复 创建分区表: create table tb_partition(id string, name string) PARTITIONED BY (month string) row format delimited fields terminated by '\t'; 加载数据到hive分区表中 方法一:通过load方式加载 '); 方法二:insert select 方式 ') select id, name from name; hiv
本文转载自:http://hi.baidu.com/ajyajyajy/item/4e2a7f4dc83393d2c1a592c1 use DBNAMEgoselect * from sysobjects where xtype='U'; --这是查询所有表的信息select count(*) from sysobjects where xtype='U' --这是查询表的数量 select a.name, b.rows from sysobjects a with(nolock) join
查看所有表对应的数据量 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 记录
##查看所有表信息 SELECT * FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'pcms-zgh20190327' ##查看各个表数据量 SELECT table_name,table_rows FROM information_schema.tables WHERE TABLE_SCHEMA = 'pcms-zgh20190327' ORDER BY table_rows DESC;