question

sdcraig avatar image
sdcraig asked

LDF Question

All: Basic question, but not finding any answers online: First, does an LDF get destroyed either entirely or partially by shrinking the file? Or does this simply do a "compact/repair", similar to Access, where space is freed up? Second, does truncating the LDF file destroy any/all of the file? Third, does backing up the LDF file destroy the file (entirely or partially)? Fourth, for an online front-end application that has a SQL backend, can metadata (or transaction details) be tracked through the application, or are all these items tracked by the backend SQL database (in the LDF file)? Thank you.
ldf
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
VishalhSingh avatar image
VishalhSingh answered
> First, does an LDF get destroyed either entirely or partially by shrinking the file? Or does this simply do a "compact/repair", similar to Access, where space is freed up? The short answer is "No". Shrinking the file just remove the free spaces from the file. A free space can be anything for example space at the end of the trail log, or white spaces etc. > Second, does truncating the LDF file destroy any/all of the file? "No". If your operation is to empty the file by moving the data in a different file, you might be able to destroy (remove to be specific) from the database but that is all up to you. By Default, SQL Serever DBE never ever destroy the file behind shrink operation. > Third, does backing up the LDF file destroy the file (entirely or partially)? "No". Backing up and LDF means the process commits the active log to the database to include them in the backup. Later you can shrink it to release the space by deleting the committed log from LDF file (since they are already hardened). > Fourth, for an online front-end application that has a SQL backend, can metadata (or transaction details) be tracked through the application, or are all these items tracked by the backend SQL database (in the LDF file)? I won't say in the context of LDF but there are many ways depends on SQL Server version and edition. Even, you can write your custom code for doing thing. All you need to do is study the [BOL (SQL Server Books Online)][1] to clear your fundamentals. [1]: http://technet.microsoft.com/library/ms130214(SQL.105).aspx Hope this helps.
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.