Skip to Main Content

Chinese

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

undo表空间收缩问题!

914263Oct 24 2012 — edited Oct 27 2012
RT,数据库平台为11.2.0.1 OS平台为centos5.8 64位

目前undo表空间大小超过10G,从em中查看undo表空间的实际使用量为300M左右,所以想对undo表空间数据文件进行收缩!

SQL> select sum(bytes)/(1024*1024) from dba_undo_extents where status !='EXPIRED';

SUM(BYTES)/(1024*1024)
----------------------
195.1875


SQL> show parameter undo

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management string AUTO
undo_retention integer 900
undo_tablespace string UNDOTBS1


SQL> SELECT FILE_NAME FROM DBA_DATA_FILES WHERE TABLESPACE_NAME='UNDOTBS1';

FILE_NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/orcl/undotbs01.dbf

SQL> !du -sh /u01/app/oracle/oradata/fjhb/undotbs01.dbf
11G /u01/app/oracle/oradata/orcl/undotbs01.dbf

SQL> alter database datafile '/u01/app/oracle/oradata/orcl/undotbs01.dbf' resize 5G;
alter database datafile '/u01/app/oracle/oradata/orcl/undotbs01.dbf' resize 5G
*
ERROR at line 1:
ORA-03297: file contains used data beyond requested RESIZE value

猜想大概是因为目前使用的undo段位于数据文件5G之后的数据块中,才导致无法收缩的情况,请问这种情况下要如何对undo表空间数据文件进行收缩呢?
临时表空间也存在这种问题,一般的解决方法都是新建一个临时表空间或者undo表空间,然后切换,是否有其他的手段实现呢?求解,TKS

Edited by: user13616200 on 2012-10-24 下午8:04

Edited by: user13616200 on 2012-10-24 下午8:05
This post has been answered by LiuMaclean(刘相兵) on Oct 27 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 24 2012
Added on Oct 24 2012
6 comments
2,176 views