Tracking Database Growth - Script Automation & Reporting

  • Hello,

     

    I found this script that helps me in populate a table with information about my database; specifically sizes. I am a looking for a way to automate the process wherein the data can be extracted to an excel spreadsheet for us to do reporting against to track our database size growth overtime. Your help will be greatly appreciated.

     

     

     

  • I've not used or done a deep review of the article at the following link but, at a 60,000 foot level, it seems like it may be one of the better articles for one of the methods they use at work.

    https://www.mssqltips.com/sqlservertip/4585/using-microsoft-query-in-excel-to-retreive-sql-server-data/

    The real key here ask for what you REALLY want to get from the data you've been collecting.  I suspect that, like most people, you'll plot the data in a chart and add an extended trendline to the size of the drive in order to predict when the drive will run out of space so that you can order more drive space long before such a thing happens.

    While the chart is certainly a nice visual, it's not necessary. You can easily solve such linear regression analysis just using the data you're collect about the drives in a table on the server.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Thank you Jeff! This is helpful!

  • I created a monitoring tool(DBA Dash)  that can track space of your databases over time.  There are some export to Excel options if you want to do some further analysis in Excel.  It might  be worth a look - it does a lot of other useful things and it's free/open source.

    If not Jeff's answer is good.  Another alternative could be to use Invoke-DbaQuery with Export-Excel.

    • This reply was modified 8 months, 3 weeks ago by  David Wiseman.
    Attachments:
    You must be logged in to view attached files.

    DBA Dash - Free, open source monitoring for SQL Server

  • Thank you, David!

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply