Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Space in the database - response (12) by rajeev saravanan

$
0
0

Hi All,
Continuing on the above i have come up with couple of queries to evaluate the space utlisation at Database and table level
Could any one evaluate and let me know of any mistakes?
 
 Database level

sel
databasename,
sum (currentperm)/(1024*1024) Space_Utilised_MB,
(max(currentperm)* (hashamp()+1))/(1024*1024) as Space_Utilised_Incld_Skew_MB,
sum(maxperm)/(1024*1024) Space_Alloted_MB,
avg(currentperm)/(1024*1024) Avg_Space_Per_Amp_MB,
max(currentperm)/(1024*1024) Max_Space_Amp_MB,
(Space_Alloted_MB -  Space_Utilised_MB) Absolut_Space_Left_MB,
(Space_Alloted_MB - Space_Utilised_Incld_Skew_MB ) Space_Left_Consider_Skew_MB,
((1 - (AVG(CURRENTPERM)/MAX(CURRENTPERM)))*100) AS SKEWFACTOR
from
dbc.diskspace
where
databasename = 'XYZ'
group by 1;
 
Table level

sel
databasename,
tablename,
sum (currentperm)/(1024) Space_Utilised_KB,
avg(currentperm)/(1024) Avg_Space_Per_Amp_KB,
max(currentperm)/(1024) Max_Space_Amp_KB,
((1 - (AVG(CURRENTPERM)/MAX(CURRENTPERM)))*100) AS SKEWFACTOR
from
dbc.tablesize
where
databasename = 'XYZ'
group by 1,2;
 
Regards
R.Rajeev


Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>