var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: How to portably estimate the space USED by a database?
What's the portable (accross Sybase versions) way to know, how much space a database is actually using?
I thought, I should be getting the list of databases and sizes with:
and it works most of the time, but sometimes the usage in the second column is reported as NEGATIVE even for otherwise healthy databases.
select name, sum(size - unreservedpgs) from sysdatabases, sysusages
where sysusages.dbid = sysdatabases.dbid group by name;
What's the reliable way for Sybase versions 11.x and above? Thanks!
The -ve number is a bug in Sybase and there is no real way around this to get the free page count.
The only way to fix the -ve count is to force a dbcc usedextents and recalculate all the page usage stats.
Thanks, but how does one do this forcing? And what is the cost of doing it? Is it always required, or will it fix the statistics until something weird happens again?
Originally Posted by
ON older releases this bug was annoying and needed constant run of dbcc usedextents as pages get marked as used and unused in a db.
From memory usedextents does not work on a logsegment. You have ti run a dbcc tablealloc with fix to the -ve space usage on log.
I'm seeing this problem on
It is not
12.5.1/EBF 11428/P/NT (IX86)/OS 4.0/ase1251/1823/32-bit/OPT/Wed Sep 17 11:10:54
that old :-) But both 'dbcc usedextents' and 'dbcc tablealloc' respond with "Incorrect DBCC command". Are you sure, these apply to Sybase and not MSSQL?
because both have passing params.
Hi everyone! I'm Eva
Hi guys, my names Eva and im completely new to this forum.
I hope that I'll learn and share a lot of interesting things.
My name is Tina, I am 41 yrs old, living in Austin, TX.
I'd love to make good close friends here.
Alternate to using dbcc usedextents is Restarting the server by putting two trace flags 7409 --for Logsegment & 7408 for Datasegments in RUN_SERVER file using -T parameter . This method is somewhat fast as compared to dbcc usedextents . For removing -ve space.