|
|
Archives of the TeradataForum
Message Posted: Thu, 06 Sep 2001 @ 20:52:27 GMT
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
;
| |