RE: Cannot shrink Transaction Log

From: Umut Nazlica (UmutNazlica_at_discussions.microsoft.com)
Date: 02/21/05


Date: Mon, 21 Feb 2005 03:41:05 -0800

Hi,

What is your recovery model? Full, Simple ?

If you are using Full recovery model then you need to backup the transaction
log regularly.

If you don't need to set recovery model to Full then use Simple Recovery
Model you can find detailed information about it from Books Online.

Check out BACKUP LOG WITH TRUNCATE_ONLY (if it's acceptable for you..)

FROM BOL:

NO_LOG | TRUNCATE_ONLY

Removes the inactive part of the log without making a backup copy of it and
truncates the log. This option frees space. Specifying a backup device is
unnecessary because the log backup is not saved. NO_LOG and TRUNCATE_ONLY are
synonyms.

After backing up the log using either NO_LOG or TRUNCATE_ONLY, the changes
recorded in the log are not recoverable. For recovery purposes, immediately
execute BACKUP DATABASE.

"Fluffy_Ninja" wrote:

> Hello. I've got a situation where a live database has stopped working because
> the transaction logs have filled all available disk space. I would really
> appreciate any advice on how to get it running again. My knowledge of SQL
> Server 2000 is very limited so I would need so quite detailed instructions! I
> am happy with entering statements into Query Analyzer.
>
> I've tried to shrink the transaction log by running a backup on it in
> Enterprise Manager. However, the largest .LDF file is 33Gb and there is not
> enough disk space to back this up.
>
> So somehow I need to shrink these .LDF transaction log files. Also, if
> anyone could advise on how to stop this situation happening again, that'd be
> fantastic. If anyone can give advice on how to do this, you really would be
> saving my life!



Relevant Pages

  • Re: Truncate and Shrink
    ... Before I did I BACKUP LOG ... ... The Recovery model is set to as "Full". ... Transaction Backup is set after ... >Did you run DBCC OPENTRAN? ...
    (microsoft.public.sqlserver.server)
  • What is the best practice to create Maintenance Plans
    ... There is not a definitive answer to the question of which backup is better. ... the database can be recovered to the point ... Full Recovery or Bulk-Logged Recovery model. ... Transaction Log backup for master database is not allowed. ...
    (microsoft.public.sqlserver.security)
  • Re: just wondering about MSKB 828481
    ... database via a combination of backup and logs to a specific time. ... If I change the recovery model I can assure the client 'we can rollback to ... any other time which exists on our tapes which also inlude the SQL backups ...
    (microsoft.public.windows.server.sbs)
  • Re: Transaction log growth
    ... tlog backup or die :-) ... using a full recovery model without a good backup plabn will quickly lead to ... > I support the Professional Association for SQL Server ...
    (microsoft.public.sqlserver.server)
  • Re: Transaction log growth
    ... tlog backup or die :-) ... using a full recovery model without a good backup plabn will quickly lead to ... > I support the Professional Association for SQL Server ...
    (microsoft.public.sqlserver.programming)