Re: SQL Server Transaction Log

From: Aaron Bertrand [MVP] (aaron_at_TRASHaspfaq.com)
Date: 02/22/04


Date: Sun, 22 Feb 2004 01:09:53 -0500

USE MASTER
GO
BACKUP LOG databasename WITH TRUNCATE_ONLY
USE databasename
GO
-- get database_log_filename from EXEC sp_helpfile
DBCC SHRINKFILE(database_log_filename, 1)

Also see http://www.aspfaq.com/2471 and http://www.aspfaq.com/2446 (the
latter was written with tempdb in mind, but are applicable in general).

-- 
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Yusuf Pachorawala" <yusufp@al-faris.com> wrote in message
news:ODzD6cQ#DHA.340@tk2msftngp13.phx.gbl...
> Dear Friends
>
> I am new to MS SQL server 2000
>
> I am using a MS SQL server 2000 with SP3. The database file ext mdf is
> around 800mb but the transaction log file ext ldf has beocme as big as
26.8
> gb. I have kept the recovery model to full as well as simple both , but in
> either case after taking the backup the transaction log wotn truncate. I
> have also tried the backup command from the query analyser with the
> truncate_only option but no change in the log file size.
>
> Can anyone guide me  how to truncate the log file?
> regards
> Yusuf
>
>


Relevant Pages

  • Re: Unable to attach the database
    ... BUT NEVER DELETE A LOG FILE! ... If you have a clean backup of the database, ... good understanding of SQL Server and how to work from this situation. ...
    (comp.databases.ms-sqlserver)
  • Re: Transaction Log Failure
    ... A maintenance plan can not create a log file, ... then bring up sql server. ... > maintenance plan that would create a transaction log file every hour. ... > 2004-12-14 21:00:43.51 backup BACKUP failed to complete the command ...
    (microsoft.public.sqlserver.server)
  • Re: suitable plan for Log backup
    ... transactions since the last log backup... ... To reduce the risk backup the log ... I support the Professional Association of SQL Server and it's community of SQL Server professionals. ... after backup the size of log file does not decrease. ...
    (microsoft.public.sqlserver.server)
  • 2 Qs: DB Shrink and Agent step
    ... Q1: shrinking transaction log ... backup log file with successfully, ... SQL Server Agent only runs step 1 ...
    (microsoft.public.sqlserver.server)
  • RE: Error with SBS backup
    ... Error 800423f4 appears in the backup log file when you back up a volume by ... Microsoft CSS Online Newsgroup Support ... This newsgroup only focuses on SBS technical issues. ...
    (microsoft.public.windows.server.sbs)