Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Row count and table size

Apex_begginerMay 11 2017 — edited May 11 2017

Hello ,

on 12c database,

for the size of the table in gigabytes I am using :

SELECT round(SUM (bytes) / 1024 / 1024 / 1024 ) size_in_GB , segment_name, owner

    FROM dba_segments

   WHERE     segment_type = 'TABLE'

         AND owner NOT IN ('SYS',

                           'SYSTEM',

                           'OUTLN',

                           'XDB',

                           'WMSYS',

                           'OJVMSYS')

GROUP BY segment_name, owner

ORDER BY 1 desc

and now I am trying to figure out how to implement in the query above ¸query that would give me also the row count for the each table from the list  :

I am usually counting rows from the table witth

select cont(*) from table_name ;

But I don't know how to have that simple row count query result in the same output with the table segment size  , so for each table segment size,

that I can have the column with the row count.

Iw ould appreciate any comment or advice how to do that  .

;

This post has been answered by Mustafa KALAYCI on May 11 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 8 2017
Added on May 11 2017
3 comments
38,733 views