dbTalk Databases Forums  

Calculating freespace in a database

comp.databases.sybase comp.databases.sybase


Discuss Calculating freespace in a database in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Larry Buss
 
Posts: n/a

Default Calculating freespace in a database - 12-21-2003 , 11:20 PM






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 (AT) magothy (DOT) com

Reply With Quote
  #2  
Old   
yurick
 
Posts: n/a

Default Re: Calculating freespace in a database - 12-25-2003 , 10:57 AM






labuss (AT) magothy (DOT) com (Larry Buss) wrote in message news:<c8d75044.0312212120.78ba5b09 (AT) posting (DOT) google.com>...
Quote:
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 (AT) magothy (DOT) 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


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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.