Embed
Email

Truncating the Transaction Log

Document Sample

Shared by: linzhengnd
Categories
Tags
Stats
views:
0
posted:
11/15/2011
language:
English
pages:
1
Truncating the Transaction Log



The size of a transaction log is controlled in one of these ways:



 When a log backup sequence is being maintained, schedule BACKUP

LOG statements to occur at intervals that will keep the transaction log

from growing past the desired size.



This example creates a transaction log backup for the OEModels

database to the previously created named backup device,

OEModels_log1:



BACKUP LOG OEModels

TO OEModels_log1

GO



 When a log backup sequence is not maintained, specify the simple

recovery model.



Truncation does not reduce the size of a physical log file, it reduces the size of

the logical log file.







Shrinking the Transaction Log



Shrinking a log is dependent on first truncating the log. Log truncation does not

reduce the size of a physical log file, it reduces the size of the logical log and

marks as inactive the virtual logs that do not hold any part of the logical log. A log

shrink operation removes enough inactive virtual logs to reduce the log file to the

requested size.

USE OEModels

GO

DBCC SHRINKFILE (OEModels_log, 7)

GO



This example shrinks the size of a logfile named OEModels_log in the

OEModels database to 7 MB.



Related docs
Other docs by linzhengnd
i-Health
Views: 0  |  Downloads: 0
State employees recall events of September 11
Views: 7  |  Downloads: 0
0804050421330_2110
Views: 4  |  Downloads: 0
Listino2009 - Meetup
Views: 0  |  Downloads: 0
TwoSurveyCalculator
Views: 0  |  Downloads: 0
Guidelines.xlsx
Views: 0  |  Downloads: 0
APPALACHIA AND THE OZARKS
Views: 2  |  Downloads: 0
Proliferation Studies
Views: 0  |  Downloads: 0
By registering with docstoc.com you agree to our
privacy policy

You are almost ready to download!

You are almost ready to download!