Exchange server stores all its user mailbox data in EDB database. Any kind of corruption to the EDB database can lead the Exchange user into trouble. He will face several problems while accessing his mailbox data, several error messages will be prompted on the screen. The database corruption hinders the daily Email operations and work flow, as well as other exchange services fail to run properly or refuses even to start.
If you are facing troubles while starting the Exchange services then, the first step you must do is restoring the data from the recent backup. But if you don’t have any recent backup then you require repairing your corrupt Exchange database.
How to resolve the problems occurring while running Exchange services?
If you are facing problems while running Exchange services then the most probable reason is Exchange corruption.
- First Exit all running Exchange services
- Delete and restore the corrupt database
The corruption can occur in any of the three files dir.edb, priv.edb and pub.edb.
Corruption in the dir.edb: Severe damage to the dir.edb file will make you lose the information such as: mailbox names, connectors, and other servers within the site.
Corruption in the priv.edb file: If the corruption occurs in the priv.edb file then the user is going to lose all the user mailbox data (emails and other mail items) that was in private information store.
Corruption in the pub.edb file: The pub.edb file stores the information related to public folder. If corruption occurs in the pub.edb file, this information becomes in accessible.
If you have replicate copies of your public folders on other servers (within the same site or within the organization) then you must rehome the public folders to a functional server. Otherwise the replicated copies will be lost after rebuilding the corrupt server. You can later on replicate these folders back to the original server
Location of Exchange EDB files:
The information store files (priv.edb and pub.edb) are located in the MDB directory. Directory service database (Dir.edb file) is located in the DSADATA folder.
Location of dir.edb: \EXCHSRVR\DSADATA.
Location of priv.edb and pub.edb: \EXCHSRVR\MDB directory
Once you have identified the corrupt file, delete and replace it from backup.
Follow the given steps to replace a corrupt database:
- Initiate the System Attendant service. Delete and Replace the corrupt dir.edb file. After that, delete all the directory service log files.
- After replacing the dir.edb file with a good copy the next step is to start the directory service
- Open the Exchange Administrator. Here all the information within the dir.edb file (connectors, mailboxes) will be displayed. If you are using the dir.edb file from the Exchange CD instead of the original dir.edb file, then no such information is shown there.
- To fill up the directory information you can import the information from the CSV files
- Initiate the Exchange information store and other related services.
If it isn’t starting then the information store files priv.edb or pub.edb file are corrupt and need to be replaced.
- First delete all the information store log files and then replace the corrupt priv.edb or pub.edb file.
- Go to \EXCHSRVR\BIN directory
- Execute the command: isinteg -patch.
- If you replaced the pub.edb file, rehome the replicated public folders after pub.edb file replacement.
- If you have replaced the directory service database and don’t have a CSV file for rebuilding the database then you need to regenerate the directory service.
How to regenerate your directory services?
Before you regenerate the directory service, I must mention that the technique I am about to describe is dangerous.
Some pre-requisites before you regenerate your directory services:
- First bring your all Exchange servers online.
- Check that all Exchange servers in the organization are functional.
- Also ensure that the connectors between them are functional and the servers are able to commune and collaborate with each other.
In case of absence of collaboration between all servers, after regenerate your directory services, the damaged servers takes possession of all their public folders and after rebuilding the directory you cannot return the public folders to their original server.
DS/IS consistency check:
To know information about the damaged database server, you need to apply the DS/IS consistency check technique. This will let you know the details about the corruption in information store and the directory service databases. This information proves to be helpful while you are rebuilding the Exchange database.
Follow the given steps to perform DS/IS consistency check:
- Start Exchange Administrator
- Go to Organization|Site|Servers|Server and choose the damaged server
- Open the server's properties sheet by choosing File|Properties
- Go to the Advanced tab > Consistency Adjuster button.
- Now, you can adjust the database's consistency in the windows that got opened.
- Set the desired options. Choose the option “Synchronize with The Directory”. For some mailboxes there will be no option for selecting ‘Directory Entry’, for those mailboxes you need to create New Directory Entries
- Click OK. A warning message will prompt then. Click OK to begin the consistency check
Note: After DS/IS consistency check the user will be able to restore the directory service database, the mailboxes, site connectors or directory replication connectors are restored. But some of the information cannot be restored such as: information about the individual mailboxes, information such as the primary Windows NT account associated with the mailbox, and other mailbox user attributes. So, you must have a CSV file containing all this useful data. So that later on you can fill the fields.
Follow the given steps to create directory service database:
CSV file: A CSV file a vital role while rebuilding the Exchange directory structure. You can save the necessary fields (the basic account information, the extended attributes) in CSV file that can be later on imported and thus, eliminates the need of manually filling the information.
You will just require the header.csv file to create another csv file. The header.csv stores the schema of the dir.edb database.
Follow the given steps to create the csv file:
- Make a copy of the header file (header.csv). Make another copy of the header.csv to a file called phone.csv.
- Go to Exchange Administrator > Tools|Directory Export.
- This will open the Directory Export dialog box. From there check the checkboxes corresponding to Mailbox, Custom Recipients, Distribution Lists, and Include Hidden Objects.
- Open the Home Server drop-down list and select your server name from the given list.
- Click ‘Export File’ and select the location A:\phone.csv.
- Click Export. This will begin the export process and a CSV file will be created.
- You should create a CSV file for storing the directory structure. So that after rebuilding you can restore the information from the CSV file.
Generally, two CSV files are required, a basic CSV file for storing the basic account information and another full-featured CSV file to store the extended attributes. You can create another CSV file by following the same steps given below. In this case choose A:\data.csv for the Export File.
Follow the given steps to restore the directory service using CSV files:
- Go to Exchange Administrator > Tools|Directory Import. This will open the ‘Directory Import dialog box’.
- Select the Exchange Server name and the Import File location (A:\data.csv).
- Click Import.
- All the information stored within data.csv will be imported to the directory service database.
- Now import all the data from the phone.csv file
You can have to face error messages if some of the information in CSV file is trying to overwrite the information already present in the directory services database. In such case check the error message to get the column name that is causing the issue. Delete that column from phone.csv file and then re try importing the phone.csv file data.
Once you are done with the import process, you can use the directory services as before.