SELECT T.OWNER, T.SEGMENT_NAME, SUM(T.BYTES) / 1024 / 1024 M FROM DBA_SEGMENTS T WHERE T.OWNER = 'user_name' AND T.SEGMENT_NAME = 'table_name' GROUP BY T.OWNER, T.SEGMENT_NAME; 或者 select sum(bytes/1024/1024) M from user_segments where segment_name
http://www.2cto.com/database/201107/95313.html 一种是分配给一个表的物理空间数量,而不管空间是否被使用.可以这样查询获得字节数:select segment_name, bytes from user_segments where segment_type = 'TABLE'; 或 Select Segment_Name,Sum(bytes)/1024/1024 from User_Extents Group By Segment_Name; 另一种
家里笔记本40G,可用空间怎么挤都只剩7G,从单位copy回来的linux虚拟机要10G,经检查实际使用空间5.7,也就是其他都是空余空间,可以释放掉.(只适合independent.Persistent,不适合preallocated ,ext4文件系统无效) 释放方法有如下几种 for linux 1.进入系统后,在GUI界面下启动 vmware-toolbox,选择shrink后根据图形提示选择partation压缩 2.在shell里 vmware-toolbox-cmd dis
家里笔记本40G,可用空间怎么挤都只剩7G,从单位copy回来的linux虚拟机要10G,经检查实际使用空间5.7,也就是其他都是空余空间,可以释放掉.(只适合independent.Persistent,不适合preallocated ,ext4文件系统无效) 释放方法有如下几种 for linux 1.进入系统后,在GUI界面下启动 vmware-toolbox,选择shrink后根据图形提示选择partation压缩 2.在shell里 vmware-toolbox-cmd dis
select TABLE_NAME , num_rows * avg_row_len /1024/1024 AS KJfrom ALL_tables WHERE TABLE_NAME IN (select TABLE_NAME from all_tables where owner='PRODDTA')ORDER BY KJ DESC
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;
一则清理MySQL大表以释放磁盘空间的案例 一.基本情况: 1.dbtest库554G,先清理st_online_time_away_ds(37G)表的数据,保留半年的数据: 1)删除的数据:select count(1),tdate from dbtest.st_online_time_away_ds where tdate < '2017-08-01';(记录数为:462171894) 2)保留的数据:select count(1),tdate from dbtest.st_online_t
oracle所在磁盘空间不足导致了数据库异常.需要减小数据文件的大小来解决. 1.检查数据文件的名称和编号 select file#,name from v$datafile; 2.看哪个数据文件所占的空间最大,根据该数据文件的编号查看该数据文件的最大数据块数 select max(block_id) from dba_extents where file_id=8; 查询结果 3.计算该表空间的实际占用空间.(不是物理文件的大小) 查看每个数据块的大小 show parameter db_bl