SBS 2008 Monitoring Database Maintenance

If you find that the SBSMONITORING instance of SQL Server is using up more than its fair share of resources (1.5GB+ RAM) and the
"SBSMonitoring.mdf" and "SBSMonitoring_log.LDF" files are over 4GB in size you need to run a maintenance script on the database and then shrink it.
SQL Server Express supports a maximum data file size of 4GB – once this limit is reached the SBS monitoring stops working.
To resolve this download this sql script:
http://cid-d5fe25afb6c3615f.skydrive.live.com/self.aspx/.Public/updateSBSMonitoring.sql
Run this script using:
Sqlcmd -S %computername%\SBSMonitoring -E  -i c:\path\to\updateSBSMonitoring.sql
If this runs successfully you should see:
Changed database context to ‘SBSMonitoring’
(1 rows affected)
This can take a while to process (45min on a large database)

This will ensure that the database will contain no more than 90 days worth of data.
Source URL: http://blogs.technet.com/b/sbs/archive/2009/07/14/sbs-2008-console-may-take-too-long-to-display-alerts-and-security-statuses-display-not-available-or-crash.aspx
Next we need to shrink the database size:
Run the "SQL server management studio express
Ensure that "SERVERNAME\SBSMONITORING" is selected and "Windows Authentication" is used and click "Connect"
Expand Databases and find the SBSMonitoring, right click it and choose Tasks -> Shrink -> Database
This will run for a while (20min) after which the database size should reduce to a much smaller size (about 300MB or so in some cases)
Source URL: http://www.eggheadcafe.com/software/aspnet/35793646/sbs-monitoring-4gb-2008-now-what.aspx and http://garclak-kb.blogspot.pt/2010/08/sbs-2008-monitoring-database.html