Viewpoint
Enthusiast

## Current Perm Max % Viewpoint alert: how is this calculated?

Can someone provide SQL to calculate Current Perm Max %? I guess I don't understand the concept of 'current perm max', it seems it should just be the amount of perm space assigned to a database. The Viewpoint User Guide provides this calculation:

Current Perm Max=((% Current Perm Max * Number of Vprocs)/ Max Perm)

I recently reduced the amount of perm space assigned to a database that I have an alert set up for in Viewpoint. When I run this query:

SyntaxEditor Code Snippet

```SELECT Databasename (format 'X(12)')
,SUM(maxperm),SUM(CurrentPerm),SUM(PeakPerm),((SUM(currentperm))/
NULLIFZERO (SUM(maxperm)) * 100)
(FORMAT 'zz9.99%', TITLE 'Percent // Used')FROM DBC.DiskSpaceV
where databasename in ('XXXXX')GROUP BY 1
ORDER BY 3 DESC
WITH SUM (currentperm), SUM(maxperm);```

I get the following results:

DatabaseName=XXXXX

Sum(MaxPerm)=1,588,058,280

Sum(CurrentPerm)=1,146,953,728

Sum(PeakPerm)=1,148,467,712

Percent used=72.22

I have a Database Space alert set up in Viewpoint that sends an email when the Current Perm Max threshold is > 90%. I have been receiving alerts ever since I reduced the amount of perm space (it was about 9 GB). I don't understand that my database is 72% full but I'm getting an alert saying:

Space Used Percentage=72.223656

Max Space Used Percentage=95.1047

Can someone help me understand?

4 REPLIES
Junior Contributor

## Re: Current Perm Max % Viewpoint alert: how is this calculated?

Your database is skewed, this (% Current Perm Max * Number of Vprocs) calculation in Viewpoint translates to

`max(CurrentPerm) * (HashAMP() +1) -- max used space across all AMPS * number of AMPs in your system`

Enthusiast

## Re: Current Perm Max % Viewpoint alert: how is this calculated?

Thank you very much, Dieter, this is very helpful. I had a feeling skew was the issue. Could you walk me through an example of calculating these values so I know how to size the database properly? Current Perm Max % = ((Current Perm Max * Number of Vprocs)/ Max Perm)

Junior Contributor

## Re: Current Perm Max % Viewpoint alert: how is this calculated?

`max(CurrentPerm) * (HashAMP() +1) / sum(MaxPerm) as "Current Perm Max %"`

:-)

Highlighted
Enthusiast

## Re: Current Perm Max % Viewpoint alert: how is this calculated?

Thanks again, Dieter!!