SelectEtoile : Base de connaissance SGBD

Posts Tagged 'reserverpgs'

Volumétrie Tables / Indexes / Bases SYBASE ASE

 

Liste de la volumétrie des tables en version 12.5 :

 

Use mabase
Go
select     DateJour               = convert(datetime,convert(char(10),getdate(),103),103),    
Base = db_name(),  
Tables = Object_name(id),       
NombreLigne = max(rowcnt(doampg)) ,       
Reserved = (sum(reserved_pgs(id,doampg))+ sum(reserved_pgs(id, ioampg)))*2,        
Data = (sum(data_pgs(id, doampg)))*2,       
Indexes = (sum(data_pgs(id, ioampg)))*2  
from sysindexes        
where id > 100       
group by id        
order by object_name(id)

 

 

 

 

Liste de la volumétrie des tables en version 15 :

use mabase
go
select top 10 t.DateJour,t.Base,t.Tables,Nb_row=convert(varchar(10),sum(t.rwct)),Reserved=sum(t.reserved), Data=sum(t.data), Indexes=sum(t.indexes)
from (select  DateJour        = convert(datetime,convert(char(10),getdate(),103),103),
        Base            = convert(varchar(15),db_name()),
        Tables          = convert(varchar(20),object_name(id)),
        case when indid < 2 then (row_count(db_id(),id)) when indid > 1 then 0 end as rwct,
        reserved        = (reserved_pages(db_id(),id,indid))*(@@maxpagesize/1024),
        case when indid < 2 then (data_pages(db_id(),id,indid))*(@@maxpagesize/1024) when indid > 1 then 0 end as data,
        case when indid > 1 then (data_pages(db_id(),id, indid))*(@@maxpagesize/1024) when indid < 2 then 0 end as indexes
from sysindexes
where id > 100) t
group by t.DateJour,t.Base,t.Tables
order by Reserved desc