Showing posts with label scripts. Show all posts
Showing posts with label scripts. Show all posts

Friday, March 9, 2012

Monitoring Data file size

I am looking to automate monitoring space used for each file in each
database on a SQL Server 2000. Does anybody have any SQL Scripts to do
this or to find the space used?I'm not aware of a good/easy way from TSQL. You can use sp_spaceused to
find out how much space is available in the database as a whole - since
MSSQL aims to use each file more or less evenly, that might be good
enough to give you an idea.

Using SQLDMO, however, the DBFile object has a SpaceAvailableInMB
property, which will tell you exactly how much space is free. Behind
the scenes, it calls DBCC SHOWFILESTATS, which is undocumented.

In any case, since MSSQL aims to use the files roughly equally, it's
often more important to know how much free space is in the database as
a whole (sp_spaceused), or in the transaction log (DBCC SQLPERF).

Simon

Saturday, February 25, 2012

Monitor Database up or down and email to DBA

HI,

I like to know what different tools and scripts different people are using to monitor their SQL 2005 Databases.

We need to monito two services they are up and running all the time.

MSSQLServer & SQLAgent

Currently we have 3 different sql 2005 server and each one have 4 databases, we like to monitor.

Thanks in advance

I hear good things about Quest's Spotlight and Idera's Diagnostic Manager, but haven't worked with either enough to be able to recommend them myself.

Ask in the tools group (http://groups.google.com/group/microsoft.public.sqlserver.tools) or the Tools forum (http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=84&SiteID=1)

HTH...

Joe