...
> How can I safely reduce the size of the .LDF file that SQL Server 2005
> Express creates for a database?
> Many thanks.
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...
> How can I safely reduce the size of the .LDF file that SQL Server 2005
> Express creates for a database?
> Many thanks.
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...
> How can I safely reduce the size of the .LDF file that SQL Server 2005
> Express creates for a database?
> Many thanks.
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...
> How can I safely reduce the size of the .LDF file that SQL Server 2005
> Express creates for a database?
> Many thanks.
Thanks.
"William (Bill) Vaughn" <billvaRemoveT
@betav.com> wrote in message
news:%236kLYaEqHHA.716@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...
>> How can I safely reduce the size of the .LDF file that SQL Server 2005
>> Express creates for a database?
>> Many thanks.
Thanks as well to you and Ian.
- A
"Hari Prasad" <hari_prasa
@hotmail.com> wrote in message
news:OpzxjFLqHHA.1776@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...
>> How can I safely reduce the size of the .LDF file that SQL Server 2005
>> Express creates for a database?
>> Many thanks.