Skip to Main Content
  • Questions
  • difference with blocks from DBA_SEGMENTS and Blocks From TSQ$

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Gilles.

Asked: October 08, 2018 - 3:55 pm UTC

Last updated: October 10, 2018 - 6:03 am UTC

Version: 12.1.0.2.0

Viewed 1000+ times

You Asked

I have a schema and I look for the size by using the following

 select segment_type,sum(blocks) from dba_segments where owner='W_GBA_000' group by segment_type; 


SEGMENT_TYPE SUM(BLOCKS)
------------------ -----------
LOBINDEX 368
LOBSEGMENT 736
INDEX 648
TABLE 384

so the total number of block is 2136

if I run the following
 select * from tsq$ T ,sys.user$ u where t.user#=u.user# and u.name='W_GBA_000' ; 


SQL> select t.ts#,t.user#,t.blocks from tsq$ T ,sys.user$ u where t.user#=u.user# and u.name='W_GBA_000' ;

TS# USER# BLOCKS
---------- ---------- ----------
5 122 0
4 122 1496


TS# 5 is the Index Tablespace and TS# 4 is the User Tablespace.


I was expecting the same number of blocks , why nothing for index. May be I m comparing Apple & Bananas !!.

what is the blocks info providing in the TSQ$ ? could I use it to identify the Quota size of a schema ?

Regards
Gilles

and Connor said...

I'm sort of at a loss as to why you'd look at sys.tsq$

That's like looking at a hex edit of a word document and wondering why it doesn't look like text.

In this particular instance, the BLOCKS column in TSQ$ does not map to the blocks in the standard dictionary view DBA_TS_QUOTAS, which is what you should be using anyway.

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database