Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 06 Sep 2001 @ 20:52:27 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Raw data size
 
From:   Jim Downey

Ruth, I think the following query is not quite what you needed but it does report by database how much space is used. It does NOT break it out by raw and index space used. You can add in the column Tablename to get space by Table.

/* DATABASE SIZE AND PERCENT USED */
SEL  T1.DATABASENAME
,    T1.CURRENT_SIZE_GB
,    (T2.PERM_SPACE_GB-T1.CURRENT_SIZE_GB)(DECIMAL(12,4))(NAMED AVAIL_SPACE_GB)
,    T2.PERM_SPACE_GB
,    (T1.CURRENT_SIZE_GB/T2.PERM_SPACE_GB*100)(DECIMAL(12,1))(NAMED USED_PC)
,    T2.SPOOL_SPACE_GB
,    T2.TEMP_SPACE_GB
FROM
(
SELECT    DATABASENAME
,    SUM(CURRENTPERM/(1024*1024*1024))(DECIMAL(12,4))(NAMED CURRENT_SIZE_GB)
FROM      DBC.TABLESIZE
GROUP BY 1
) T1
INNER JOIN
(
SEL  DATABASENAME
,    PERMSPACE/(1024*1024*1024)(DECIMAL(12,4))(NAMED PERM_SPACE_GB)
,    SPOOLSPACE/(1024*1024*1024)(DECIMAL(12,4))(NAMED SPOOL_SPACE_GB)
,    TEMPSPACE/(1024*1024*1024)(DECIMAL(12,4))(NAMED TEMP_SPACE_GB)
FROM DBC.DATABASES
) T2
ON T1.DATABASENAME=T2.DATABASENAME
ORDER BY 1
;


     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023