oracle9i数据库
SYSTEM表空间现在是32G
可实际利用才不到1G
按网上SQL查到的高水位在30G的样子
要缩小这个表空间首先得降低高水位,可不知怎么降低高水位,请高手指点
谢谢!
------解决方案--------------------------------------------------------
FILE_NAME BYTES/1024/1024
--------------------------------------------- ---------------
D:\ORACLE\ORADATA\DBA\USERS01.DBF 5
D:\ORACLE\ORADATA\DBA\SYSAUX01.DBF 300
D:\ORACLE\ORADATA\DBA\UNDOTBS01.DBF 30
D:\ORACLE\ORADATA\DBA\SYSTEM01.DBF 500
D:\ORACLE\ORADATA\DBA\STREAMS_TBS.DBF 100
D:\ORACLE\ORADATA\PERFSTAT1.DBF 500
SQL> alter database datafile 'D:\ORACLE\ORADATA\DBA\SYSTEM01.DBF' resize 490m;
数据库已更改。
修改之前做好备份,以免出现问题..
------解决方案--------------------------------------------------------
用resize 缩小数据文件的大小,必须保证缩小后的数据文件足够容纳其中现有的数据,否则会有错误提示。
你用resize
- SQL code
alter database datafile 'D:\ORACLE\ORADATA\DBA\SYSTEM01.DBF' resize 490m;
------解决方案--------------------------------------------------------
- SQL code
SELECTtablespace_name,100*(sum_max-sum_alloc+nvl(sum_free,0))/sum_max AS capa_per,(sum_max-sum_alloc+nvl(sum_free,0))/1024/1024 AS capa_free,(sum_alloc - nvl(sum_free,0))/1024/1024 as capa_used,sum_max/1024/1024 as capa_max,100*nvl(sum_free,0)/sum_alloc As per,nvl(sum_free,0)/1024/1024 as free,(sum_alloc - nvl(sum_free,0))/1024/1024 as used,sum_alloc/1024/1024 as maxFROM ( SELECT tablespace_name, sum(bytes) AS sum_alloc, sum(decode(maxbytes,0,bytes,maxbytes)) AS sum_maxFROM dba_data_filesGROUP BY tablespace_name),( SELECT tablespace_name AS fs_ts_name, sum(bytes) AS sum_freeFROM dba_free_spaceGROUP BY tablespace_name )WHERE tablespace_name = fs_ts_name(+)order by 2,3;
------解决方案--------------------------------------------------------
truncate table sys.aud$;该操作能将水位。
------解决方案--------------------------------------------------------
不过30g的数据采用delete的方式清理,也够佩服的了。
------解决方案--------------------------------------------------------
本身的表空间的shrink就是个头痛的问题,更何况是系统表空间。
如果仅仅是audit导致的,用逻辑备份和恢复吧。