Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

DATABASE SIZE AND USAGE in Teradata

To get maximum database size and current usage for a particular database, ForgetCode suggests the simple select query as below.
Users and administrators can act accordingly by watching the spool usage to improve the performance.

Input: Your database name in place of 'YOURDATABASE' .

  1. SELECT
  2. DATABASENAME,
  3. CAST(SUM(MAXPERM)/(1024*1024*1024) AS DECIMAL(7,2)) MAX_PERM,
  4. CAST(SUM(CURRENTPERM)/(1024*1024*1024) AS DECIMAL(7,2)) CURRENT_PERM,
  5. CAST(SUM(MAXSPOOL)/(1024*1024*1024) AS DECIMAL(7,2)) MAX_SPOOL,
  6. CAST(SUM(CURRENTSPOOL)/(1024*1024*1024) AS DECIMAL(7,2)) CURRENT_SPOOL
  7. FROM
  8. DBC.DISKSPACE
  9. WHERE DATABASENAME = 'YOURDATABASE'
  10. GROUP BY
  11. DATABASENAME ORDER BY MAX_PERM DESC;