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.
Printable View
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.
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,Quote:
Originally Posted by techgnome
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.
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...
ok sir. Thank you very much for your valuable information and instant reply.