All Forums Database
vc 4 posts Joined 05/16
29 Aug 2016
Output is different in DBC.diskspace and for Dbc.diskspacev

Hello,
When I am firing the below 2 query,I am getting the same output as  abc_stg,test_mdl,123_srci for databasename columns
But when I replace Dbc.diskspacev with dbc.diskspace the output is blank.
I am trying to fetch the same output using dbc.diskspace
 
Also can anyone pleqse explain why we have   three different type of view for most dbc objects like(dbc.diskspace,dbc.diskspacev,dbc.diskspacevx)is  there any difference ?which one should be considered?
 

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.DiskSpacev

WHERE MAXPERM >0 and databasename like  any('%@_stg','%@_srci','%@_mdl','%@_prstn') ESCAPE '@'

GROUP BY 1

ORDER BY 1

 

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')

,cast (CURRENT_date as timestamp(0)) + ((current_time -time '00:00:00') hour to second(0)) As AS_ON

FROM DBC.DiskSpacev

WHERE MAXPERM >0 and DATABASEname  like any('%_stg','%_srci','%_mdl','%_prstn') 

GROUP BY 1

ORDER BY 1

 

Thank you in advance

 

Regards,

vc

 

 

 

 

 

 

 

 

 

 

Fred 1096 posts Joined 08/04
29 Aug 2016

Where there are both, the views with "V" are the ones everyone should be using - since TD12. The ones without V are only for backward compatibility.
 
Currently, object names are Unicode VARCHAR. Previously they were Latin CHAR(30) so LIKE with the compatibility view requires trailing spaces or % to match.

You must sign in to leave a comment.