Query To get size of all the tables/indexes that are present in specific user
SELECT
segment_name,
segment_type,
SUM (BYTES)/ (1024 * 1024 * 1024) sizegb
FROM user_segments
GROUP BY segment_name, segment_type
ORDER BY sizegb DESC, segment_type, segment_name;
scriptoutput
SEGMENT_NAME SEGMENT_TYPE SIZEGB
--------------------------------------------------------------------------------------------------------
BL1_CHARGE_CYCLE TABLE 0.360015869140625
BL1_CHARGE TABLE PARTITION 0.34429931640625
BL1_TAX_ITEM TABLE PARTITION 0.150054931640625
Query To get available Tablespace sizes
SELECT b.tablespace_name, ROUND (tbs_size, 2) size_gb, a.free_space free_gb
FROM (SELECT tablespace_name,
ROUND (SUM (BYTES) / 1024 / 1024 / 1024, 2) AS free_space
FROM dba_free_space
GROUP BY tablespace_name) a,
(SELECT tablespace_name, SUM (BYTES) / 1024 / 1024
/ 1024 AS tbs_size
FROM dba_data_files
GROUP BY tablespace_name
UNION
SELECT tablespace_name, SUM (BYTES) / 1024 / 1024 / 1024 tbs_size
FROM dba_temp_files
GROUP BY tablespace_name) b
WHERE a.tablespace_name(+) = b.tablespace_name;
scriptoutput
TABLESPACE_NAME SIZE_GB FREE_GB
----------------------------------------------------------------------------
POOL_DATA 108.89 30.04
POOL_IX 29.3 16.19
SYSTEM 1.46 0.9
UNDOTBS 17.58 17.54
TEMP 14.65
No comments:
Post a Comment