Huge SQL 2000 Database need to shrink it :(

  • @ sais

    As san droid said, backing up the db might affect the shrinking too...

    The script which you should run to shrink the mdf files :-

    USE dbname

    GO

    DBCC SHRINKDATABASE(N'dbname', 10, TRUNCATEONLY)

    DBCC SHRINKDATABASE(N'dbname', 10)

    Regards,

    Sushant

    Regards
    Sushant Kumar

  • chris.s.powell (11/2/2010)


    As for the rebuild index, it will be recorded in the log file, with a proper backup plan in place, that space will be freed after it is completed.

    I'm not having a dig, it was meant as an aside speaking of which.

    It will likely grow the data file too, due to the way the indexes are rebuilt. Initially, they are not actually deleted, they are only de allocated.

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • @ chris

    Checking integrity and updating stats should be done after the shrinking of the database.

    Regards,

    Sushant

    Regards
    Sushant Kumar

Viewing 3 posts - 16 through 18 (of 18 total)

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