Database Administration (MOSC)

MOSC Banner

dba_segments blocks count not tally with dbms_space block count

edited Apr 17, 2020 5:03AM in Database Administration (MOSC) 14 commentsAnswered

why query1 return blocks = 1468 while query2 only return blocks =58 ? for my view, blocks from both query should be same or roughly same

Query 1

SQL> select owner,

2 segment_name,

3 segment_type,

4 round(bytes / 1024 / 1024, 2) MB,

5 s.blocks,

6 s.extents

7 From dba_segments s

8 where segment_name = 'AAA';

OWNER      SEGMENT_NAME      SEGMENT_TYPE           MB       BLOCKS      EXTENTS

---------      -------------------------- ------------------      ----------      ----------     ----------

OWN           AAA                          TABLE                     49           1568                7

Query2

sys.dbms_space.space_usage(segment_owner => 'OWN',

segment_name => 'AAA',

segment_type => 'TABLE',

unformatted_blocks => v_unformatted_blocks,

unformatted_bytes => v_unformatted_bytes,

fs1_blocks => v_fs1_blocks,

fs1_bytes => v_fs1_bytes,

fs2_blocks => v_fs2_blocks,

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center