• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 387
  • Last Modified:

Shrink Log file

In SQL 2005 there was a shrink logfile with truncate only script.

What is the (script) process for that in 2008 R2?
0
lrbrister
Asked:
lrbrister
  • 3
  • 2
  • 2
  • +2
2 Solutions
 
jawa29Commented:
You can use DBCC SHRINKDATABASE

http://msdn.microsoft.com/en-us/library/ms190488.aspx

Jawa29
0
 
TempDBACommented:
USE <dbname>
GO
DBCC SHRINKFILE (N'<fileName>' , 0, TRUNCATEONLY)
GO
0
 
DavidMorrisonCommented:
It's interesting that nobody has questioned why you wish to shrink \ truncate the log file. Without wanting to teach you to "suck eggs" do you understand firstly why your log file bloats and also the implications of shirking / truncating it?
0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
lrbristerAuthor Commented:
DavidMorrison:
Yes...I understand the reasons for bloating

This is on a DEV server that we try and reguarly kill.

It has 12 databases with TON'S or transactions taking place and we want to see what happens on some processes, jobs etc.

We recently migrated to 2008 R2 and I still every once in while have a left-brain hip check and stype in a 2005 command.
0
 
lrbristerAuthor Commented:
I like jawa29: and TempDBA both.  Any problems with splitting the points?
0
 
jawa29Commented:
Not on my part :)

Jawa29
0
 
DavidMorrisonCommented:
Ok that's fair, its always worth checking. You'd be surprised the number of people that want to kill log files on live prod servers to save space and don't really understand the implications of what they are asking :)
0
 
jogosCommented:
Do you know why it is to big? Do you know your recovery model and backup-cycle?

That shrink (as any big action) could also best be accompanied with an explicit backup first http://support.microsoft.com/kb/907511
0
 
jogosCommented:
ok I was forgetting to post and now its was obvious to late
0
 
lrbristerAuthor Commented:
Great job guys...appreciated
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now