Solved

SQL Server Maintenance Jobs

Posted on 2012-03-20
3
164 Views
Last Modified: 2012-04-10
Hi,
I have new SQL server systems. I am looking for all kind of maintenance procedures one can add to make it work better or prevent any issues.

Things like
- Truncating log files every night
- Rotaing SQL server logs each night

Could someone with hands on Sql experience list them here?

Thanks
0
Comment
Question by:crazywolf2010
[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
3 Comments
 
LVL 40

Assisted Solution

by:lcohan
lcohan earned 500 total points
ID: 37744762
SQL Maintenance task I would perform every night:

FULL DB backup - all db's
T-log backups - all DB's - this should relese used T-Log space as well
REINDEX and update STATS all DB's

Weekly/Monthly
I would run a DBCC CHECKDB on all DB's
0
 

Author Comment

by:crazywolf2010
ID: 37746236
Hi,
Would you able to share any scripts for
- REINDEX and update STATS all DB's
- DBCC CHECKDB on all DB's
0
 
LVL 40

Accepted Solution

by:
lcohan earned 500 total points
ID: 37747419
Sure - please see code from http://sqlfool.com/2011/06/index-defrag-script-v4-1/ 
for the reindex and as far as DBCC CHECKDB goes that could be done in a SQL job one step at a time per database and the command is just like that:


DBCC CHECKDB (your_db_name_here)
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

739 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