Solved

SQL Database Capacity Planning

Posted on 2014-02-20
9
339 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
  • 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 150 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
 
LVL 34

Expert Comment

by:Brian Crowe
ID: 39874117
You would need to provide some schema information on your contracts table.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 34

Accepted Solution

by:
Brian Crowe earned 350 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now