Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 284
  • Last Modified:

Scheduled Tasks

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.
0
skbarnard
Asked:
skbarnard
  • 2
1 Solution
 
rgc6789Commented:
Can you tell us if it is the mdf or ldf file that is large? Are you running any maintenance jobs on the db?
0
 
skbarnardAuthor Commented:
It's the MDF file that is getting that large and no backup jobs are running because none are allowed to run on the TEMPDB that I have found.  I just tried to create a maintenance plan to backup all system databases (the TEMPDB is a system DB) and when I looked at the T-SQL the Master, Model and MSDB are the only system databases that are backed up.
0
 
corptechCommented:
Make sure you have simple recovery model on tempdb and it is set to autogrow.  The next step would be to make sure database access from programs are as concise as possible (ie - indexed tables with primary keys, limited use of temp tables, limited use of nested cursors, etc. ) and transactions are commited regularly.  

In sql server you can look at the activity monitor under the Management folder.  That lists all of the current processing running.
0
 
skbarnardAuthor Commented:
I gave this solution to our acting DBA but he didn't give me feed back as to whether this solved the issue but I don't want to keep the question open any longer.  Thanks to all who responded
0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now