AUTO GROW OPTION

  • I need to disable the auto grow option and fix the data file size. Can some one please help me with the script to increase the size to 120 GB. Thanks

  • Hi,

    From BoL "ALTER DATABASE" subject:

    USE master;

    GO

    ALTER DATABASE AdventureWorks

    MODIFY FILE

    (NAME = test1dat3,

    SIZE = 20MB);

    GO

    But are you sure you want to disable Autogrow? Is it so that you have hit the roof on diskspace and need to do it temporarily until you get more diskspace?

    /Elisabeth

    elisabeth@sqlserverland.com
    MCITP | MCT
    http://sqlblog.com/blogs/elisabeth_redei/
    http://linkedin.com/in/elisabethredei

  • Also keep in mind that depending how big your DB is right now - it will take some time to grow the file up to 120GB. If you're talking about adding 50GB, you could be talking a reasonably substantial amount of time to grow the file (like 30+ minutes) during which time the DB will no be available.

    Just be sure to pick a slow time.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Hi,

    Good point, Matt. Instant File initialization (see "Database File Initialization" in BoL ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/1ad468f5-4f75-480b-aac6-0b01b048bd67.htm) will get you around that.

    /Elisabeth

    elisabeth@sqlserverland.com
    MCITP | MCT
    http://sqlblog.com/blogs/elisabeth_redei/
    http://linkedin.com/in/elisabethredei

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

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