0

We have several datafiles with a big amount of a free space. How to shrink those files on production system. I tried to move all objects from this files into another tablespace, but RDBMS is still putting something there near MAX block number that makes "ALTER DATABASE DATAFILE RESIZE" impossible. is there any option to block file to get create segments to make it possible to have resize as an empty file?

1
  • All you can do is identify and relocate the remaining object(s). Be sure to look at tables, indexes, and LOBs (which have separate storage parameters from their tables).
    – pmdba
    Commented Mar 18, 2021 at 14:08

1 Answer 1

1

First, I'd check that it is not specified as the default TS for any user:

select default_tablespace,
       username
from dba_users
order by default_tablespace,
         username
;

Then double-check that nothing has crept back in;

select owner,
       segment_name,
       segment_type
from dba_segments
where tablespace_name='nameoftswearelookingat';

-- Edit - add comments about quota

One other thing to check and that is user quota. If a user has available quota on a TS, they can create segments in it even if it is not their default TS.

select *
from dba_ts_quotas
where tablespace_name='nameofyourtablespace';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.