方案一:清理Oracle服务端目录下,diag日志目录下,的各种日志 如:E:\app\Administrator\diag
方案二:缩放临时表空间
select file#,name from v$datafile;获得目录结果:E:\APP\ADMINISTRATOR\ORADATA\CLOTADB\CLOTA_DATA.DBF查看各空间的使用率,根据使用率进行针对性缩放,缩放不能小于其实际大小
如:本身500M,缩放大小不是600MSELECT Upper(F.TABLESPACE_NAME) "表空间名", D.TOT_GROOTTE_MB "表空间大小(M)", D.TOT_GROOTTE_MB - F.TOTAL_BYTES "已使用空间(M)", To_char(Round(( D.TOT_GROOTTE_MB - F.TOTAL_BYTES ) / D.TOT_GROOTTE_MB * 100, 2), '990.99') || '%' "使用比", F.TOTAL_BYTES "空闲空间(M)", F.MAX_BYTES "最大块(M)"FROM (SELECT TABLESPACE_NAME, Round(Sum(BYTES) / ( 1024 * 1024 ), 2) TOTAL_BYTES, Round(Max(BYTES) / ( 1024 * 1024 ), 2) MAX_BYTES FROM SYS.DBA_FREE_SPACE GROUP BY TABLESPACE_NAME) F, (SELECT DD.TABLESPACE_NAME, Round(Sum(DD.BYTES) / ( 1024 * 1024 ), 2) TOT_GROOTTE_MB FROM SYS.DBA_DATA_FILES DD GROUP BY DD.TABLESPACE_NAME) DWHERE D.TABLESPACE_NAME = F.TABLESPACE_NAMEORDER BY 1根据具体的目录,来进行实际的缩放,设置要缩放的大小
ALTER DATABASE DATAFILE 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01.DBF' RESIZE 500M方案三:
oracle10g,在pl/sql中选中删除后会出现类似:BIN$nJ5JuP9cQmqPaArFei384g==$0的表。1.查看回收站select * from user_recyclebin;2.清空回收站purge recyclebin;方案四:其它相关
create or replace function count_rows(table_name in varchar2,owner in varchar2 default null)return number authid current_user IS num_rows number;stmt varchar2(2000);begin if owner is null thenstmt := 'select count(*) from "'||table_name||'"';elsestmt := 'select count(*) from "'||owner||'"."'||table_name||'"';end if; execute immediate stmt into num_rows;return num_rows;end;查看数据库各表的数据量大小,释放时不作为优先选项处理 select table_name, count_rows(table_name) nrows from user_tables order by count_rows(table_name) desc