Skip to content
January 25, 2011 / doganay

MINIMUM SIZE OF A DBF THAT CAN BE SHRINKED TO

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

accept TABLESPACE_NAME prompt TABLESPACE_NAME…:
accept FILE_ID prompt FILE_ID………..:
SELECT SUM (BYTES)/1024/1024/1024 “MIN SIZE(GB)”
FROM dba_free_space
WHERE tablespace_name = ‘&&TABLESPACE_NAME’
AND file_id = &&FILE_ID
AND block_id >=
NVL ((SELECT (block_id + (BYTES / 8192))
FROM dba_extents
WHERE block_id =
(SELECT MAX (block_id)
FROM dba_extents
WHERE file_id = &&FILE_ID AND tablespace_name = ‘&&TABLESPACE_NAME’)
AND file_id = &&FILE_ID
AND tablespace_name = ‘&&TABLESPACE_NAME’),
0
);
undefine TABLESPACE_NAME
undefine FILE_ID

try and pray 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: