Jirka's Public Notepad

Data Engineering | Python | SQL Server | Teradata

September 17, 2017 By Jiří Hubáček Leave a Comment

Listing all tables in a database and their PERM space consumption

Listing table sizes in Teradata is done by querying the all AllSpace view in the DBC database:

SELECT
	DatabaseName, 
	TableName,
	SUM(CurrentPerm) / 1024**3 AS CurrentPermGB,
	SUM(PeakPerm) / 1024**3 AS PeakPermGB
FROM DBC.AllSpace
WHERE
	TableName <> 'All'
	AND DatabaseName = 'yourDbNameGoesHere'
GROUP BY
	DatabaseName, 
	TableName
ORDER BY
	DatabaseName, 
	TableName
;

‘All’ represents an aggregated row for the whole database. Therefore it’s being excluded.



Related

Filed Under: Teradata Tagged With: don't remember, Teradata, tooLongToRemember

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • GitHub
  • LinkedIn
  • RSS
  • Twitter
© 2022 · Jiří Hubáček, PGP