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 |
|
ssanchez02
Starting Member
5 Posts |
Posted - 2004-09-26 : 05:17:29
|
| Sql Server Newbie here. We set up a SQL Server 2000 to run ads for our website. Being new to SQL Server, we ignorantly created the database to automatically grow the transaction log and unrestricted file growth. Now the log file is 20 GB and we're getting Error 9002 errors complaining that the log file is full. We're not really interested in the log file and obviously don't want a 20GB file on the server. However, being new to this, I'm reluctant to just start deleting and changing things for fear of breaking something.Here's my immediate question: How do I safely delete the log file and set it so it doesn't grow beyond a certain size? I think I just go into the database properties, select the Transaction Log tab, press the 'delete' button to delete the log file and change the maximum file size to restrict file growth to, say, 20MB. Is this correct? I'm assuming this won't damage the database in any way.Second question, what happens in the future when the log grows to the maximum file size? Does it delete the log? Stop serving the database?Thanks for the help. SQL's been awesome but I'm still learning everything I need to know. |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-09-26 : 12:15:26
|
| You need to set your recovery mode to Simple by right-clicking on the database and chooseing properties. You then need to right-click on the database and choose to shrink the database. When you get to this option, choose to shrink files. Choose the log file and shrink it.Once the recovery mode is set to simple, you don't have to worry about it growing crazy like this anymore.Also, make sure you do make backup on a regular basis.MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
ssanchez02
Starting Member
5 Posts |
Posted - 2004-09-26 : 16:42:35
|
| Don't fire the DBA! You're the man! Seriously, thank you so much for the timely help. I had to reboot the server after only a couple of days because the log fiole was almost as big as the available space on the server. It is now miniscule and I know where to look. Thank you for the expert advice, clear to follow instructions and your timely reply. I wasn't looking forward to dealing with this issue Monday and now I don't have to.Thank you again. Have a great rest of the weekend!Steve Sanchez |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-09-27 : 02:19:23
|
| Isn't it nice to have a happy customer, Derrick - and, indeed, one who takes the trouble to say so?Ah ... life is bliss, all the bugs in my code are located and fixed, the documentation is complete, and the pigs are fed and ready to fly!Kristen |
 |
|
|
|
|
|
|
|