Solved

my transaction log very huge even transaction log backup run for every 5 mins

Posted on 2006-11-07
8
508 Views
Last Modified: 2008-01-09
Hi,
My trans log is very huge 80GB is size even the transaction log ackup run for every 5 mins, I heard about dbcc opentran but how could I use this to work on my huge log file?
0
Comment
Question by:motioneye
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 28

Expert Comment

by:imran_fast
ID: 17889177
This will shrink you file to 100mb
use yourdatabasename

DBCC SHRINKFILE (logfilename, 100)
GO
0
 

Author Comment

by:motioneye
ID: 17889308
but how about dbcc opentran work???
0
 
LVL 28

Expert Comment

by:imran_fast
ID: 17889354
This is from books online
For log files, SQL Server uses target_size to calculate the target size for the entire log; therefore, target_size is the amount of free space in the log after the shrink operation. Target size for the entire log is then translated to target size for each log file. DBCC SHRINKFILE attempts to shrink each physical log file to its target size immediately. If no part of the logical log resides in the virtual logs beyond the log file's target size, the file is successfully truncated and DBCC SHRINKFILE completes with no messages. However, if part of the logical log resides in the virtual logs beyond the target size, SQL Server frees as much space as possible and then issues an informational message. The message tells you what actions you need to perform to move the logical log out of the virtual logs at the end of the file. After you perform the actions, you can then reissue the DBCC SHRINKFILE command to free the remaining space. For more information about shrinking transaction logs, see Shrinking the Transaction Log.

0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 20

Expert Comment

by:Sirees
ID: 17889522
<<but how about dbcc opentran work???>>

From BOL:

DBCC OPENTRAN
Displays information about the oldest active transaction and the oldest distributed and nondistributed replicated transactions, if any, within the specified database. Results are displayed only if there is an active transaction or if the database contains replication information. An informational message is displayed if there are no active transactions.

Use DBCC OPENTRAN to determine whether an open transaction exists within the log. When using the BACKUP LOG statement, only the inactive portion of the log can be truncated; an open transaction can cause the log to not truncate completely.

0
 

Author Comment

by:motioneye
ID: 17889552
Hi imran_fast
I know how to use dbcc shrinkfile and also how to backup log, this 2 useful command is really helpful whenever there is an unallocated space in the log size..
what I'm saying here is the used log size is very huge 80GB ( grey color ) that make me consufe why it so big?

I execute the statement as below

dbcc opentran
WITH TABLERESULTS
             , NO_INFOMSGS

and get the result as below
REPL_DIST_OLD_LSN      (36:410:7)
REPL_NONDIST_OLD_LSN      (0:0:0)
0
 
LVL 28

Expert Comment

by:imran_fast
ID: 17889604
>>what I'm saying here is the used log size is very huge 80GB ( grey color ) that make me consufe why it so big?
Now here you can follow two steps one
either take the backup of your log file.

or

run this statement

dump transation yourdatabasename with no_log

this will remove all the commited transation from the log thus reducing the used space for log file.
0
 
LVL 28

Accepted Solution

by:
imran_fast earned 500 total points
ID: 17889622
After this dump transaction statement you can shrink your log file to any size.
0
 

Author Comment

by:motioneye
ID: 17889747
dump transation yourdatabasename with no_log= will this reduce the used log file? how big that it can be reduce from 80GB in used size?
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

707 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