Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Sql Server Programming

The .LDF file


How can I safely reduce the size of the .LDF file that SQL Server 2005
Express creates for a database?

Many thanks.

Andrew

> How can I safely reduce the size of the .LDF file that SQL Server 2005
> Express creates for a database?

By using DBCC SHRINKFILE, but  if you set put the database in FULL  recovery
mode I'd not advise to shrink the file
http://www.karaszi.com/sqlserver/info_dont_shrink.asp

"Andrew Chalk" <ach@magnacartasoftware.com> wrote in message

news:uP$23NEqHHA.196@TK2MSFTNGP05.phx.gbl...

The .LDF is the transaction log. It is used to restore the database from the
last database backup.
So, once you do a full database backup, you can dump the log (using the TSQL
BACKUP statement). I suggest reading BOL to get more information about
backing up the database and transaction log. See
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/89a4658a-62f1-4289-8982 -f072229720a1.htm

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
--------------------------------------------------------------------------- --------------------------------------------

"Andrew Chalk" <ach@magnacartasoftware.com> wrote in message

news:uP$23NEqHHA.196@TK2MSFTNGP05.phx.gbl...

Put the database into the "Simple" recovery model, as opposed to the "Full"
or "Bulk Logged" recovery models. That will keep the problem from happening
again.

Then run:
DBCC SHRINKDATABASE (MyDatabase)

"Andrew Chalk" <ach@magnacartasoftware.com> wrote in message

news:uP$23NEqHHA.196@TK2MSFTNGP05.phx.gbl...

Hello Andrew,

First take a look into the recovery model for the particular database. If it
is SIMPLE go ahead and shrink the LDF file using DBCC SHRINKFILE command.
If the recovery model is either FULL or BULK_LOGGED then you may need to
take a transaction log backup before shriking the LDF file.

As well as if the recovery model is FULL/BULK_LOGGED schedule a trasnaction
log backup in regular intervals; this will help the LDF file not to grow
as well as can be used for recovery purpose.

Take a look into RECOVERY MODEL topic in books online for details

Thanks
Hari

"Andrew Chalk" <ach@magnacartasoftware.com> wrote in message

news:uP$23NEqHHA.196@TK2MSFTNGP05.phx.gbl...

Thanks.
"William (Bill) Vaughn" <billvaRemoveT@betav.com> wrote in message
news:%236kLYaEqHHA.716@TK2MSFTNGP05.phx.gbl...

Thanks as well to you and Ian.

- A

"Hari Prasad" <hari_prasa@hotmail.com> wrote in message

news:OpzxjFLqHHA.1776@TK2MSFTNGP05.phx.gbl...

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc