Sybase ASE本身不提供直接查看设备使用情况的系统存储过程。我写了一个SQL,可以实现查看各设备的总空间、已用空间和剩余空间,如下:
/* 查看数据库设备的使用情况 */
use master
go
select d.name, total=(d.high - d.low + 1)/512,
used=sum(u.size)/512,
free=(d.high-d.low - sum(u.size) + 1)/512
from sysdevices d, sysusages u
where u.vstart between d.low and d.high
and cntrltype=0
group by d.name
order by d.name
go