Solved

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

Posted on 2006-11-07
8
503 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
Comment Utility
This will shrink you file to 100mb
use yourdatabasename

DBCC SHRINKFILE (logfilename, 100)
GO
0
 

Author Comment

by:motioneye
Comment Utility
but how about dbcc opentran work???
0
 
LVL 28

Expert Comment

by:imran_fast
Comment Utility
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
 
LVL 20

Expert Comment

by:Sirees
Comment Utility
<<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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:motioneye
Comment Utility
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
Comment Utility
>>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
Comment Utility
After this dump transaction statement you can shrink your log file to any size.
0
 

Author Comment

by:motioneye
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

772 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

11 Experts available now in Live!

Get 1:1 Help Now