Wednesday, October 30, 2019

how would like to calculate table size and particular clob column size inside that table.

The size of the table and the size of the LOB are two totally different things.




Barring cases where the LOB is less than 4k and stored inline, the LOB data is stored outside the table in a separate segment.



select dbms_lob.getlength(JSON_DATA)/ 1024 / 1024  MB  from ABC

MB

---------

730.1875



If you want to get the combined size of the table and of its LOB segments, you could do something like



SELECT SUM(bytes)/1024/1024 MB

  FROM dba_segments

 WHERE (owner = 'HONNIKERY' and

       segment_name = 'HONNIKERY_CLON')

    OR (owner, segment_name) IN (

        SELECT owner, segment_name

          FROM dba_lobs

         WHERE owner = 'HONNIKERY'

           AND table_name = 'HONNIKERY_CLON' )


MB

---------

730.1875