Database

Remove Dead Exchange Servers from Active Directory

Working with  my Exchange 2012 Hybrid configuration I into the following error:

ERROR : Subtask NeedsConfiguration execution failed: Configure MRS Proxy Settings

Execution of the Get-WebServicesVirtualDirectory cmdlet has thrown an exception. This may indicate invalid parameters in your hybrid configuration settings.

The task wasn’t able to connect to IIS on the server ‘exchange’. Make sure that the server exists and can be reached from this computer: The RPC server is unavailable.

This is because I did not properly remove the retired exchange servers form Active Directory during past migrations to Exchange 2013.

To remove these objects to continue with your Hybrid configuration task do the following:

  1. Launch the run dialog (Windows Key + R)
  2. Type in the command “adsiedit.msc” and press OK
  3. In the drop down menu select “Configuration”
  4. Expand “CN=Configuration [domain]\CN=Services\CN=Microsoft Exchange\CN=[organization]\CN=Administrative Groups\CN=Servers”
  5. Right click on the dead server and “Delete”
  6. Navigate to ”CN=Configuration [domain]\CN=Services\CN=Microsoft Exchange\CN=[organization]\CN=Administrative Groups\CN=Databases”
  7. Right click on each dead database and “Delete”

Step 1-5 will get you past the Hybrid error, but you might as well cleanup while your here.

Remove database from read only mode, error 5120

I posted about setting a Microsoft SQL Database into ‘read only’ mode as part of an upgrade. Today I need to go back and make some changes on the now legacy system.

To handle this request I needed to change back to its normal state, this is when I encountered the error 5120.

In the additional information of this error it tells me that an exception occurred while executing a Transact-SQL statement or batch.

Later indicating that it was unable to open the physical file to the database in question due to an “Operating system error 5”

Have fun searching for that *hint* you will not find any of the top 3 links taking you to any Microsoft Site; that’s for sure.  {{annoyed}}

Other errors indicated where insufficient memory or disk space; thanks again {{annoyed}} for sending me  down the wrong path.  I have plenty of memory, and disk space.

The last one was that I did not have permissions to the files. Seriously, I do have permissions. In most cases someone who’s doing this work does in the first place

So I found out what the issue was in my case. Here is a screenshot:

Yup! The files were set to read-only. Once this attribute was removed I was able to change my database status from read-only to read-write.

I hope this post helps you if in similar situation.

– Jermal

Exchange 2013: Migrating Mailboxes via PowerShell

Exchange 2013 has new and impressive administration center that allows you to handle tasks such as mailbox moves. I prefer using the Exchange Management Shell for such a task.

Using the following command you can move all mailboxes within a database to your new mailbox database: Get-Mailbox -Database “Source-Database” | New-MoveRequest -TargetDatabase “Destination-Database”

To get info on the migration progress you can use the following command syntax: Get-MoveRequestStatistics -MoveRequestQueue “Destination-Database”

Once this migration has completed you can check if anything exists in the source database with the following: Get-MailboxDatabase -Identity “Source-Database” | Get-Mailbox

restore sql server database from mdf file

  1. First Open SQL Server Management Studio (SSMS). You may need to run as Administrator
  2. Right click the Databases folder and select attach from the menu.
  3. Click Add and select the mdf file. Click Ok, and then Click Ok again. You will get an error at this time because SSMS could not find the corresponding ldf file.
  4. Select the ldf file entry and Click Remove and then Click OK
  5. And that’s all folks

 

SQL Server Database Error: 661

One of my customers had an issue where they failed to open a connection to a particular database they had been testing. The error read: ‘the database e:somepathsomefolderjermsmit.mdf’ cannot be opened because it is version 611. The server supports version 655 and earlier. A downgrade path is not supported.

This issue is caused because you are not permitted to use a database from a later release on an earlier system. i.e they are not backwards compatible

Problem: Databases created under a newer version of SQL Server are not compatible with previous versions of SQL Server

Solution(s) that I am aware of in this case:

  • You need to either upgrade your SQL Server instance to the same version as the database or one newer
  • Or copy out the data in that database into an earlier version (using the data migration wizard perhaps)

If you need to know the version of your source and destination databases use the following query:

SELECT @@VERSION

The destination should be the same level or greater in in version.

Best of luck to ya

Exchange 2007 – Determine Whitespace

Today, I was ‘pinged’ with a question regarding a post I made some time ago regarding white space in Exchange databases. This post was referring to Exchange 2010. This has prompted me to do a quick update on finding out this info in Exchange 2007.

