Database size reduction logic check, please

Database size reduction logic check, please

I am preparing to establish an Exchange 2013 DAG based on two Exchange 2013 Std servers. We are running a vSphere 6.5 environment.
Until recently we were running on a single Exchange 2013 Std server with two databases (1 and 2, about 400GB each). Then, I created two new databases (3 and 4) and moved roughly a quarter of the mailboxes to each.
Each of the databases are hosted on their own volume, and then I also have one single separate volume to hold the log files for all the database (so five volumes in total for alle the Exchange data)
Having copied a good deal of the mailboxes away from 1 and 2 does nothing to decrease their size (which potentially should be able to be brought down to approx. 200GB each), which I'd like to do before creating a DAG.
In order to avoid downtime, I am contemplating the following to reduce them:
1) Create a new volume (the sixth data volume) to hold a new dabase (database 5)
2) Copy all mailboxes from databse 1 to database 5
3) Dismount database 1
4) Delete database 1 (which may actually be the default database we started with originally - does this matter?)
5) Remove the volume used by database 1 from the Exchange server

Would this work? If so, I'd then do the same thing for database 2, and then proceed with creating a two-server DAG. Input would be appreciated.
LuftHansi-DKAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jose Gabriel Ortega CEE Solution Guide - CEO Faru Bonon ITCommented:
Yeah that will work for DB1 and DB2.

You will avoid the downtime and  get the logs cleared by doing that.

Another option is to delete the soft-deleted mailboxes on each DB:
https://community.spiceworks.com/how_to/47354-soft-deleted-mailboxes-and-how-to-remove-them-in-exchange-2010

Get-MailboxDatabase | Clean-MailboxDatabase
Get-MailboxStatistics -Database "Database" | Where-Object {$_.DisconnectDate -Notlike $NULL} | Format-Table DisplayName, DisconnectDate, MailboxGuid, DisconnectReason –Wrap
$Mailboxes = Get-MailboxStatistics -Database "database" | where {$_.DisconnectReason -eq “SoftDeleted”} 
$Mailboxes | foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState SoftDeleted}

Open in new window



Which will give you the Clean up of the drive space. That's the main reason why you don't see the drive space recovered. because it remains soft-deleted in the database
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
LuftHansi-DKAuthor Commented:
Hi Jose,

Ah - I see...

1) So I should probably try this soft-deletion approach first to see if the databases 1 and 2 get reduced significantly, in which case I could avoid all the trouble I have outlined in my original posting. Is that correctly understood?
2) The soft-deleting approach is identical on Exchange 2013 as on Exchange 2010 - correct?

Thank you so far...
0
Jose Gabriel Ortega CEE Solution Guide - CEO Faru Bonon ITCommented:
1. Exactly
2. Yes it's the same on all exchange server versions (luckily)

Also doing backups of the whole volumes where the databases are you can reduce the Log sizes

You can find the size of the logs with my script on TechNet:
https://gallery.technet.microsoft.com/office/What-is-the-size-of-my-0e1993a7

And rate the script if it was useful :) hahaha (thank you!)
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

LuftHansi-DKAuthor Commented:
Hi Jose,

No kidding! Ok, I'll give it a shot, probably tomorrow, and get back to you... Thanks again.
0
timgreen7077Exchange EngineerCommented:
Moving the mailboxes to different DBs doesn't reduce the size of the DB. Exchange takes that freed up space and make it whitespace, but the actual size of the edb doens't change, but as you move mailboxes and delete mail items exchange will use the whitespace for new mail content, and once the white space it all used up Exchange will start growing the edb again. Example:

You have a 500GB edb, and have 400 GB of mailboxes and data so you have 100GB free.
So you delete 200GB of mail data, but that doesn't add those 200GB back to give you 300GB free.
What happens is that 200GB becomes whitespace, and exchange will use that white space to add any new mailbox and mail content to the DB, and it will use that until the 200GB is completely used up and then it will start working on the 100GB that you had free.

So even those the space for the DB really isn't reclaimed, that freed up space (whitespace) will still be used, even though the actual edb isn't shrunk. Hope that makes sense but that is why you don't see a change in the DB size when you move the mailboxes.
0
LuftHansi-DKAuthor Commented:
Hello Jose,

The soft deletion actually did nothing to reduce the size on disk, but since you told me that my original plan (which I have now proceeded to execute) was sound, you get the most points - thank you both for your help :)

/hans
1
Jose Gabriel Ortega CEE Solution Guide - CEO Faru Bonon ITCommented:
I'm pretty sure the soft-deletion return the space to the DB, probably is the command that is not working (or it was the bad command or  process) I did something similar time ago and it worked (but I didn't document it, I'll do it the next time I have to face this issue).
0
timgreen7077Exchange EngineerCommented:
nothing returns space back to the edb. it all becomes white space. only way to get space back is offline defrag.
0
LuftHansi-DKAuthor Commented:
The soft-delete commands did work: I could see the soft-deleted mailboxes before I ran the special deletion command, and after the deletion command they were no longer there. But this did not help on how much the database takes up on disk (400GB before, and 400GB after).

Regarding Tims comment: Actually, my original plan (and subject of this thread) also can do it, and that is what I'm doing now (my new database 5, to which I copied the mailboxes from database 1, only takes up 163GB (down from the original 400)). I did not want to do the offline defrag because that causes downtime (and some also say it is more risky).

/hans
0
timgreen7077Exchange EngineerCommented:
Agreed, I would never do an offline defrag, I would also create a new DB, I was just speaking to reclaiming the space, not trying to convince you to perform an action but clarify the question of reclaiming space.
0
Jose Gabriel Ortega CEE Solution Guide - CEO Faru Bonon ITCommented:
I mean, I did recover some space based on Clean up but I just don't remember the cmdlets or the process I did (because I tried a lot of things and it was like 3 years ago)
but Eventually, I'll face this problem again. :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.