26 July 2018        Add to Favorites   Report

Database size, used space and free space in a Teradata database

Purpose : find space used by Teradata database:

Solution:

SELECT 
DATABASENAME,
CAST(SUM(MAXPERM)/(1024*1024*1024) AS DECIMAL(7,2)) MAX_PERM,
CAST(SUM(CURRENTPERM)/(1024*1024*1024) AS DECIMAL(7,2)) CURRENT_PERM,
CAST(SUM(MAXSPOOL)/(1024*1024*1024) AS DECIMAL(7,2)) MAX_SPOOL,
CAST(SUM(CURRENTSPOOL)/(1024*1024*1024) AS DECIMAL(7,2)) CURRENT_SPOOL
FROM
DBC.DISKSPACE
WHERE DATABASENAME = 'YOURDATABASE'
GROUP BY
DATABASENAME ORDER BY MAX_PERM DESC;

Read great educational content like this and a lot more ! Create my free account now 🎁

Copied