How to free space on a disk??

  • I know how to calculate free space....

    But i don't know how to free the disk space??

    Sagar Sonawane
    ** Every DBA has his day!!:cool:

  • by using this we can see the drives space EXEC xp_fixeddrives

    sp_helpdb 'DatabaseName' By using we can see the datbase sie

  • Freeing disk space could means many things :-

    e,g simply backing up a db will free space , so will shrink db

    you could even move a partition out, or delete unwanted files from the drive. Other things could include moving the databases to another drive and even checking if the OS page file is located on the same drive.

    Jayanth Kurup[/url]

  • This is somewhat I was thinking...but I am sure now... Thank you

    Sagar Sonawane
    ** Every DBA has his day!!:cool:

  • Jayanth_Kurup (8/9/2011)


    e,g simply backing up a db will free space .

    It does not.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Oops , my mistake . I tried running Backup Log with truncate only and it didnt bring the size down.

    However MSDN state the following

    NO_LOG | TRUNCATE_ONLY

    Removes the inactive part of the log without making a backup copy of it and truncates the log by discarding all but the active log. This option frees space. Specifying a backup device is unnecessary because the log backup is not saved. NO_LOG and TRUNCATE_ONLY are synonyms.

    I know this option doesnt apply to SQL 2008 however.

    BTW I missed compression as an option to save space.

    Jayanth Kurup[/url]

  • Jayanth_Kurup (8/9/2011)


    Oops , my mistake . I tried running Backup Log with truncate only and it didnt bring the size down.

    However MSDN state the following

    NO_LOG | TRUNCATE_ONLY

    Removes the inactive part of the log without making a backup copy of it and truncates the log by discarding all but the active log. This option frees space. Specifying a backup device is unnecessary because the log backup is not saved. NO_LOG and TRUNCATE_ONLY are synonyms.

    I know this option doesnt apply to SQL 2008 however.

    BTW I missed compression as an option to save space.

    NEVER USE THAT.

    http://www.sqlservercentral.com/articles/64582/

    http://www.sqlservercentral.com/articles/Transaction+Log/72488/

  • Jayanth_Kurup (8/9/2011)


    Oops , my mistake . I tried running Backup Log with truncate only and it didnt bring the size down.

    Don't ever use that. It breaks the log chain, it leaves you unable to take transaction log backups or to do point in time recovery until another database backup is taken.

    However MSDN state the following

    NO_LOG | TRUNCATE_ONLY

    Removes the inactive part of the log without making a backup copy of it and truncates the log by discarding all but the active log. This option frees space. Specifying a backup device is unnecessary because the log backup is not saved. NO_LOG and TRUNCATE_ONLY are synonyms.

    It frees space within the file, just like backup log to disk does. It does not release space to the OS (no more than backup log to disk does)

    I know this option doesnt apply to SQL 2008 however.

    And it doesn't because people were using it without understanding and getting themselves into all sorts of trouble. It was deprecated in 2005 already. Replacement is to switch the DB to simple recovery model (yes, that's almost what Backup Log with truncate only does)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 8 posts - 1 through 7 (of 7 total)

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