Query to find Database Space Utilization in Teradata

Space allocation is the most primary and important part in any Database.

Teradata gives us the unique set of System Tables, with the help of which, we can do some useful space allocation calculation. Sometimes when there is no more space left in the System then we need to check in the existing databases and retrieve the unused space from them to fulfill our space requirement.

Below mentioned query help us to identify all the Database and the amount of space used by it –


SELECT

DatabaseName (TITLE ‘DatabaseName’)
,SUM(MaxPerm)/(1024*1024*1024) (DECIMAL(15,6)) (TITLE ‘Max Perm (GB)’)
,SUM(CurrentPerm)/(1024*1024*1024) (DECIMAL(15,6)) (TITLE ‘Current Perm (GB)’)
,((SUM(CurrentPerm))/ NULLIFZERO (SUM(MaxPerm)) * 100) (DECIMAL(15,6)) (TITLE ‘Percent Used’)
FROM DBC.DiskSpace
WHERE MAXPERM >0
GROUP BY 1
ORDER BY 4 DESC
;

This Query will return 4 columns DatabaseName, Max Perm (GB), Current Perm (GB) and Percent Used. From them you can analyze  the amount space occupied by each Database in the given teradata system.


9 comments

Skip to comment form

  1. Pokijogos is where it’s at. I recently found their site. So much easier to use than some others I’ve seen. Definitely my new go-to. pokijogos

  2. Downloaded the apk from vk777gameapk. Installation went fine. Gameplay’s actually pretty fun! Good job! Visit vk777gameapk vk777gameapk

  3. Been using alfabetapostas for a while now, and honestly? It’s pretty solid. Good odds! Try your luck at alfabetapostas and let me know how it goes.

  4. Thanks for the great post. Very informative and helpful.

    • Anand on September 13, 2012 at 5:08 am
    • Reply

    Can you please explain the reason for entering 1024*1024*1024 for sum(maxperm)

      • admin on September 13, 2012 at 10:47 am
        Author
      • Reply

      so that it gives the size in GB, deafault value is in bytes which is hard to understand thats why it is divided by 1024 three times.

    • agfdg on July 21, 2012 at 1:40 am
    • Reply

    WHats the point if you won’t allow screen copy?

    1. To protect the originality of content … 🙂

        • shrikant soni on February 20, 2013 at 3:56 pm
        • Reply

        you can disable javascript in browser and then after reloding the page you can copy the page content

Leave a Reply to vk777gameapk Cancel reply

Your email address will not be published.

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