Wednesday, January 28, 2009

No backup and the database in suspect mode

This week, I got a call to help out with a database in suspect mode. I tried the usual MS SQL arsenal of tricks to get the CRM-database of that customer back. After more than 20 hours of repair commands (those included a night of sleep) I had to give an negative answer to the customer.

In the afternoon I had another call to ask if we could try to extract the data and dump it into another database or flat file. I had no clue how we could do this since everything in the last 20 hours failed. My collegue Gert Lievens found a technique on the Internet that we never tried before but worked :). We got everything back except for a primary key on 1 table and 1 index on that same table.

This is how it works:
First you change the database from suspect mode to emergency mode. Next you make sure you're the only one using it by forcing it in single user mode (with no wait of course). Then you make a DTS package where you use the copy database component. We configured the package to work in small steps (tables, views, functions, ....) and finally we found that the error was on the primary key and index for that table. So we told the DTS package to make a copy of that specific table but leave the primary key and indexes out. At the end of the day we had an identical copy of the database and a happy customer.

There are some lessons to be learned here:
1. Make sure your backups are ok if you manage a database.
2. There is another technique to get data back that I learned about.

Tuesday, January 20, 2009

Enter at own risk (follow up story)

In the month of November 2008 I had a bad restaurant expirience ( and filed a complaint at our federal agency for food safety.

I got an e-mail today from the agency telling that their inquery has finished and that my complaint was grounded and the necessary measures will be taken. What that means isn't in the text but I am happy with the result.

Wednesday, January 7, 2009

Undelete Plus : data recovery tool

We all know that situation, you get a call from a friend to tell you the data on his usb stick or hard disk has gone. I have some recovery software but recently Christophe Vandeplas has told me about UndeletePlus.

It is a free little tool, I've played around with it and I hope it will help me when I get that call again.

Securing an LAMP server ... intro

I've been given the opportunity to secure an LAMPserver. I 've never done this before but there is a first time for everything.

This is the layout of the system:
First of course there is OS hardening. I mention it since I've noticed that it isn't done by everyone. It is an Ubuntu server and google was my friend :). There are tons of info out there.

All ports except port 80 will be closed towards the Internet and port 80 will be connected to the web server by using NAT. On the web server the only ports open are HTTPS and SSH.

The server has a firewall and 3 rules:
1. Close every port
2. Allow the HTTPS traffic from the internal network and the Internet
3. Allow SSH trafic from the internal network and the Internet.

I am not happy with the last one, I will change it so that only the admin has access from his laptop but right now it is not my primary concern.

In my next post about securing the a LAMP, I'll be talking about the apache web server. Meanwhile if you have any suggestions or questions just give me a reaction.