Solved

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

Posted on 2006-11-07
8
506 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
  • 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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 combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

840 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