[DBCleaner] Database Table Size for Other DB

[DBCleaner] Database Table Size for Other DB

  
Forge Component
(22)
Published on 17 Mar by Acácio Porta Nova
22 votes
Published on 17 Mar by Acácio Porta Nova
Hi
It seems currentyly Database Table Size support only SQLServer.
We using following query to check Table Size of Oracle.

SELECT t.table_name, 
SUM(NVL(t.BLOCKS, 0) + NVL(t.EMPTY_BLOCKS, 0) + NVL(i.LEAF_BLOCKS, 0)) * 8 as TotalSpaceKB,
SUM(NVL(t.BLOCKS, 0) + NVL(i.LEAF_BLOCKS, 0)) * 8 as UsedSpaceKB,
SUM(NVL(t.EMPTY_BLOCKS, 0)) * 8 as DataSpaceKB

FROM all_tables t
LEFT JOIN ALL_INDEXES i on t.OWNER = i.TABLE_OWNER AND t.TABLE_NAME = i.TABLE_NAME
WHERE t.table_name like 'OSUSR_%' or t.table_name like 'OSSYS_%' or t.table_name like 'OSLOG_%'
GROUP BY t.owner, t.table_name
ORDER BY UsedSpaceKB DESC


That is true, the database table size is currently only implemented in SQL Server.

Thanks for sharing this. I will test and incorporate it in DBCleaner.