Solved

SQL Database Capacity Planning

Posted on 2014-02-20
9
341 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
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 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Slow Connectivity over ODBC 8 35
SQL Replication question 9 42
Get the latest status 8 32
How To Convert Date Stored as Varchar as an MSSQL DATE Type Field In a VIEW 3 23
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

773 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