SQL Database Capacity Planning

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?
FavorableAsked:
Who is Participating?
 
Brian CroweConnect With a Mentor Database AdministratorCommented:
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
 
Brian CroweDatabase AdministratorCommented:
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
 
Aneesh RetnakaranConnect With a Mentor Database AdministratorCommented:
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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

 
FavorableAuthor Commented:
BriCrowe and Aneesh,

Do any of you have a script I can you to achieve your response?
0
 
Brian CroweDatabase AdministratorCommented:
You would need to provide some schema information on your contracts table.
0
 
FavorableAuthor Commented:
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
 
Brian CroweDatabase AdministratorCommented:
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
 
Aneesh RetnakaranDatabase AdministratorCommented:
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
 
FavorableAuthor Commented:
Thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.