Sybase ASE: How to know if a device has free space to extend a database on it

disk-spacememorysybasesybase-ase

I am new to sybase ASE.

I would like to know what are all the databases that have been using a device in sybase instance. sp_helpdevice or sp_helpdb are just giving not enough information.

Is there any such way to know the information in the below format.

device_name   db_id   allocated used free
.             .       .         .    . 
.             .       .         .    .
.             .       .         .    .

Best Answer

sp_helpdevice does list all allocated fragments on a device when you specify the device name. This includes the size of each fragment, but indeed not the free/used metrics. Those would not be difficult to write yourself however.