Showing posts with label DataBase. Show all posts
Showing posts with label DataBase. Show all posts

Monday, December 22, 2008

Offline defrag & Exchange maintenance

Should offline defrag be considered as one of the scheduled maintenance task for Exchange administrators? The short answer is going to be "No". The simple reason behind this, taking Exchange offline will cause "Outage" and if there is no space gain (white space, 30 percent usable space) there is no point of performing offline defragmentation at any cost.

Let me state this up front, those of you who are running enterprise version of Exchange should never perform offline defrag and cause outage, you need to create empty database and move user mailboxes

(In the night& off business hours) onto it and delete the old one contains white space. (Assuming you does have at least, one mail store available to achieve this goal.)

The process behind running offline defrags is that, exchange wont takes existing database and remove the white pages out the database and makes it ready to use. It Instead it copies used pages from old database and creates new database. When copy pages finishes it re-point the logs to the new database and it assigns nee signature to it.

How do we know if we need to perform offline defragmentation, the Exchange server's application logs "1221" will tell you how much white space (unusable)

Here is great article goes deep into 1221

http://blogs.msdn.com/jeremyk/archive/2004/04/09/110553.aspx

Here is MS team blog goes deep into

http://msexchangeteam.com/archive/2004/07/08/177574.aspx

Best,

Oz ozugurlu MVP (Exchange)

MCITP (EMA) , MCITP (EA ) MCITP(SA),

MCSE (M+,S+) MCDST, Security+, Server +,Project+

Blog: http://www.smtp25.blogspot.com/

Friday, July 4, 2008

Unable to read the header of logfile




If you do have a good backup information store or brick level read the section mentions, restore with good backup"

Problem:

Exchange 2000 Information store is not mounting, all exchange services seems to be running however, when attempting to mount the databases, and exchange is reporting some generic error.

Troubleshooting;

Most of the problems I have seen similar to this one are cause by human factor. Running exchange on very old crapy servers and not performing hardware refresh is the result of huge time consuming when it comes to database repair.

The application log on the exchange server is one of the most important places for exchange administrator to go and gather exchange related information, because the exchange specific events will be logged in there.

Here is one of the errors on the problem exchange server


Event Type: Error

Event Source: ESE

Event Category: Logging/Recovery

Event ID: 412

Date: 7/3/2008

Time: 1:40:37 PM

User: N/A

Computer: SMTPBRMDBALEX2

Description:

Information Store (4948) e53f288d-df1b-47ba-9c3b-901e530848a5: Unable to read the header of logfile E:\exchsrvr\mdbdata\E003C9F3.log. Error -530.

For more information, click

The event log and the error description are leading me to corruption on the exchange database and we are deciding to repair the database.Those of you who has experience fixing the database problem with exchange will remember the tool called "ESEUTIL" and normally can be found in the directory, where exchange binaries are installed in the folder called "BIN"

  • Open CMD
  • Navigate to this directory ( Use windows GUI, to make sure of the exchange installation directory)
  • ESEUTIL /? ( if you want to know the available switches)
  • ESEUTIL /P (Repairs a corrupt offline database by discarding any pages that cannot be fixed)
  • C:\Program Files\Exchsrvr\BIN>eseutil -p E:\exchsrvr\mdbdata\priv1.stm ( this is what I used)
  • Now depending upon your server hardware resources, the ESEUTIL will take time to complete

PS: Do not get frustrated with ESEUTIL, the process will take as much as it wants to take, there is not much to do but wait with patience, go get cup of coffee.

Here are the nice guidelines to have a side.

  • You run Eseutil /P first.
  • Then you run Eseutil /D.
  • Then run Isinteg -fix -test alltests.
  • Plan on moving the mailboxes from the repaired database to a newly created database. Never trust a repaired database for long term use; will likely cause issues further down the road.

For Isinteg

  • "Isinteg -s (servername) -fix -test alltests"

