Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: Database: MS SQL Server
 Sql Server Admin Tips
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Podge
Support Moderator

Ireland
3775 Posts

Posted - 03 March 2005 :  11:19:15  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
Just curious if any of the server admins here have tips for other admins regarding Sql Server maintainence.

Apart from the regular stuff e.g. backups, etc. is there any non routine stuff you do or third party software you use?

I admin a busy sql server with about 1500 databases and everything runs smoothly (thank God). I have time on my hands at the moment and am looking at doing the following;

1. Some of the transaction logs are 5 years old and are GB's in size. Rather than shrinking them (which would only save a little space) I'm thinking writing a script which will detach the log, then delete it and create a new log file. I don't think I will ever have to restore a db to a particular point in time 5 years ago. As my backups are daily I would only lose a days data worst case scenario, which is acceptable to me.

2. Analyse the most cpu intensive queries with a view to optimising them. Anyone ever tried this software - http://www.quest.com/quest_central_for_sql_server/index.asp

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 03 March 2005 :  11:25:58  Show Profile  Visit HuwR's Homepage
why are your transaction logs that big, if you are doing regular backups and you have your db's set to simple recovery (recomended) your transaction logs should never get very big as they only contain data since the last backup. The transaction log for Snitz never grows above 20Mb
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 03 March 2005 :  11:48:14  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
I knew about the recovery models but on spot checking, some of them are full recovery and some are simple. Guess I'll be writing a script to change the recovery model to simple instead.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 03 March 2005 :  14:47:18  Show Profile  Visit HuwR's Homepage
I would change them all to simple, do a backup, then shrink all the transaction logs, when that is done I would defrag your drive.
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 03 March 2005 :  16:02:42  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
Will do. I'm in the middle of a project for college at the moment but I'll post how I got on and how I did it in a few days.

Thanks HuwR.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 04 March 2005 :  22:07:15  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
Managed to change them all to simple using a script to iterate through all databases executing
alter database {databasename} set recovery simple.
Did a backup and then used an undocumented sp to shrink all db's and logfiles.

EXEC sp_MSforeachdb @command1="print '?' DBCC SHRINKDATABASE ('?')"

In the process of defragmenting the drive now but already it has saved about 19GB.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.

Edited by - Podge on 04 March 2005 22:07:34
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 05 March 2005 :  06:44:12  Show Profile  Visit Gremlin's Homepage
Change your Model DB to the Simple recovery mode as well, that way future databases (unless overridden) will be created as simple as well.

Another tip would be to frequent sqlteam.com there are some excellant articles and normally a pretty helpful community.

Kiwihosting.Net - The Forum Hosting Specialists

Edited by - Gremlin on 05 March 2005 06:45:07
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 05 March 2005 :  10:03:02  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
I agree with Gremlin... anytime I have a question about a query or any sql question I can 99% of the time search their Snitz Forums and find what I am looking for. If I can not find it, I can usually get a answer in a day. Like I said I have to agree... what a great site.

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 05 March 2005 :  10:09:40  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
Something else I just thought of is a tip a great SQL Admin once said (huw). It is best if the log and mdf files are on different HD's.

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 05 March 2005 :  11:00:09  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
I frequent sql team quite a bit. They have some great articles.

quote:
It is best if the log and mdf files are on different HD's.

Because logfiles are updated sequentially whereas updates to dbs usually aren't.

This is also a good tool - http://www.microsoft.com/downloads/details.aspx?FamilyId=B352EB1F-D3CA-44EE-893E-9E07339C1F22&displaylang=en

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 05 March 2005 :  14:31:11  Show Profile  Visit HuwR's Homepage
quote:

Because logfiles are updated sequentially whereas updates to dbs usually aren't.

It also means that your drives do less work because they can write logs and read data at the same time
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 05 March 2005 :  18:56:40  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
quote:
Originally posted by Podge


This is also a good tool - http://www.microsoft.com/downloads/details.aspx?FamilyId=B352EB1F-D3CA-44EE-893E-9E07339C1F22&displaylang=en



Intresting I will have to check that out.

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 05 March 2005 :  19:10:25  Show Profile  Visit Gremlin's Homepage
Though you do need to be mindful of your drive configuration before doing so, if you have a server with older PATA drives and they're on the same channel the efficiency gain may not be as great as if they were on seperate channels or using newer SATA drives. SCSI is of course a whole different kettle of fish and should ideally be whats used in any half decent server anyway.

Kiwihosting.Net - The Forum Hosting Specialists
Go to Top of Page

fetch
Starting Member

46 Posts

Posted - 03 July 2005 :  23:38:17  Show Profile  Visit fetch's Homepage
quote:
Originally posted by HuwR

why are your transaction logs that big, if you are doing regular backups and you have your db's set to simple recovery (recomended) your transaction logs should never get very big as they only contain data since the last backup. The transaction log for Snitz never grows above 20Mb



I converted my Snitz Forum from Access to SQL, and for some reason the logs steadily grow at a rate of several dozen megs per day. The database is set to autoshrink and actually has a maintanence task to shrink them every day, but still no dice. Once every week or two I end up having to detach, delete, and re-attach. Any ideas as to why I have this problem? I'd love to be able to completely ditch that particular bit of maintainence... thanks!

http://www.mhsaa.org/4rum/forum/
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 04 July 2005 :  06:34:17  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
You should set the recovery model to "simple" for the database.

Then setup a weekly maintainence plan to do integrity checks, optimise and backup the database. The logs will then be automatically shrunk.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.29 seconds. Powered By: Snitz Forums 2000 Version 3.4.07