| Author |
Topic |
|
dr223
Constraint Violating Yak Guru
444 Posts |
Posted - 2011-03-14 : 12:43:21
|
| Hi, I am working with SQL server 2005, and have a database with a large transaction log file. Data file: 5104 MBLog File: 12576 MBNow, when I want to shrink the log file by going; Tasks - Shrink - Files - File type (Log)Currently allocated space: 12575.50 MB Available free space: 460.57 MB (3%)I want to reduce this log file as its huge. Also, the database is hardly being updated, its updated on a monthly basis, but has around 12 millions records, and the monthly update include addition of around around 1000 - 2000 records.Any help pleaseThank you |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
GhantaBro
Posting Yak Master
215 Posts |
Posted - 2011-03-14 : 14:09:39
|
| Detach the databaseMove your logfile to some other location or delete if you dont need itAttach the DB back... |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
GhantaBro
Posting Yak Master
215 Posts |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2011-03-14 : 14:47:12
|
| To add to that, deleting the transaction is a terrible thing to do. SQL cannot always recreate it...As for the log management, please read through this - [url]http://www.sqlservercentral.com/articles/64582/[/url]--Gail ShawSQL Server MVP |
 |
|
|
GhantaBro
Posting Yak Master
215 Posts |
Posted - 2011-03-14 : 14:58:09
|
quote: Originally posted by GilaMonster To add to that, deleting the transaction is a terrible thing to do. SQL cannot always recreate it...As for the log management, please read through this - [url]http://www.sqlservercentral.com/articles/64582/[/url]--Gail ShawSQL Server MVP
That is why I said if u do not need it.. But yes I should not try to suggest on DBA stuff being a developer... I do that for only test databases if I ever do it anyway. Thanks guys. |
 |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2011-03-14 : 15:34:29
|
| But how do you know if it's needed or not? If you get it wrong, the database will not reattach--Gail ShawSQL Server MVP |
 |
|
|
dr223
Constraint Violating Yak Guru
444 Posts |
Posted - 2011-03-15 : 11:11:22
|
| Ok, thanks for all your responses -- the Recovery model was FULL. Ok, changed it to Simple but that will sort the problem for future.. But how will O solve the problem at this present time.. I need to reduce the log file size.Any hlep please |
 |
|
|
GhantaBro
Posting Yak Master
215 Posts |
Posted - 2011-03-15 : 12:31:29
|
quote: Originally posted by GilaMonster But how do you know if it's needed or not? If you get it wrong, the database will not reattach--Gail ShawSQL Server MVP
So depending on the recovery model, the database might not re-attach? I am not a DBA want to know. I think his issue is solved based on Tkizer's suggestion... he needs to make space for log file now... should he be backing up the log file every week now? What steps DR223 should take now? I want to learn exactly how experienced DBAs like you do? Thanks for the response. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
dr223
Constraint Violating Yak Guru
444 Posts |
Posted - 2011-03-15 : 13:12:11
|
| Ok - what if I go to Tasks - Shrink - Files - File Type: LogReorganize pages before releasing unused space - shrink file to: 200 MBN/BCurrently allocated space 12575.50 MBAvailable free space: 12506.26 MBIs the above procedure fine?Thanks |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|