Is there a way to get log usage from a database where data and log segment are in the same device for Sybase?
I have searched and there are examples of queries that show all databases and usages, but many commented that when a database segment = 7 (data and log in same device) it will show same values because they are in same device.
When ocurred a log suspend it is not necesary that the data usage is full, this is why i am asking if there is a way to show the real usage of data and log even if there are in the same device.
This is the query i am using:
select
ceiling(sum(case when u.segmap != 4 then u.size/1048576.*@@maxpagesize end )),
ceiling(sum(case when u.segmap != 4 then size - curunreservedpgs(u.dbid, u.lstart, u.unreservedpgs) end)/1048576.*@@maxpagesize),
ceiling(sum(case when u.segmap = 4 then u.size/1048576.*@@maxpagesize end)),
ceiling(sum(case when u.segmap = 4 then u.size/1048576.*@@maxpagesize end) - lct_admin('logsegment_freepages',d.dbid)/1048576.*@@maxpagesize)
from master..sysdatabases d, master..sysusages u
where u.dbid = d.dbid and d.status != 256 and u.dbid = db_id('DBNAME') group by d.dbid