locked
Shrinking Exchange 2007 Database Volume RRS feed

  • Question

  • Hello,

    I want to shrink a database volume with 150G free by 50G and use it to extend a another database volume with 50G free. Can this be done without corrupting data? I can unmount the databases but do I need to stop all Exchange services?

    Thanks,

    Robert

    Saturday, March 26, 2011 8:10 PM

Answers

  • This has actually nothing to do with Exchange.
    The problem is when shrinking Partitions/LUN's is that you cannot be sure if it contains any valid data.

    What I would do is to first move data from the partition to a (possibly) temporary location, then shrink the partition or perhaps easier to simply delete it and create an new one with the size you want. Move data back and remove the temporary partitiion.

    Perhaps even easier thing would be to simply create a new LUN/Partition (if possible) and then move database to the new partition and simply delete the old one.

    if you cannot create free space somewhere, I would do a backup, stop Exchange services. do defrgmentation of the LUN to move data to the beginning of the partition. Finally shrink the partition. startup Exchange and verify by creating an additional backup.
    This is not failsafe since you cannot be sure that shrinking dont erase any sectors where you have files located.

     


    lasse at humandata dot se, http://anewmessagehasarrived.blogspot.com
    • Marked as answer by RTEAL Monday, March 28, 2011 6:39 PM
    Monday, March 28, 2011 6:20 PM

All replies

  • You need to run defrag on the database and command is eseutil /d "c:\MailboxDatabase.edb"
    Before you run this command check the event id 1221 to check how much free space you will get after running this command.

    You will have to dismount the database to run this command. 


    Gulab | MCTS-MCITP Messaging: 2010 | MCTS-MCITP Messaging: 2007 | MCC 2011 | Skype: Gulab.Mallah
    Sunday, March 27, 2011 7:34 AM
  • Are you saying run a defrag to recoup whitespace instead of shrinking/expanding volumes or prior to shrinking/expanding. Whitespace will grow again and I need actual diskspace.

    Thanks,

    Robert

    Monday, March 28, 2011 2:47 AM
  • Hi Robert,

    It will create one new EDB databse file with removed white spaces. To prepare for eseutil /d, make sure that you have plenty of free disk space, at least as much as the database file that you wish eseutil to defrag.

    Eseutil /D Defragmentation Mode:
    Alternatively I will advise you to move mailbox from existing databse to other one and delete this databse, Then create new DB and move 50% mailbox back into new DB , this will also remove your white spaces from DB and its most recommended method.
    Let us know if you have any other question !!!

    Anil
    Monday, March 28, 2011 3:21 AM
  • Monday, March 28, 2011 3:22 AM
  • I appreciate your help but I don't think you understand my objective.

    My objective is NOT to recover whitespace on a volume that is running out of diskspace. Whitespace will reoccur and a defrag doesn't solve the core disk space issue.

    What I want to do is to shrink an existing disk volume and add the newly freed space to a different disk volume in order to increase the total size of the second volume.

    VolumeA has 150G free. I shrink VolumeA by 50G and expand VolumeB by 50G.

    Does this operation risk database corruption and if so, would dismounting the volumes, stopping Exchange services, etc. mitigate the issues or is this just a bad idea on a database volume?

    Monday, March 28, 2011 5:44 PM
  • This has actually nothing to do with Exchange.
    The problem is when shrinking Partitions/LUN's is that you cannot be sure if it contains any valid data.

    What I would do is to first move data from the partition to a (possibly) temporary location, then shrink the partition or perhaps easier to simply delete it and create an new one with the size you want. Move data back and remove the temporary partitiion.

    Perhaps even easier thing would be to simply create a new LUN/Partition (if possible) and then move database to the new partition and simply delete the old one.

    if you cannot create free space somewhere, I would do a backup, stop Exchange services. do defrgmentation of the LUN to move data to the beginning of the partition. Finally shrink the partition. startup Exchange and verify by creating an additional backup.
    This is not failsafe since you cannot be sure that shrinking dont erase any sectors where you have files located.

     


    lasse at humandata dot se, http://anewmessagehasarrived.blogspot.com
    • Marked as answer by RTEAL Monday, March 28, 2011 6:39 PM
    Monday, March 28, 2011 6:20 PM
  • Thanks for your answer, Lasse. I doubt I will manipulate the partitions but how does one move data to the beginning of a partition?

    Monday, March 28, 2011 6:52 PM
  • Use your favorite defrag software and use the appropriate parameters to move all data to the beginning of the partition

     


    lasse at humandata dot se, http://anewmessagehasarrived.blogspot.com
    Monday, March 28, 2011 6:55 PM
  • Excellent.

    Have you ever heard of databases getting corrupted while volumes were expanded? If I could expand without dismounting the database this would be ideal.

    Thanks,

    Robert

    Monday, March 28, 2011 7:39 PM
  • exapnding is no problem

     


    lasse at humandata dot se, http://anewmessagehasarrived.blogspot.com
    Monday, March 28, 2011 7:51 PM