Solved

SQL Server Performance

Posted on 2007-03-21
3
220 Views
Last Modified: 2010-03-19
We had a SQL Server 2000 Server running on a Windows 2003 Server with 4GB of RAM, RAID 5.  We were experiencing slow performance.  So we purchased a new Windows 2003 Server with 4GB of RAM, RAID 5, and upgraded to SQL Server 2005.

The applications seem to read from the databases fine, but saving records is slow, sometimes, even causing the application to stop responding.

Any help here, I am new to SQL Server and don't even know where to begin.

Thank you.
0
Comment
Question by:ourguru
  • 2
3 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18765785
this is usually one of 2 issues:
* SQL Server is allowed to take ALL the RAM, and hence the os/sql server start swapping
or, more probable here:
* your transaction log files are growing endlessy, without getting cleared.
here some explanations in regards to transaction logs:

  the transaction log is (in short) a circular buffer.
  every transaction is written to it.
  every transaction that has been backed up or truncated from the transaction log can be overwritten.
    -> hence, you either need a regular transaction log backup, or the database to be in simple recovery mode (be aware of the consequences)

  so, if you have a large .ldf file, you did have your database in full recovery mode, but "never" issued the transaction log backup.
    -> to avoid large .ldf file, see above.

  once the backup is in place, or the database in simple recovery mode, you can start shrinking the ldf file.
    -> note: put a correct size for it, so that even the largest transaction of your applications on that database can fit.
  if the shrink does not work straight away, this is because some non-cleared/active transactions are still in the file, usually and the end of the file  
    -> remember, the log file is a circular buffer.
  to solve that, simply run some transactions on the database (or wait for some to be run), and retry the shrink operation.
 

0
 

Author Comment

by:ourguru
ID: 18766002
My database is 4.5GB, and my LDF is 2.5GB.  I have them set to backup the LDF every night, but they stay around 2.5GB.

Is there any formula to estimate the amount of Memory needed for SQL Server.  Like a 4.5GB DB should have 6GB of RAM?
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 18766062
> I have them set to backup the LDF every night,
how? online backup (ie transaction log backup), I assume

> but they stay around 2.5GB
that should be fine. as long as the file does not grow, there is no indication of problem...

>Is there any formula to estimate the amount of Memory needed for SQL Server.
no. of course, the more, the better, but the max RAM you need is the size of the db itself (+a bit of overhead for the running programs, including sql server itself).
but that is usually not needed/possible.

check the performance counters to determine the bottleneck during the problems, like disk write contention...

check the execution plans of the update queries, see if you have eventually full table scans of clustered index scans. if that is the case, you are missing index(es)...

0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
In this article I will describe the Backup & Restore 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 video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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