on 09-05-2008 3:45 PM
Hi All,
I am preparing one ABAP program for my MIS report. for that program i required database size from DB02
I am looking the database size from any of the table, but i could not get it.
can any one help me to find the database size from any table with data?
or
How to get the database size from any table with data?
Thanks in advance,
Regards,
Sundar.c
1. Gather statistic on the interested tables or database entire (dbms_stats package, in example)
2. select table_name ,num_rows,avg_row_len,
round(num_rows*avg_row_len/1024/1024,3) tsize,blocks,round(blocks/256,3) upper_size
from dba_tables
tsize - usefull size (data only)
upper_size - table size in blocks (in this case - 4 Kb)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
the solution from Alexey will give you the size based on the statistics, so it is as good as the statistcs.
Some times it is not possible or convenient to gather the stats to get this information.
Also, keep in mind that the default block size in SAP is 8K
If you want to know the exact table size right now, then you have to check user_segments, from an ABAP program you should use:
SELECT SUM(bytes)/1024/1024 MB
FROM user_segments
WHERE segment_type = 'TABLE'
AND segment_name = <table name>
Of course, I'm not considering tables with Blog segments
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.