Solved

SQL Logfiles over 80GB

Posted on 2013-12-06
4
375 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I have written a PowerShell script to "walk" the security structure of each SQL instance to find:         Each Login (Windows or SQL)             * Its Server Roles             * Every database to which the login is mapped             * The associated "Database User" for this …
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now