Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL Server Maintenance Jobs

Posted on 2012-03-20
3
Medium Priority
?
176 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 2000 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 2000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

722 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