Solved

Scheduled Tasks

Posted on 2009-07-06
4
273 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

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

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

749 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