Solved

SQL Logfiles over 80GB

Posted on 2013-12-06
4
382 Views
Last Modified: 2013-12-06
Hi Experts,

I have some SQL logfiles which are very big. over 80GB.
With a command I checked the log and just 1% is used.
Under options of this DB I found the feature autoshrink file.

When I use autoshrink, is this a problem ?
Or do I have some disadvantages ?
0
Comment
Question by:Eprs_Admin
  • 2
  • 2
4 Comments
 
LVL 1

Expert Comment

by:mike706
ID: 39700376
From SSMS run Task -> Shrink -> Files and shrink the Log file.
Mark the option "Reorganize pages Before releasing unused space" and set "Shrink file to".

Make sure that the Log file is not shrink to 0% available space after shrink.
This file size is depending on the amount of transactions made to the database.

Then setup a backup job with option FULL to make a backup of the database. If the Recovery Model is set to FULL on the database also make a log backup between the FULL backups.
Typically a log backup is set to every hour during the day when the transactions is made to the database. This will help to have the transaction log in shape.
0
 

Author Comment

by:Eprs_Admin
ID: 39700416
I cannot find this option :
 "Reorganize pages Before releasing unused space"
0
 
LVL 1

Accepted Solution

by:
mike706 earned 500 total points
ID: 39700469
You will find it under the Shrink files window.

What version of SQL server are you using?

You can also try to do it with a Query.

USE [Database]
GO
DBCC SHRINKFILE (N'Filename of logfile' , 2)
GO

Change the Database to the corresponding database and "Filename of logfile" to the logical name of the logfile. The number is the value in MB how big the log file should be after the shrink.

Don't forget to make backup Before Shrinking the database.
pic.PNG
0
 

Author Closing Comment

by:Eprs_Admin
ID: 39700694
Thanks my friend
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question