List:General Discussion« Previous MessageNext Message »
From:Bill Easton Date:October 28 2002 3:56pm
Subject:Re: database corrupted after power switched off
View as plain text  
Thanks.  You're right, of course.  Nevertheless, I think the suggestions I
made should help.

(Context:  There was a post asking how to avoid table corruption.  There
were several replies suggesting UPS.  I suggested that, in addition to UPS,
there were two other things that could be done.)

(1)  Use InnoDB. Of course, you need to worry that InnoDB does a
physical write when it thinks it does.  My understanding is that it tries to
do so, if it can, when innodb_flush_log_at_trx_commit=1.

(2)  If MyISAM updates are infrequent, flush tables after updates.  This
closes
the files, which generally causes physical writes on most OS's.  Of course,
this doesn't help with loss of power while an update is running, but it
does avoid corruption when there are no updates going on, and MyISAM
is susceptible to the latter.


----- Original Message -----
From: "Michael T. Babcock" <mbabcock@stripped>
To: "Bill Easton" <bill@stripped>
Cc: <mysql@stripped>; "Tom Thurnherr" <thurnherr@stripped>
Sent: Monday, October 28, 2002 10:18 AM
Subject: Re: database corrupted after power switched off


> Bill Easton wrote:
>
> >   ... which says "MyISAM table format is very reliable (all changes to a
> >table is written before the SQL statements returns)"  Evidently, this is
NOT true.
> >(Perhaps, it used to be true for ISAM tables.  The documentation should
be
> >changed.)
> >
> You are misinterpreting the statement; it says that the database will be
> safe after the SQL command returns (all SQL commands active on the
> table, for that matter).  That is to say, if the power were turned off
> while any (update / etc.) SQL command was running, you could expect
> corruption.
>
> Again, make sure you check how your OS deals with write caching and
> consider turning it off on the partition / disk you're using for DB
storage.
>
> --
> Michael T. Babcock
> C.T.O., FibreSpeed Ltd.
> http://www.fibrespeed.net/~mbabcock
>
>
>


Thread
database corrupted after power switched offTom Thurnherr28 Oct
  • RE: database corrupted after power switched offEd Carp28 Oct
  • re: database corrupted after power switched offVictoria Reznichenko28 Oct
re: database corrupted after power switched offBill Easton28 Oct
  • Re: database corrupted after power switched offMichael T. Babcock28 Oct
  • Re: database corrupted after power switched offMark28 Oct
  • Re: database corrupted after power switched offBill Easton28 Oct
  • Re: database corrupted after power switched offMichael T. Babcock28 Oct
RE: database corrupted after power switched offJan Steinman28 Oct