IF you encounter problems here some more to try

  • Stop all exchange services.
  • Delete all *.log files
  • Move the "E00.log" and "E00.chk" files to another folder.
  • Mount the Information Stores.

Restore with good backup

If you do have your information store level backup and your log files go ahead and restore it from your backup and save the day. If you do only have brick level backup you are still good. (VERITAS or similar products).

Go to ESM, and find out the exchange databases locations, and rename all databases to "old-Priv1.edb" "old-Priv1.stm" and so on. Now mount the databases, exchange will warn you and it will say, if you force me to do this I am going to create brand new mail databases, and everyone will get brand new mailbox, meaning no previous mail data. It is fine go ahead and click okay. Now make sure all mailboxes are accessible and exchange is happy. Go to your backup software and perform brick level restore. This will bring all mail data to last good backup time.

Why we want to do it instead of attempting to repair the database? The Eseutil /P, might consume enormous amount of time, in some situations. Especially if the server you will be running Eseutil from is weak on hardware CPU and memory resources (Crapy server). I have witnessed in some cases the /P took a day to complete.

Also remember Microsoft recommends not keeping a repaired database around too long since it is tent to get corrupted again


Oz Ozugurlu

MVP (Exchange)

MCITP (EMA), MCITP (SA)

MCSE 2003, M+, S+, MCDST

Security+, Project +, Server +

Blog: http://www.smtp25.blogspot.com

Is it possible to defragment a mounted information store?



