[CLUE-Tech] Meanness to my RDBMS
grant
grant at amadensor.com
Thu Apr 19 13:32:02 MDT 2001
Well, I am running PostgreSQL 7.1 RC2. I decided to be mean to it. While
doing a big pile of inserts (50,000) I yanked the power cord out of the
wall. Here is what happened.
On reboot, the OS complained that my EXT2 file system had not been cleanly
unmounted (duh...) and proceeded to do an fsck. Well, it was nasty
enough to drop me into single user mode and say "Here, moron, you
unplugged it, fix it yourself!" So, I ran fsck on the afflicted file
system. It complained about bas numbers of references to inodes and
files, and about data that doesn't really go with anything that it wants
to stick in lost+found. I just said yes to everything it asked me about
fixing. Then I rebooted and did the same thing for hda5 that I had just
done for hda7.
Now that it was up and running, I logged in as postgres (I do not have it
starting automatically) and started the database. It took a little longer
than usual, and looking at the log revealed why. It told me about which
transactions it was redoing, and which it was throwing out, and then it
came up just fine. When I checked with a select count(*), it was about
100 transactions further along than I had expected it to be, and all of
the data for all of those transactions was intact. a JFS would have maybe
saved even more transactions.
Has anyone tried this with any other DBMS? I would be interested in how
well it recovered.
______________________________________________________________________________
Your mouse has moved.
You must restart Windows for your changes to take effect.
#!/usr/bin/perl
print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);
More information about the clue-tech
mailing list