Waring alters when the database (files MDF, NDF & LDF) reaching the MAX size.

  • HI Frnds,

    I need help on setting up alters when the database (files MDF, NDF & LDF) reaching the MAX size.

    If anybody have some thing please share, I am trying to lookup in google and I didnt get anything.

    If anybody have good post on how to implement it please post it.

    Thanks in advance.

  • Ranzz (2/15/2013)


    HI Frnds,

    I need help on setting up alters when the database (files MDF, NDF & LDF) reaching the MAX size.

    If anybody have some thing please share, I am trying to lookup in google and I didnt get anything.

    If anybody have good post on how to implement it please post it.

    Thanks in advance.

    What do you mean by "setting up alters"? Do you mean "alerts" when the files are nearing max size?

    Or when the free space on the drive is getting low?

    ______________________________
    AJ Mendo | @SQLAJ

  • You can set up alerts under the SQL Server agent, I believe the type is "SQL Server Performance Condition Alert" and it will allow you to set thresholds for each database. I can't remember if the value counter allows a percentage or if it needs to be a literal value. You should be able to find that out in BOL

    ______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience

  • Thanks SQLAJ

    yes i mean by alerts..sorry misspelled.

    when the files are nearing max sizes. how to implement it.

    If there is any good blog post, how to set up please forward it.

    thanks.

  • Ranzz,

    Take a look at this post. It has some code you can use and shows some examples of alerts.

    http://www.sqlmag.com/blog/practical-sql-server-45/sql-server-2012/disk-space-monitoring-143552

    ______________________________
    AJ Mendo | @SQLAJ

  • Good Post AQLAJ,

    It give information on Drive Spaces at certain threshold.

    But, I am looking at a threshold alerts when the database (files MDF & LDF) reaching the MAX size.

    Please any help frnds..! Thanks in Advance.

  • Use something like this script to monitor the size and free space of the files.

    Setup a job that runs everyday/week insert into a database to monitor/track over time, send you an email or both.

    SELECT

    [name]

    , [physical_name]

    , CAST(( / 128.0) AS decimal(18,2)) AS FileSizeInMB

    , CAST((fileproperty([name],'SpaceUsed')) / 128.0 AS decimal(18,2)) AS SpaceUsedInMB

    , CAST((( - fileproperty([name],'SpaceUsed')) / 128.0) AS decimal(18,2)) AS FreeSpaceInMB

    FROM sys.database_files

    ______________________________
    AJ Mendo | @SQLAJ

  • I am that confident on creating my own.

    Can one please help me providing some documention how to implement it.

  • Instead of constantly trying to adjust the max size, I'd suggest setting the max to "UNLIMITED", then monitoring and alerting for every file growth occurence instead.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

  • It cant be possible to set unlimited growth.

    So, that is the reason, I am looking for some thing that will help us.

  • Ranzz (2/18/2013)


    It cant be possible to set unlimited growth.

    So, that is the reason, I am looking for some thing that will help us.

    It is possible in SQL Server.

    Maybe your specific company has a policy against it, so you're not allowed to do it?

    Stupid policy, but you may not be able to change it.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

  • Any help from the other members!

  • At some point you will need to do some work yourself. If you need to set max size, then YOU need to find out how much the database is growing, by day, week, or month. Then determine the max number to set and monitor the growth.

    Several options have been suggested. They may not work "as is" but look at them and determine for your situation what will work best. You will learn valuable information about your server and database and gain a better understanding for the future.

    ______________________________
    AJ Mendo | @SQLAJ

Viewing 13 posts - 1 through 12 (of 12 total)

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