Solved

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

Posted on 2006-11-07
8
505 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

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…
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

770 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