select decode(least(sum(bytes), 1000000000),
1000000000, ROUND(sum(bytes)/1000000000) || 'GB',
ROUND(sum(bytes)/1000000) || 'MB') as database_size
from dba_segments;
The above query has the nice effect of displaying the size of the database in a human readable format.
DATABASE_SIZE
------------------------------------------
151GB
1 rows selected
No comments:
Post a Comment