Link to home
Start Free TrialLog in
Avatar of aawesome
aawesome

asked on

easy way to shrink a sql log file in windows 2003 server OS

easy way to shrink a sql log file in windows 2003 server OS
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of twoboats
twoboats

First off, backup the log to remove the inactive part.

Then

DBCC SHRINKFILE

To reduce the filesize
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oops. looking back I wasn't clear. This command can be run in "Query Analyzer". Copy, paste, edit dbnames and click "Run" or hit F5.
--------
Backup Log DBNAMEHERE with truncate_only

DBCC SHRINKFILE ('DBLOGICALNAMEHERE_log', 2)
---------