Unix Technical Forum

Calculating freespace in a database

This is a discussion on Calculating freespace in a database within the Sybase forums, part of the Database Server Software category; --> Hi folks What is the most accurate method for calculating available free space (for data storage, excluding available log ...


Go Back   Unix Technical Forum > Database Server Software > Sybase

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 04:10 PM
Larry Buss
 
Posts: n/a
Default Calculating freespace in a database

Hi folks

What is the most accurate method for calculating available free space
(for data storage, excluding available log space) within a SYBASE
12.x.x database?

I am assembling a free space threshold procedure and would like to use
the most accurate method available.

Right now I am using current unreservered pages as my value, but the
question I have about using this is if it includes unallocated log
space as well.

Thanks in advance for your help

Larry Buss
labuss@magothy.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 04:10 PM
yurick
 
Posts: n/a
Default Re: Calculating freespace in a database

labuss@magothy.com (Larry Buss) wrote in message news:<c8d75044.0312212120.78ba5b09@posting.google. com>...
> Hi folks
>
> What is the most accurate method for calculating available free space
> (for data storage, excluding available log space) within a SYBASE
> 12.x.x database?
>
> I am assembling a free space threshold procedure and would like to use
> the most accurate method available.
>
> Right now I am using current unreservered pages as my value, but the
> question I have about using this is if it includes unallocated log
> space as well.
>
> Thanks in advance for your help
>
> Larry Buss
> labuss@magothy.com


Hi,

you can use this query(I have server with 2K page size):

select 2*sum(unreservedpgs)
from sysusages where dbid=db_id('dbname') and segmap = 3

but make sure data and log are on different locations, I really do not know
what to do if log and data are in the same segment.

From Sybase docs:

Some possible values for segments containing data or logs are:
Value Segment
3 Data only (system and default segments)
4 Log only
7 Data and log
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:58 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com