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

x
?
Solved

SQL Database Capacity Planning

Posted on 2014-02-20
9
Medium Priority
?
346 Views
Last Modified: 2014-02-24
Capacity Planning

I have been tasked with the following for my department.

(1)      Determining data grow over the past two or three years – for example using our contracts table as bench marking, dependencies and database to forecast capacity planning for the next five years.
(2)      Capacity planning database wise to determine disk space sizes

Can somebody lead me in the right direction?
0
Comment
Question by:Favorable
[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
  • 4
  • 3
  • 2
9 Comments
 
LVL 34

Expert Comment

by:Brian Crowe
ID: 39874047
You can determine the number of contracts in the system at any given time.  You know the current size of your database and based on the rate of increase you can extrapolate the number of contracts at any given time in the future.  From this you can calculate the estimated size of your database at any given point.  You are making a few assumptions in this process but it's workable.
0
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 600 total points
ID: 39874052
Use the previous backups if any , check how the backup sizes are increasing, that should give you fair idea. also, you should check year end activities, some applications purges the data, some will have a sudden growth (year end tax filing, shopping etc )
0
 

Author Comment

by:Favorable
ID: 39874095
BriCrowe and Aneesh,

Do any of you have a script I can you to achieve your response?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 34

Expert Comment

by:Brian Crowe
ID: 39874117
You would need to provide some schema information on your contracts table.
0
 
LVL 34

Accepted Solution

by:
Brian Crowe earned 1400 total points
ID: 39874304
I decided to play with it a bit and used an Orders table  and came up with the following:

Obviously you will need to adjust the size value, target dates, and the target schema but the process should hold.  Just copy the results into Excel and create a chart.  You can add a trendline to the chart to show future values based on the results.

DECLARE @DBSize	FLOAT;

SET @DBSize = 25.4;	--GB

IF OBJECT_ID('tempdb..#OrderHistory') IS NOT NULL
	DROP TABLE tempdb..#OrderHistory;

WITH cte
AS
(
	SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, OrderDate), 0) AS [Date], COUNT(OrderID) AS OrderCount
	FROM esf_Order
	WHERE StoreNumber = 1
		AND OrderDate > '1/1/2013'
		AND OrderDate < '2/1/2014'
	GROUP BY DATEADD(MONTH, DATEDIFF(MONTH, 0, OrderDate), 0)
)
SELECT cte1.[Date], CAST(SUM(cte2.OrderCount) AS FLOAT) AS Value
INTO #OrderHistory
FROM cte AS cte1
INNER JOIN cte AS cte2
	ON cte1.[Date] >= cte2.[Date]
GROUP BY cte1.[Date]
ORDER BY cte1.[Date]

--Normalize the data

DECLARE @NormalizeQuotient	FLOAT;

SELECT TOP 1 @NormalizeQuotient = Value
FROM #OrderHistory
ORDER BY [Date] DESC

UPDATE #OrderHistory
SET Value = Value / @NormalizeQuotient

--Multiply by current Size

UPDATE #OrderHistory
SET Value = Value * @DBSize

SELECT * FROM #OrderHistory

Open in new window

EE-DB-Size-Prediction.xlsx
0
 

Author Comment

by:Favorable
ID: 39874332
The db has been growing since the past five years.
Current size plus log  83285.00 MB is the largest one I want to use as baseline to forecast capacity planning for the next five years.

See the attached
This-Database-size.docx
0
 
LVL 34

Expert Comment

by:Brian Crowe
ID: 39874354
I wouldn't include the log file in your calculations.  The log file shouldn't change much regardless of your data file size.  The log file size is determined by your transaction rate and how often you are doing transaction log backups.  Hopefully the example I provided above will give you what you need.
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 39874394
Another option is to implement Datacollector to monitor database size, you need to monitor for at least a month to get an idea of the database growth
0
 

Author Closing Comment

by:Favorable
ID: 39882195
Thank you
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

705 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