General discussion

Locked

how to shrink a SQL logfile

By f.vink ·
How to shrink the logfile of my SQL 7.0 database?
DBCC SHRINKFILE and DBCC SHRINKDATABASE does not seem to work.

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

how to shrink a SQL logfile

by mark.thomson In reply to how to shrink a SQL logfi ...

This generally works for me -

In the Enterprise manager right-click the database whose logfile you want to shrink
then click "all task" followed by "Truncate log" then follow the prompts

Then Shrink the database then truncate the log (as above) then shrink the database

In addition to this you might want to set the "Truncate Log on Checkpoint" in the "Options" tab in the Database properties dialog to prvent the logfile from getting too big althought there are reasons why you might notwant to do this

Collapse -

how to shrink a SQL logfile

by f.vink In reply to how to shrink a SQL logfi ...

The question was auto-closed by TechRepublic

Collapse -

how to shrink a SQL logfile

by rynzeski In reply to how to shrink a SQL logfi ...

Go to this URL to get more information on shrinking individual database files.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/createdb/cm_8_des_03_3vvp.asp

Collapse -

how to shrink a SQL logfile

by f.vink In reply to how to shrink a SQL logfi ...

The question was auto-closed by TechRepublic

Collapse -

how to shrink a SQL logfile

by miket In reply to how to shrink a SQL logfi ...

Depending on your situation:
1) If your database is set to "Full" or "Bulk" recovery model, then doing a regular backup of the logfile should keep it truncated.

2) If you don't need to keep a copy of the logfile for recovery purposes, set your database to use the "Simple" Recovery model and your log will truncate after each transaction is completed.

Mike T.

Collapse -

how to shrink a SQL logfile

by f.vink In reply to how to shrink a SQL logfi ...

The question was auto-closed by TechRepublic

Collapse -

how to shrink a SQL logfile

by f.vink In reply to how to shrink a SQL logfi ...

This question was auto closed due to inactivity

Back to Web Development Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums