Current transaction log RRS feed

  • Question

  • Is there a way to tell what's the current transaction log (e.g E00.log or E01.log...etc) of an offline database by using eseutil without looking at the transaction logs folder.
    Tuesday, January 10, 2012 2:08 AM

All replies

  • What are you looking for? Are you looking for the last committed transaction log?  If you are, use 'eseutil /mh'.  However, you need to dismount the database to run the command.  When you run it, the results will look like this.  Look for 'Last Consistent'.  In my case it was this line:

    Last Consistent: (0xB7,8,93)  01/09/2012 22:20:01

    So the file is E00000B7.log that was the last committed log.   

    Let me know if this helps.


    C:\Program Files\Microsoft\Exchange Server\V14\Mailbox\Mailbox Database0766868768\Mailbox Database 0766868768.edb

    [PS] C:\>eseutil /mh "C:\Program Files\Microsoft\Exchange Server\V14\Mailbox\Mailbox Database 0766868768\Mailbox Databas
    e 0766868768.edb"

    Extensible Storage Engine Utilities for Microsoft(R) Exchange Server
    Version 14.02
    Copyright (C) Microsoft Corporation. All Rights Reserved.

    Initiating FILE DUMP mode...
             Database: C:\Program Files\Microsoft\Exchange Server\V14\Mailbox\Mailbox Database 0766868768\Mailbox Database 0

    Checksum Information:
    Expected Checksum: 0x0818d10d
      Actual Checksum: 0x0818d10d

            File Type: Database
             Checksum: 0x818d10d
       Format ulMagic: 0x89abcdef
       Engine ulMagic: 0x89abcdef
     Format ulVersion: 0x620,17
     Engine ulVersion: 0x620,17
    Created ulVersion: 0x620,17
         DB Signature: Create time:12/07/2011 02:23:35 Rand:14463981 Computer:
             cbDbPage: 32768
               dbtime: 54260 (0xd3f4)
                State: Clean Shutdown
         Log Required: 0-0 (0x0-0x0)
        Log Committed: 0-0 (0x0-0x0)
       Log Recovering: 0 (0x0)
      GenMax Creation: 00/00/1900 00:00:00
             Shadowed: Yes
           Last Objid: 424
         Scrub Dbtime: 0 (0x0)
           Scrub Date: 00/00/1900 00:00:00
         Repair Count: 0
          Repair Date: 00/00/1900 00:00:00
     Old Repair Count: 0
      Last Consistent: (0xB7,8,93)  01/09/2012 22:20:01
          Last Attach: (0x9A,9,86)  01/09/2012 10:37:24
          Last Detach: (0xB7,8,93)  01/09/2012 22:20:01
                 Dbid: 1
        Log Signature: Create time:12/07/2011 02:23:21 Rand:14447355 Computer:
           OS Version: (6.0.6002 SP 2 NLS ffffffff.ffffffff)

    Previous Full Backup:
            Log Gen: 0-0 (0x0-0x0)
               Mark: (0x0,0,0)
               Mark: 00/00/1900 00:00:00

    Previous Incremental Backup:
            Log Gen: 0-0 (0x0-0x0)
               Mark: (0x0,0,0)
               Mark: 00/00/1900 00:00:00

    Previous Copy Backup:
            Log Gen: 0-0 (0x0-0x0)
               Mark: (0x0,0,0)
               Mark: 00/00/1900 00:00:00

    Previous Differential Backup:
            Log Gen: 0-0 (0x0-0x0)
               Mark: (0x0,0,0)
               Mark: 00/00/1900 00:00:00

    Current Full Backup:
            Log Gen: 0-0 (0x0-0x0)
               Mark: (0x0,0,0)
               Mark: 00/00/1900 00:00:00

    Current Shadow copy backup:
            Log Gen: 0-0 (0x0-0x0)
               Mark: (0x0,0,0)
               Mark: 00/00/1900 00:00:00

         cpgUpgrade55Format: 0
        cpgUpgradeFreePages: 0
    cpgUpgradeSpaceMapPages: 0

           ECC Fix Success Count: none
       Old ECC Fix Success Count: none
             ECC Fix Error Count: none
         Old ECC Fix Error Count: none
        Bad Checksum Error Count: none
    Old bad Checksum Error Count: none

      Last checksum finish Date: 00/00/1900 00:00:00
    Current checksum start Date: 00/00/1900 00:00:00
          Current checksum page: 0

    Operation completed successfully in 0.485 seconds.

    Tuesday, January 10, 2012 4:27 AM
  • Hi,
    Maybe not what you are looking for, but If the database is attached to Exchange 2010, you can run Get-MailboxDatabase | ft Name,logfileprefix
    Martina Miskovic - http://www.nic2012.com/
    Tuesday, January 10, 2012 5:58 AM
  • Hi xmis,

    please try below shell command to check current log path of the database.


    Get-MailboxDatabase -Identity Server01\StorageGroup01\MailboxDatabase01 -Status | format-list

    • Proposed as answer by Sachin Ps Tuesday, January 10, 2012 2:24 PM
    Tuesday, January 10, 2012 2:23 PM
  • Sorry all. I wasn't clear enough. Basically, we have an exchange recovery product that restores a time mark of a specific database volume and transaction logs and then which is always in an inconsistent state. The database is usually in a dirty shutdown state so I am in the process of automating the whole restore procedure for our help desk. I am at the step of the repair mode:

    eseutil /r E00 /l logpath  /d dbfilepath.

    Since we have several database, the current log E00 can be E01, E02,E03...E0X,etc. I need to get the EXX for each database so I can use that as a variable in my script hence my question about how to get which E00 for a specific database. eseutil /mh may give me that but I have to convert some Hex numbers which is a pain.


    Tuesday, January 10, 2012 8:25 PM
  • If you run the 'get-mailboxdatabase |fl' command you can see all the variables for the database.  The one you want is LogFilePrefix.  So juist run:

       get-mailboxserver | get-mailboxdatabase |ft servername,name,logfileprefix

    That will give you the log prefix for all your databases.  Thanks.

    Tuesday, January 10, 2012 9:50 PM
  • JAUCG,


    All we have is the database restore in the form of edb file and TR logs and therefore there is no edb yet mounted untill we bring it into a clean state hence the dilemma. We can not run get-mailboxserver | get-mailboxdatabase |ft servername,name,logfileprefix on a db that is not created yet.

    Wednesday, January 11, 2012 2:50 AM
  • Completely get what you want.   So this database is not connected to anythin yet, its just fresh restored from tape as a file along with its relevant logs.

    If you are restoring a production database, you should know which E0x belongs to a database.  You can get that from the command that I gave you from the last post if you run it against your production database. 

    Then if you run the eseutil /mh you can find out which file is the last good file. As for converting hex, there are functions within Powershell to do this and you can find them with google if needed.

    At the end of all of this, what is your intent with the scripting?  Is it to restore the database, find out which is the good log file, then delete all the bad ones and remount?  If so, have you considered doing eseutil /r to do a soft recovery?  If that does not work, then you usually have to do a eseutil /p which is a hard recovery and not a solution I like to use unless nothing else works.


    Wednesday, January 11, 2012 3:26 AM
  • Thanks JAUCG,


    I know I can run get-mailboxserver | get-mailboxdatabase |ft servername,name,logfileprefix on the corresponding production but I am trying to avoid that in my script and instead get all the relevant information for the restored edb file and/or the corresponding transaction logs folder restored for us. The intent is to automate this process for out night junior admin to avoid unnecessary phone calls. I think I can get the info I need by getting the EXX.chk file from the TR logs folder which should have teh same numbering as the EXX I need.


    Thanks again.

    Wednesday, January 11, 2012 5:46 PM
  • I don't think eseutil is going to give you that informtion offhand.  I think you may have to create a chart for the jr admin with a list oif the name of the database and the logfileprefix.  Then when you run your script you can do something like '.\myrestoresript.ps1 database1' and let the script read from the CSV file to see which log file prefix is used for 'database1'. 

    That is one possible solution, or even the 'get-mailboxserver | get-mailboxdatabase |ft servername,name,logfileprefix' (or a variant of it - like saving it to a CSV) as part of the script if it has access to the production servers to get the prefix to.  That csv would then be used in the restore script to determine the logfileprefix value.

    That may be more along the automation line as you were thinking.

    Wednesday, January 11, 2012 6:32 PM
  • Any updates?
    Wednesday, January 18, 2012 9:28 PM
  • Any updates on this?
    Monday, January 23, 2012 2:32 PM