Here are my methods to gather this info:

  • Log into the Exchange 2007 Server
  • In the Exchange MMC Locate the Server and Mailbox Store of your choosing and dismount it (not necessary)
  • Then in the command prompt ran the following:  eseutil /ms databasename.edb (you may need to specify the full paths to the database file. Depending on the size of your database this may take some time.

Another way –

  • Open up your Exchange 2007 server’s even log viewer and look under Applications,
  • then filter for the even 1211 and sort by data/time and you should see the sour database name and in the event message you will notice something such as:  The database “Storage GroupDatabase” has 3 megabytes of free space after online defragmentation has terminated.

I hope this helps

Simple Exchange 2010 Database White Space Report

I was looking at some of my database on Exchange that seemed to be very large in size so first thought was that an offline defrag may be needed, but before I reach that point I wanted to know how much ‘slack’ or white space existed in each of my Exchange databases.

This was done by using the following command syntax in the Exchange Management Shell:

To export this into a CSV format the following can also be done, so that you can give to any management members for review of your findings:

Next, I may find a way to setup this to email a weekly report…

SQL Server backup in multiple parts

“It’s so logical and so simple. Fat is the backup fuel system. The role it plays in the body is that when there’s no carbohydrate around, fat will become the primary energy fuel. That’s pretty well known.” – Robert Atkins

Recently I have been working with my dB Administrator to get some DR backups to our offsite location. Simple task made difficult with a few challenges: Size of the database, Bandwidth to transfer to remote site, and method of transfer. We got past part of the size issues by compressing the SQL database backups, but we still had issues getting the files to the remote site in time. So we switched from using Microsoft DFSR to using cygwin and Rsync. However there was another issue at play; We could never seem to get the full backup there in time.

Out bottle neck at this point was the available bandwidth needed to transfer and the files. The transfer would break and well it needed to do a checksum on the file to resume. At 200GB into it all this process to a considerable amount of time to only again fail.

That is when I got creative and suggested to use SQL to span/split the backup into multiple parts so that in the event the transfer would break and resume it only had to do some from just a single part of the total sum of data. You know what?  It works. It’s been 2 weeks now and our backups reach the remote site.

And here is what you can do the split up your backups:

And now the backup is split into equal parts of the original backup file size. In my production environment we split our compressed database into 64 parts giving us about 4GB per file.

I hope this helps you,

– Jermal

ESEUtil to Defrag an Exchange 2010 Mailbox Database

A garden is a complex of aesthetic and plastic intentions; and the plant is, to a landscape artist, not only a plant – rare, unusual, ordinary or doomed to disappearance – but it is also a color, a shape, a volume or an arabesque in itself. – Roberto Burle Marx

 

 

How To use ESEUtil to Defrag an Exchange 2010 Mailbox Database

We start this process by first opening the Exchange Management Shell and navigate to the folder containing the database file.

We then dismount the database

[PS] E:MailboxAB>Dismount-Database <name of database>

We now run ESEUtil to defrag the file using the /d switch to defrag

[PS] E:MailboxAB>eseutil.exe /d .<database name>

When completed we mount the database again.

[PS] E:MailboxAB>Mount-Database <database name>

Please see the following screen cap for refrence

And as always be sure that you have a backup that you can use for recovery if something goes wrong during the defrag.

MapiException: TooManyMountedDatabases when mounting database

I was hit with a nice error when attempting to mount several Exchange databases on my new Exchange 2010 SP2 server that I had setup in a lab envionment for production testing.

The error:

——————————————————–Microsoft Exchange Error——————————————————–
Failed to mount database ‘IJ’.IJFailedError:Couldn’t mount the database that you specified. Specified database: IJ; Error code: An Active Manager operation failed. Error The database action failed. Error: Operation failed with message: MapiExceptionTooManyMountedDatabases: Unable to mount database. (hr=0x8004060e, ec=-2147219954). [Database: IJ, Server: EXCHANGE.JERMSMIT.LOCAL].An Active Manager operation failed. Error The database action failed. Error: Operation failed with message: MapiExceptionTooManyMountedDatabases: Unable to mount database. (hr=0x8004060e, ec=-2147219954). [Database: IJ, Server: EXCHANGE.JERMSMIT.LOCAL]An Active Manager operation failed. Error Operation failed with message: MapiExceptionTooManyMountedDatabases: Unable to mount database. (hr=0x8004060e, ec=-2147219954). [Server: EXCHANGE.JERMSMIT.LOCAL]MapiExceptionTooManyMountedDatabases: Unable to mount database. (hr=0x8004060e, ec=-2147219954)
——————————————————–OK——————————————————–

The cause of this issue is because Unlicensed (trial) of Exchange 2010 servers are limited to 5 databases. In the Application event log I noticed the following message:

Event ID: 9591 – Exceeded the max number of 5 MDBs on this server.

It seems I have exceeded the number of databases that can be mounted during my trail. I will now apply a MSDN license and see how things work out.