After running ESEUTIL /P on one of the exchange servers we maintain, I am quickly realizing this will take a long time to complete, and of course I am hanging out at the "MSExchange.org" exchange forums. Excellent place to hang out, so much to learn there. (- :

Here is a great question being asked by one of our member and I wanted to blog this here to share the point with all my friends.

Question

Is it possible to defragment a mounted information store?
What would be the risk? What are the benefits if any?

Answer:

This is a good question, and exchange _Geek provided you excellent MS link explaining the difference offline and online defrag. Most offend I get to asked same question , and therefore, I wanted to make sure when you read the MS article provided here, you will be clearly understand the difference offline and online defrag when it comes to exchange databases.

"During the offline defragmentation process, Eseutil.exe creates a new database. It copies only the in-use database records to the new database file, which results in a new compact database file. An offline defragmentation is the only method that reduces the physical file size of the databases"

The way it works as you see, exchange will create a new "EMTY" database and start copying the data from original database into this newly created DB, and at the end it will delete the original database which may contain white space (Space cannot be used by the database) and now you have a brad new DB which has only contains mail data.

It looks like getting when your car tires getting real dirty and old you ordering the new ones, but you are keeping your rims with the new tires. You still want to drive the car, when the work is being done (-:, no you cannot , you need to sit and wait, until the new tires put on the car and mechanic makes sure it is safe to drive

Enjoy your coffee until then (this happens when you use "ESEUTIL" with any of the switches)

--oz

Regards,

Oz Ozugurlu

MVP (Exchange)

MCITP (EMA), MCITP (SA)

MCSE 2003, M+, S+, MCDST

Security+, Project +, Server +

Blog: http://www.smtp25.blogspot.com/

Thursday, December 20, 2007

An internal processing error has occurred. Id no c1041427



Exchange 2000 mail store would not mount and generate the following errors. After looking around I discovered two steps approach to remedy the dilemma and I wanted to post here for those who might need it.

Problem:

Information store won't mount. The mail service is interrupted on exchange 2000. Application log shows MSExchangeIS 9564.

Solution:

The first thing to check is to make sure the AV software is not causing the issue. Open registry editor on the offended exchange server and drill down to following registry key

  • HKLM
  • System
  • CurrentControlSet
  • Services
  • MSExchangeIS
  • VirusScan
  • Set enabled to 0 to disable the AV
  • Exit from registery (save)

Restart the information store service and mount the mail stores.

If this won't help you, keep reading, there might be corruption on the either databases or the log files.

What Is a "Shadowed Header?"

Exchange Server database, checkpoint, and log files begin with a 4-kilobyte (KB) header section. The header contains important identification and configuration information about the file. Headers can be viewed with the Eseutil utility by using the /MH (database file), /ML (transaction log file), or /MK (checkpoint file) options.

Now it is time to perform some clean up

  • Stop all exchange services.
  • Configure your Anti-Virus program according to article KB245822.
  • Save your current log files that are usually located on x:\Program Files\exchsrvr\MDBDATA\Exxxxxxx.Log to a temporary folder.
  • Delete all *.log files in the x:\Program Files\exchsrvr\MDBDATA.
  • Check that the folder "(x:\Program Files\exchsrvr\MDBDATA)" only contains the following files:
  • e00.chk
  • res1.log
  • res2.log
  • If not, move all extra files to a temporary folder.( including e00.chk, res1.log, res2.log )
  • Start all Exchange Services and mount the Information Store service.

Best regards,

Oz Ozugurlu

"How useful was this article? Want to see a tip not listed? Please leave a comment."


Wednesday, November 28, 2007

PRIV1.HTML file in Exchange 2000



The question came today from one of my peer at work was asking a question about priv1.html file, when we are performing defrag on exchange 2000 databases. What is this file about I never know exchange would use HTML file as database. My peer knew the priv1.edb file and what it does very well; nevertheless, the HTML file seemed to him a bit abnormal.

Summary:

priv1.edb, but it also has an escort file called priv1.stm. (priv1.html), for some weird reason windows reads this file as HTML file (go figure), which confuses some of the exchange administrators.

  • Priv1.edb files contain Rich Text Formatted (RTF) content messages.
  • A priv1.stm file contains non-RTF messages.

The priv1.edb holds message data from messages that are in native MAPI format, the STM file holds content for internet formatted messages. Both are required to get the database to function correctly.

The 16-GB size limit for the Exchange private mailbox store database and the 16-GB size limit for the Exchange public mailbox store database is the sum of the size of both the Priv.edb and the Priv.stm files.


When you put a limit on a mailbox,

  • You only limit the storage in the Priv.edb file.
  • You do not limit the storage in the Priv.stm file.

For example, a mailbox may appear to use only 250 MB of space in Exchange System Manager. However, the total space that the mailbox uses may be 450 MB. This difference occurs because the 200 MB of space that the Priv.stm file uses does not appear in Exchange System Manager.


 

When you do a defrag of the edb, the stm file is automatically also defragged.

Best

Oz Ozugurlu

Tuesday, November 27, 2007

Event ID logs 445; Exchange databases reached the 16 GIG limits



Problem:

Exchange server 2000 is not accessible. Event ID logs 445; Exchange databases reached the 16 GIG limits. This will cause interruption on the mail flow.

Event Type: Warning

Event Source: ESE

Event Category: Space Management

Event ID: 445

Date: 11/27/2007

Time: 3:51:57 PM

User: N/A

Computer: CHALBIRFS0

Description:

Information Store (5640) The database E:\Exchsrvr\mdbdata\priv1.edb has reached its maximum size of 16383 MB. If the database cannot be restarted, an offline defragmentation may be performed to reduce its size.


Solution:

I would love to say here, upgrade to exchange 2007 if all it is possible, at least to Exchange 2003 to get the advantage of 75Gig limit in DB. In some cases, decision makers (Managers) are very none sense, to be honest. I have seen million of times so far same scenario. For technical people it is very frustrating to deal with manager who has no clue about current technology. Remember this is the way it is and we have to leave with this. Follow the step below

ESEUTIL /D is the immediate action we have to take in this particular issue. We bumped the DB size to 17GIG with following registry hack.

  • Click Start, click Run, and then type regedit.exe. Locate the following key in the registry: HKEY_LOCAL_MACHINE
  • SYSTEM
  • CurrentControlSet
  • Services
  • MSExchangeIS
  • Private

Right click, new Dword Value, and name it "Temporary DB Size Limit" and enter value 1.Restart information store service for changes to take effect. Requires Service Pack 3 for Exchange 2000 and the following registry entry:

The C drive was out of space therefore we need to perform the Defrag to E drive, where we had plenty of free space

C:\>"C:\Program Files\Exchsrvr\BIN\ESEUTIL.EXE" -d "E:\Program Files\Exchsrvr\MD BData\priv1.edb" /te:\temp.edb

This was the Temp file is going to be created on the E Drive. Many o f you know if already the story behind the temp database. Exchange will create an empty database in this example is the Temp database and will copy good mail data into this DB. When exchange is done, it will tell you "Hey I have created brad new database, go ahead delete the original one and use this one instead."

Determine White Space Event id 1221. If it is too late and exchange databases are dismounted due to space problem, use ESEUTIL /MS determine the white space.

Space Dump with ESEUTIL /MS to determine the space. Also ensure that you have 110% free disk space associated with the Exchange database size.

You can check the integrity of your Exchange database with ESEUTIL /G

After running ESEUTIL, check the log file called "integ.raw "to see the results.

Let's talk about ISINTEG in general (Isinteg -fix -test alltests)

ISINTEG is the only repair utility that understands the Exchange database as an Exchange database (taken from MS support)

  • Isinteg understands the relationships between those tables and records that turn them into folders and messages.
  • At the end of an Isinteg fix run, you will likely see hundreds to thousands of warnings, no worries, but we need to worry if there is even one error, and rerun the Isinteg until there is no more errors are being reported.
  • Before you do this make sure,
  • The information store service is running
  • The mailbox store is dismounted
  • Isinteg -ServerName –Fix –Test alltests

Here are the final Steps:

  • Run ESEUTIL /MS (determine the space, you won't be blind)
  • Run Eseutil /P ( Hard Repair)
  • Run Eseutil /D. ( Defrag)
  • RUN Isinteg -fix -test alltests (fixes the logical problems)

    Example: isinteg -pri -fix -test alltests


Best,

Oz ozugurlu




Wednesday, October 17, 2007

ESEUTIL Redirecting Temp Databases onto another Drive



Going through ESEUTIL, here are some recommendations.

Make sure you have good backup (Basic rule, always make sure you got a working good backup)

  • Make sure you have good backup ( Basic rule, always make sure you got a working good backup)
  • Make sure you have enough space to perform the ESEUTIL (110%)
  • Be Patient, after running ESEUTIL Defragmenting a database requires free disk space equal to 110 percent of the size of the database that you want to process. To determine the actual space required, follow these steps
  • Make sure that the information store service is not running.
  • At a command prompt, run the following command:
  • ESEUTIL /ms "database.edb"
  • Calculate the free space by multiplying the number of free pages by 4 KB.
  • Subtract the figure that you obtained in step 3 from the physical size of the database.
  • The figure that you obtained in step 4 represents the data in the database. Multiply this figure by 110 %. The resulting figure that you obtain is the space that you need to have available to defragment the database.
  • Divide the figure that you obtained in step 3 by 9 GB per hour. The figure that you obtain is the approximate time that it will take to defragment the database.

After running ESEUTIL and waiting couple hours, the ESEUTIL errors out with following warning, obviously I did not realize the temp files were defaulted to the C drive and C drive ran out space.E drive had over 100 Gig, there I needed to point the Temp database. I used same switch with additional switch as follows /te: \Temp.edb

C:\>"C:\Program Files\Exchsrvr\BIN\ESEUTIL.EXE" -d "E:\Program Files\Exchsrvr\MD

BData\priv1.edb" /te:\temp.edb


 

  • Defragmentation Status (% complete)


 

0 10 20 30 40 50 60 70 80 90 100

|----|----|----|----|----|----|----|----|----|----|


 

Operation terminated with error -1808 (JET_errDiskFull, No space left on disk) after 10096.297 seconds.


 

C:\>"C:\Program Files\Exchsrvr\BIN\ESEUTIL.EXE" -d "E:\Program Files\Exchsrvr\MD

BData\priv1.edb" /te:\temp.edb


 

Microsoft(R) Exchange Server(TM) Database Utilities

Version 6.0

Copyright (C) Microsoft Corporation 1991-2000. All Rights Reserved.


 

Initiating DEFRAGMENTATION mode...

Database: E:\Program Files\Exchsrvr\MDBData\priv1.edb

Streaming File: E:\Program Files\Exchsrvr\MDBData\priv1.STM

Temp. Database: e:\temp.edb

Temp. Streaming File: e:\temp.STM


 

Defragmentation Status (% complete)


 

0 10 20 30 40 50 60 70 80 90 100

|----|----|----|----|----|----|----|----|----|----|


 

Best,

Oz Ozugurlu

Friday, July 13, 2007

What is really CheckPoint.chk?




Before changes are actually made to an Exchange database file, Exchange writes the changes to a transaction log file. After a change has been safely logged, it can then be written to the database file. It is common for changes to become available to end users just after the changes have been secured to the transaction log, but before they have been written to the database file.

  • Exchange employs a sophisticated internal memory management system that is tuned for high performance. Physically writing out changes to the database file is a low-priority task during normal operation.
  • Exchange can efficiently manage caching of more than a gigabyte of database pages. This cache includes pages read from the database to fulfill client requests, as well as changed pages that will eventually be written back to the database file.
  • If a database suddenly stops, cached changes are not lost just because the memory cache was destroyed. On restart of the database, Exchange scans the log files, and reconstructs and applies any changes not yet written to the database file. This process is called replaying log files. The database is structured so that Exchange can determine whether any operation in any log file has already been applied to the database, needs to be applied to the database, or does not belong to the database.
  • Rather than write all log information to a single large file, Exchange uses a series of log files, each exactly five megabytes in size. When a log file is full, Exchange closes it and renames it with a sequence number.
  • The first log filled ends with the name Enn00001.log. The nn refers to a two-digit number known as the base name or log prefix
  • An Exchange Enterprise 2003 server can have up to four storage groups, and the log files for each storage group are distinguished by file names with numbered prefixes (for example, E00, E01, E02, or E03).
  • The log file currently open for a storage group is simply named Enn.log—it does not have a sequence number until it has been filled and closed
  • The checkpoint file (Enn.chk) tracks how far Exchange has progressed in writing logged information to the database files. Typically, on a busy database, the checkpoint lags three or four log files behind the currently open log.
  • There is a checkpoint file for each log stream and a separate log stream for each storage group. Within a single storage group, all the databases share a single log stream. Thus, a single log file often contains operations for multiple databases
  • The checkpoint wraps three or four log files behind the currently open log, based on this information if you think the log file size is limited to 5meg, Exchange 2003 will write the data on to mail store when it reached 20Meg.


 

Do not forget the SG (storage Group) has all the logs for all mail stores.Log files are numbered hexadecimally, so the log file after E0000009.log is E000000A.log, not E000010.log. You can convert log file sequence numbers to their decimal values using the Windows Calc.exe application in Scientific mode. To do this, run Calc, and then on the View menu, click Scientific.

You can also see the decimal sequence number for a given log file by examining its header with Eseutil.exe. The first 4-KB page of each log file contains header information that describes and identifies the log file and the databases it belongs to. The command Eseutil /ml [log filename] displays a header like the following:


 

Base name: e00

Log file: e00.log

lGeneration: 11 (0xB)

Checkpoint: (0xB,7DC,6F)

creation time: 12/30/2002 05:07:12

prev gen time: 12/27/2002 13:38:14

Format LGVersion: (7.3704.5)

Engine LGVersion: (7.3704.5)


 

Now all you need to do drill down to Bin directory from DOS, and open the logs directory from windows explorer. Place both windows side by side just like I did here.

Now on the Command window type "eseutil /ml"



E:\Program Files\Exchsrvr\bin>eseutil /ml

Drag one of the log file from left window into Command prompt, and hit enter

Best

Oz ozugurlu