How do I truncate a log file in SQL Server 2000?

Published by Charlie Davidson on

How do I truncate a log file in SQL Server 2000?

How to: Shrinking the Transaction Log in SQL Server 2000

  1. Step 1: Backup Transaction log with the BACKUP LOG statement.
  2. Step 2: Truncate the transaction log with the WITH TRUNCATE_ONLY function.
  3. Step 3: Shrinking the trans logs with DBCC SHRINKFILE statement.

How do I truncate a SQL log file?

Truncate the transaction log

  1. Right-click the database and select Properties -> Options.
  2. Set the recovery model to Simple and exit the menu.
  3. Right-click the database again and select Tasks -> Shrink -> Files.
  4. Change the type to Log .
  5. Under Shrink action, select Reorganize pages before releasing unused space and click OK.

How do I truncate a transaction log?

In order to truncate SQL transaction logs, open the SQL Server Management Studio (SSMS), select the desired database (with large transaction log), right click on it, and select Properties from the context menu. Go to Options and switch the database Recovery model to Simple.

What is truncate SQL logs?

SQL Server Transaction Log truncation is the process in which all VLFs that are marked as inactive will be deleted from the SQL Server Transaction Log file and become available for reuse. If there is a single active log record in a VLF, the overall VLF will be considered as active log and cannot be truncated.

How do I reduce the size of SQL transaction log?

To shrink the log in SSMS, right click the database, choose Tasks, Shrink, Files:

  1. On the Shrink File window, change the File Type to Log.
  2. Shrink the log using TSQL.
  3. DBCC SHRINKFILE (AdventureWorks2012_log, 1)

How do I shrink a database in SQL Server 2000?

The way I shrink files: SQL Enterprise Manager -> select Database -> Right click on the name and select Shrink Database -> select data files you want to shrink.

Does full backup include transaction logs?

A full database backup backs up the whole database. This includes part of the transaction log so that the full database can be recovered after a full database backup is restored. Full database backups represent the database at the time the backup finished.

How do I reduce the size of my log file?

Categories: Trending