Results 1 to 5 of 5

Thread: [2005] How to Open Or read SQL Server log file .ldf

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2007
    Posts
    3

    Unhappy [2005] How to Open Or read SQL Server log file .ldf

    Dear Sir,

    When ever we create database from sql server, it's create two file. (1) .mdf (2) .ldf.
    I want to see what's available inside the .ldf file
    through program visual basic.net 2005 or any other version. Can you help me.

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [2005] How to Open Or read SQL Server log file .ldf

    The LDF file is a log file. It holds any temporary, cached information that hasn't been fully committed to the the database. It is not intended to be read. It is in binary format. There is one program that I am aware of that can read LDF files and it comes with a VERY LARGE price tag.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2007
    Posts
    3

    Re: [2005] How to Open Or read SQL Server log file .ldf

    Quote Originally Posted by techgnome
    The LDF file is a log file. It holds any temporary, cached information that hasn't been fully committed to the the database. It is not intended to be read. It is in binary format. There is one program that I am aware of that can read LDF files and it comes with a VERY LARGE price tag.

    -tg
    Sir,
    i accept ur quotes that LDF file is a binary file. but as a log file we can read it through some front end language and we can find the queries which would reveal that what the user done with the database. now i need help how to implement it.

  4. #4
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: [2005] How to Open Or read SQL Server log file .ldf

    You are confused about the concept of this log file.

    It is not a log file that you are familiar with - logging (printing) results of a process, for instance.

    MS SQL is a write-ahead-logged database engine. That means that when you read rows from the MDF they first go into the LDF - data resides in the LDF - not messages you can read. When you update rows in the database they do not go into the MDF - they first go into the LDF.

    The engine - in the background - moves data from the LDF to the MDF as it requires.

    If a transaction is held open (not committed) the rows remain in the LDF. In that case they do not go to the MDF until COMMIT. If the transaction is rolled back then they never go to the MDF at all.

    Data sits in the LDF flagged with what SPID process has it - locks and what not - all kinds of info sits in the LDF.

    There are SYSTEM STORED PROCEDURES that will show you what processes have data in the LDF - but not in a fashion that allows you to see the data.

    Again - it is not a LOG FILE...

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2007
    Posts
    3

    Re: [2005] How to Open Or read SQL Server log file .ldf

    ok sir. Thank you very much for your valuable information and instant reply.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width