Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Query the actual size of DB table

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Query the actual size of the DB table (ensure large clob/blob/nclob lob fields)

Select round (sum (bytes/1024/1024/1024), 2) | |'G' from dba_segments where owner=' user 'and segment_name =' table'OR segment_name IN (select SEGMENT_NAME from dba_LOBS where TABLE_NAME=' table 'and owner=' user')

If you are not a dba user, you can use user_segments & user_lobs and do not need owner.

two。 Query the large LOB field in the table

Select round (sum (b.BYTES/1024/1024), 2) | |'M' from dba_lobs a, dba_segments b where a.segment_name = b.segment_name and a.owner = 'user (uppercase)' and a.table_name = 'table (uppercase)'

3. Query table size without large LOB field

Select round (sum (bytes/1024/1024/1024), 2) | |'G' from user_segments where segment_name = 'table'

4. Table data is deleted

a. If the data of the table is truncate, the data found by the above method will change immediately.

b. If the data of the table is delete, the table needs to be shrunk before the above query will be changed.

Alter table table name enable row movement; alter table table name shrink space

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report