Below sql will give you the size used and allocated for each database in Netezza:
select orx.database::nvarchar(64) as "databasename" ,
case when sum(sod.used_bytes) is null then 0 else sum(sod.used_bytes)/1073741824 end as "usedspace_gb",
case when sum(sod.allocated_bytes) is null then 0 else sum(sod.allocated_bytes)/1073741824 end as "allocatedspace_gb"
from _v_sys_object_dslice_info sod inner join _v_obj_relation_xdb orx on orx.objid = sod.tblid
group by "databasename"
order by "databasename";
select orx.database::nvarchar(64) as "databasename" ,
case when sum(sod.used_bytes) is null then 0 else sum(sod.used_bytes)/1073741824 end as "usedspace_gb",
case when sum(sod.allocated_bytes) is null then 0 else sum(sod.allocated_bytes)/1073741824 end as "allocatedspace_gb"
from _v_sys_object_dslice_info sod inner join _v_obj_relation_xdb orx on orx.objid = sod.tblid
group by "databasename"
order by "databasename";
No comments:
Post a Comment