alter database datafile '/oracle/u01/oradata/wapdb/system01.rbf' resize
800M;
But the following error message was returned:
ORA-03297: file contains used data beyond requested RESIZE value
The same kind of error also occurs when I try to shrink file "rbs01.dbf",
which holds tablespace "rbs".
If you managed to avoid that one, have you ever switched on auditing? If
so, audit records are written to AUD$ -which just happens to be located in
SYSTEM (but can, and should, be moved).
The trouble with any of that ever happening (apart from horrible performance
implications) is that the settings for things like initial, next and pctfree
are positively disgusting on SYSTEM. The thing fragments just by looking at
it. And what that means is that you have bits of good information scattered
throughout the tablespace amongst huge swathes of empty space.
Unfortunately, when you resize a file downwards, the slightest
partially-filled block in the way will halt the shrink.
What you would normally do for non-SYSTEM tablespace is do a re-org.:
Export everything, drop everything, re-import. Guess what you can't do with
SYSTEM tablespace??
You can perhaps try and see which objects are where (DBA_EXTENTS, read
carefully, can tell you that), and perhaps if it's old bits of AUD$ you
could do it, but otherwise, I suspect you are stuck with a large SYSTEM
tablespace.
Regards
HJR
"zhang liang" <nov...@263.net> wrote in message
news:95avqf$1mva$1...@news.cz.js.cn...
When you resize a datafile, Oracle trims only off the END of the file.
So if you have objects which are located at the end of the file then
you must move them before you can shrink the file down beyond that
point. I do NOT recommend trying to move anything in the SYSTEM
tablespace, unless they are user objects (ie, not owned by SYS or
SYSTEM!)
For the Rollback, you can clean this up by dropping the rollback
segments which are at the end of your file, then shrinking your file,
then creating your rollback segments again.
The following query will produce a pretty map of where things are in
your tablespace :
Select owner segment_owner, Segment_name, partition_name, Block_ID,
File_id, Blocks, segment_type
from sys.DBA_Extents
where tablespace_name = 'your_tablespace'
union
Select null, 'Free Space', null, Block_ID, File_id, Blocks, null
from sys.DBA_FREE_SPACE
where tablespace_name ='your_tablespace'
order by 5,4
Sent via Deja.com
http://www.deja.com/
Regards
Asko
zhang liang wrote in message <95avqf$1mva$1...@news.cz.js.cn>...