标签:
1 select a.file#,a.name,a.bytes/1024/1024 CurrentMB, 2 ceil(HWM * a.block_size)/1024/1024 ResizeTo, 3 (a.bytes - HWM * a.block_size)/1024/1024 ReleaseMB, 4 ‘alter database datafile ‘‘‘||a.name||‘‘‘ resize ‘|| 5 ceil(HWM * a.block_size/1024/1024) || ‘M;‘ ResizeCMD 6 from v$datafile a, 7 (select file_id,max(block_id+blocks-1) HWM 8 from dba_extents e 9 where exists(select 1 From dba_data_files 10 where tablespace_name=‘LMPS_USERS_201307‘ and file_id=e.file_id) 11 group by file_id) b 12 where a.file# = b.file_id(+) 13 and (a.bytes - HWM *block_size)>0 14 order by 5
标签:
原文地址:http://www.cnblogs.com/wangxingc/p/5182346.html