-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdbsee_permspace.sql
More file actions
18 lines (17 loc) · 910 Bytes
/
dbsee_permspace.sql
File metadata and controls
18 lines (17 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*********************************************************************/
/* Author : VLDB */
/* Date : 07/02/2017 */
/* Version : 1 */
/* Description : Generate report on available space within */
/* each database */
/*********************************************************************/
select databasename as database_name
,sum(maxperm) as perm_size
,sum(currentperm) as perm_used
,cast(sum(maxperm-currentperm) as bigint) as perm_free
,cast(case when perm_size = 0 then 0
else (cast(perm_free as decimal(25,4))/cast(perm_size as decimal(25,4)))*100
end as decimal(23,2)) as perm_free_perc
from dbc.diskspaceV
group by 1
;