Solved

Scheduled Tasks

Posted on 2009-07-06
4
269 Views
Last Modified: 2012-05-07
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
Comment
Question by:skbarnard
  • 2
4 Comments
 
LVL 5

Expert Comment

by:rgc6789
ID: 24786959
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
 

Author Comment

by:skbarnard
ID: 24787253
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
 
LVL 2

Accepted Solution

by:
corptech earned 500 total points
ID: 24791178
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
 

Author Closing Comment

by:skbarnard
ID: 31600222
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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now