Solved

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

Posted on 2006-11-07
8
507 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

726 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