Skip to main content

How to free space on your server

I try to be responsible. I like to back up my data. I know that bad, bad things happen when you don't back up. So, last night I decided to back up the databases we use for the ICE development environment. Good thinking right? Sensible Gordo.

Well, as I tried to back up the development DB, the server tells me that it's only got 20mB of space left on disk. Hmmm. 'That can't be right, ' thinks me. 'What's using all this space?' Well, it turns out the Microsoft SQL server log files are occupying about 7 gigabytes. So, not really caring about recording the history of updates made over time to the development data (which is largely records and documents title 'poo' and 'asdf') I decided to delete them. They're just logfiles right? Log files are boring things invented for dweeby auditors to pore over. We don't need no stinkin' log files...

And so, I deleted them. And that's where the world started to go bad. Windows told me those files were too big for the recycle bin - is it okay to delete them forever? sure, sure, says me. Logfiles? meh. Well, now the databases don't work. Turns out that SQL server has something of an affinity for it's logfiles (something about the only file with data that ever gets written to disk, ever) and was REALLY, REALLY PISSED that I had deleted them.

So, two frantic calls to Grant later, and about an hour and a half of wizardry on his part, and the world is good again.

And the moral to story - Never, Ever, EVER delete logfiles in SQL Server. I know I'll remember that. You should too.

Comments

Popular posts from this blog

Easter at Blackhead

Camping out on the headland, miles from anywhere. Big swell, off-shore winds, clear crisp nights and smoke from the wood fire. Sometimes it's so rewarding to get out from under the pressure of your life and just be a family of humans.

How to rename an XML Node in C#

This was driving me crazy - here's an easy cut and paste solution to not being able to use the DOM to rename a node for lazy developers like me: public static XmlNode RenameNode (XmlNode node, string namespaceURI,string qualifiedName) { if (node.NodeType == XmlNodeType.Element) { XmlElement oldElement = (XmlElement) node; XmlElement newElement = node.OwnerDocument.CreateElement(qualifiedName, namespaceURI); while (oldElement.HasAttributes) { newElement.SetAttributeNode(oldElement.RemoveAttributeNode(oldElement.Attributes[0])); } while (oldElement.HasChildNodes) { newElement.AppendChild(oldElement.FirstChild); } if (oldElement.ParentNode != null) { oldElement.ParentNode.ReplaceChild(newElement, oldElement); } return newElement; } else { return null; } ...

Democracy in Action...

I have to vote in the US Senate Election Tomorrow. Okay, I don't have to vote, but being an Australian American, voting is something we do. Australia has compulsory voting, which I am overwhelmingly supportive of. People often assume that the point of compulsory voting is to somehow educate people about politics - to force them to have an opinion. The reality has nothing to do with voters, and everything to do with ensuring good governance - By forcing politicians to care about every voter, rather than just the ones who can be bothered to go down to the poll both and vote, it means that politicians are consequently forced to address the needs of all the citizens in the country. Under a non compulsory voting system, it's mainly the wealthy and educated who vote. I was a little shocked to find out that part of the aim of the campaign advertisements that have been confusing me for the last month on TV is not to encourage voters to vote for one candidate or another, but to discou...