Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
nitin1353
Constraint Violating Yak Guru
381 Posts |
Posted - 2005-01-25 : 16:31:42
|
| Hi allI have a problem.I have very huge log files in my database .I want to delete these files from the production database.What all things should i consider before deleting them.plz helpRegardsNitin |
|
|
chadmat
The Chadinator
1974 Posts |
Posted - 2005-01-25 : 16:54:44
|
| Back up the log, and shrink the file.-Chadhttp://www.clrsoft.comSoftware built for the Common Language Runtime. |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-01-26 : 02:31:10
|
quote: Originally posted by nitin1353 Hi allI have a problem.I have very huge log files in my database .I want to delete these files from the production database.What all things should i consider before deleting them.plz helpRegardsNitin
if they are in use, you will not be able to delete thembut you can shrink them,i agree with chad plus create maintenance jobs and restrict the size of the log file to prevent it from growing too large.--------------------keeping it simple... |
 |
|
|
chadmat
The Chadinator
1974 Posts |
Posted - 2005-01-26 : 13:08:34
|
| I wouldn't restrict the size of the log, as that will cause problems if the max size is reached, and it tries to grow again.What you do NEED to do is 1 of 2 things. 1. Set your Database to simple recoveryor2. Do much more frequent log backups.If you need the ability to restore to a point in time, then choose option 2. If not, Choose option 1. I have over simplified the decision, but there is plenty of information on this forum, and in other references to help you make that decision.-Chadhttp://www.clrsoft.comSoftware built for the Common Language Runtime. |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-01-27 : 04:51:52
|
quote: i agree with chad plus create maintenance jobs and restrict the size of the log file to prevent it from growing too large.
that's why you need to create maintenance jobs if you're going to restrict the log size. another solution is, if the database is not critical (no need for point-in-time recovery):1. create backup jobs (one full backup and one for log backup)2. create an alert to monitor log file size3. when the limit is reached, the alert triggers the log backup job - i make sure i have one full backup for each database every day, from experience this has saved me a lot of headaches --------------------keeping it simple... |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
|
|
chadmat
The Chadinator
1974 Posts |
Posted - 2005-01-27 : 12:47:21
|
quote: That's much better than getting the same problems when the disk is full
That is why I said he/she should also change to simple recovery, or schedule more frequent log backups. Which should keep the log from growing excessivly.Now this is just my opinion, but when answering the question "Why did out PROD server go down?" I would much prefer to answer because the disk filled up (You didn't spend enough money for disk space).Than Because I restricted the file growth (I made it happen by restricting file growth, but we have disk space a plenty)Now in either of these cases proper care/feeding of the log file would avoid the problem.-Chadhttp://www.clrsoft.comSoftware built for the Common Language Runtime. |
 |
|
|
|
|
|
|
|