Solved

Scheduled Tasks

Posted on 2009-07-06
4
268 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 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

14 Experts available now in Live!

Get 1:1 Help Now