Samiksha
Samiksha

Reputation: 6182

How to truncate and shrink log files?

How to truncate and shrink large log files in SQL Server 2005? How to apply truncation at regular intervals?

Is there any difference between truncation and shrinking?

Thanks in advance

Upvotes: 2

Views: 2453

Answers (4)

hossein andarkhora
hossein andarkhora

Reputation: 798

first you should change your database recovery mode on Properties - > Option -> Recovery Model and change it to simple and then shrink log file from Right Click -> Tasks -> Shrink -> Files and choose file type 'Log' and click ok

Upvotes: 0

Ed Guiness
Ed Guiness

Reputation: 35237

Reliable shrinking is achieved by

  • Backup (can be truncate only)
  • Checkpoint
  • Shrink

Upvotes: 1

DCNYAM
DCNYAM

Reputation: 12126

Use DBCC SHRINKFILE and schedule it as a job that runs regularly (preferably during off-hours).

Just be aware that there is a performance hit from regularly growing and shrinking the log file. If you have the space, you may want to set the file size to the maximum that it normally grows to and just leave it.

Upvotes: 6

Mehrdad Afshari
Mehrdad Afshari

Reputation: 421968

Use the DBCC SHRINKFILE statement.

Upvotes: 0

Related Questions