Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to truncate a transaction log file?
Message
From
18/10/2002 10:53:08
 
 
To
18/10/2002 10:13:42
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00558317
Message ID:
00712885
Views:
25
I can think of two reasons:

1 - there is an active transaction. you cannot truncate the log past the oldest active transaction. Use DBCC OPENTRAN() to find the oldest open transaction in the log.

2 - the active virtual-log is the last one in the file. you will not be able to shink the file until the active virtual-log cycles back to the front. Please refer to the topic Shrinking the Transaction Log in the BOL for more info. Use DBCC LOGINFO(databasename) to see how your transaction log is divided into virtual logs. A 2 in the Status column indicates that that virtual log is active.

-Mike


>> Truncation does not physically reduce the size of the log file.
>> For that, run
>>
>> USE myDatabaseName
>> DBCC SHRINKFILE (myDatabaseName_Log)
>>
>> The log file retains all transactions executed on your database unless you > set options to control that, that's why it may be bigger than the actual
>> database.
>
>I did with success the command DBCC SHRINKFILE to reduce my log file many times in the past (every month), and now it is unsuccessful. I do not understand why suddenly it do not works. Someone can explain to me why??
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform