Posted on 2009-07-06
We're experiencing an issue where our TEMP.DB in SQL 2005 is growing and thus taking up most if not all of the disk space where it resides. Our DBA states that we must restart the SQL server service to purge that DB. This question is 2-fold: first, our DBA is inexperienced and doesn't know what's causing this problem so if anyone is aware of a cool tool that will allow us to find queries or background processess that are running, the links or info would be greatly appreciated. Second, our SQL systems are running as a mirrored system (with 2 servers) set for automatic failover if a problem occurs on one of the servers. When the SQL server service is restarted, this causes a failover to occur. I'd like to create a scheduled task to restart the service, but included in the batch job will need to be the commands to failover the server. Has anyone ever done that? Sample code or commands that have worked in your situation again would be greatly appreciated.