查询sybase DB中占用空间最多的前20张表

按照数据行数查询

Select top 20   name,    row_count(db_id(), id) from   sysobjects order by   row_count(db_id(),id) desc

按照分配的空间查询

Select top 20    name,   reserved_pages(db_id(),id)/(1024.0 / (@@maxpagesize/1024.0) ) as "Allocated MB" from    sysobjects order by   reserved_pages(db_id(),id) desc

按照已使用空间查询

Select top 20    name,    used_pages(db_id(),id)/(1024.0 / (@@maxpagesize/1024.0) ) as "Used MB" from    sysobjects order by    used_pages(db_id(),id) desc

查询sybase DB中占用空间最多的前20张表

时间: 2024-07-30 04:27:00

查询sybase DB中占用空间最多的前20张表的相关文章

查询Oracle 数据库中带有lob字段的某一个表的大小

注意:由于lob字段有独立的lob segment来存储,故对于带有lob字段的表,不能仅仅查询dba_segments. 以下脚本来自: How to Compute the Size of a Table containing Outline CLOBs and BLOBs[Article ID 118531.1] 经过修改:改为了NVL(SUM(S.BYTES),0) SQL> col "TOTAL TABLE SIZE" format 99999999999999 ---

SqlServer将表中数据复制到另一张表

insert into phone2(ph,attr,type,carrier) select top 1000 ph,attr,type,carrier from phone 将表phone的字段和前1000条数据复制到Phone2表 数据库中的某个表删除重复数据(phone2表不能存在) select distinct  * into phone2 from phone 表phone的数据放到phone2中(phone2表可以存在) insert into phone2(ph,attr,ty

从MySQL全库备份中恢复某个库和某张表【转】

从MySQL全库备份中恢复某个库和某张表 一.全库备份-A [[email protected] backup]#mysqldump -uroot -p123456 --default-character-set=utf8 --single-transaction --extended-insert=false --hex-blob --master-data=2 --log-error=/tmp/test.err --routines --triggers --events --quick -

转换一个字段中含有多个另外一张表的id | | 行转列

1.Oracle Function --入参:表 id /* cxcyxm02 :操作表,含有一个存储另一张表(xs0101)多个主键id的字段 ids :操作表的主键 id */ CREATE OR REPLACE FUNCTION cxcyxmcyry(ids VARCHAR2) RETURN VARCHAR2 IS tempcyryxx VARCHAR2(1000); cyryxx VARCHAR2(1000); cxcylength number; i number;BEGIN i :=

多表联合查询后去重复数据后重新插入第一张表解决办法

select goods_id,goods_type,goods_name,in_buy_price,ROUND(sum(in_total_price)/sum(in_amount),2),count(*) from in_warehouse_detail group by goods_id,goods_type,goods_name order by goods_id,goods_type,goods_name 查询结果如下: 另一张关联表[通过goods表的goods_Id和in_wareh

Hibernate继承(2)子类属性生成在自己的一张表中,父类的属性一张表

<?xml version="1.0"?> <!DOCTYPE hibernate-mapping SYSTEM "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd" > <!-- 具体表继承 子类扩展的数据保存在子类表中,继承的数据保存的父类表中 配置实现(如果才ER图上看就是一个一对一关系) 因为子类的数据保存在自己的表中,所以不需要类似 单表继承 辨别列 而是通过一个 主

Oracle一个表中的数据插入另一张表

INSERT INTO TABLE1 SELECT * FROM TABLE2; TABLE1表中字段比TABLE2多 INSERT INTO TABLE1 SELECT 'extra1','extra2',b,c,d FROM TABLE2;

oracle中查找某用户执行某张表的操作操作记录

1,首先查找表的操作记录 select * from v$sqlarea a where a.SQL_TEXT like '%TB_ACCT_SYSDATE%'; 2,从上面的记录中找到update语句对应的sql_id select * from v$sqltext a,v$sqlarea b where a.SQL_ID=b.SQL_ID and b.SQL_ID in('cq53826tk4u3c','afftnrfhu5utk') order by b.LAST_ACTIVE_TIME

三张表关联 修改第三张表所关联前两张表的某个字段的值

---三张表关联 利用关联的字段 表一关联表二 表二关联表三 来修改表三对应字段下的某个值. update GY_FYJY set zfbl='50' where fyxh in (select fyxh from gy_ylsf where fygb ='26')