Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 monitoring disk space

Author  Topic 

vdavid70
Yak Posting Veteran

67 Posts

Posted - 2005-05-10 : 05:56:44
hi all,

This might seem rather silly, but is there a way to actually find out and monitor disk space used and left on the server.In other words the size of the database and transaction logs used and the remaining space left on the disk.

Secondly how do i set a treshold and monitor the growth of the database in comparison to the space allocation.

Thanks,
Vdavid70

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-05-10 : 06:03:09

Here are some ways to know that from QA

sp_helpdb 'DBName'

sp_MSForEachtable 'sp_spaceused ''?'''

SELECT
used AS "Pages" ,
rows AS "Rows" ,
(used * 8) / 1024 AS "Used" ,
CAST(OBJECT_NAME(id) AS CHAR(30)) AS TableName FROM sysindexes
ORDER BY used DESC

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

vdavid70
Yak Posting Veteran

67 Posts

Posted - 2005-05-10 : 08:10:08
Thanks, i think this should help.

Vdavid70
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-05-10 : 08:16:04
This might help too:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=47014

The queries provided above do not actually monitor disk space, but the space used by the database files.
Go to Top of Page

vdavid70
Yak Posting Veteran

67 Posts

Posted - 2005-05-10 : 10:42:54
Thanks rob. The procedure was very helpfull.

Vdavid70
Go to Top of Page

vdavid70
Yak Posting Veteran

67 Posts

Posted - 2005-05-12 : 07:37:02
Thanks Rob, the link answers the question on setting Thresholds. But i still need to know how to know the size of the database at the moment compared to the available space.
As well as the memory used by the Sql database system and the memory available at a point.
I am trying to write a report on the state of the database for this period that is why i need to know the state of the system for now.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-05-12 : 07:42:31
I would suggest using the tools that Derrick mentioned in that thread, they are specifically designed to give you that information and provide point-in-time reports.
Go to Top of Page

bakerjon
Posting Yak Master

145 Posts

Posted - 2005-05-12 : 19:11:19
master..xp_fixeddrives will tell you how much is remaining on a disk. Between sp_spaceused, sysdatabases and sysfiles and xp_fixeddrives, you should be able to piece together the information you are looking for.

Now I know, and knowing is half the battle!
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=48013

Go to Top of Page
   

- Advertisement -