–收缩数据文件
alter database datafile '数据文件路径' resize 'smallest';alter database datafile '/oradata/dmp/dmp/s1dmp05/dmp5_data33.dbf' resize 7200M;
–查询数据文件可收缩的情况
–tablespace_name:表空间名称
–file_name:数据文件名称
–blk.size:block_size
–smallest:数据文件可缩小到的最小大小
–currentsize:数据文件当前大小
–savings:数据文件可收缩的空间(其实就是currentsize-smallest的值)
SELECT a.tablespace_name,file_name,c.VALUE / 1024 "Blk. size(Kb)",CEIL ((NVL (hwm, 1) * c.VALUE) / 1024 / 1024) "smallest(Mb) - HWM",CEIL (blocks * c.VALUE / 1024 / 1024) "currsize(Mb)",CEIL (blocks * c.VALUE / 1024 / 1024) - CEIL ((NVL (hwm, 1) * c.VALUE) / 1024 / 1024) "savings(Mb)"FROM dba_data_files a,(SELECT file_id, MAX (block_id + blocks - 1) hwmFROM dba_extentsGROUP BY file_id) b,(SELECT VALUEFROM v$parameterWHERE NAME = 'db_block_size') cWHERE a.file_id = b.file_id(+)and a.status !='INVALID'order by 6;