Solved

SQL Server Maintenance Jobs

Posted on 2012-03-20
3
157 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
  • 2
3 Comments
 
LVL 39

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 39

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
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 …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

777 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