List:General Discussion« Previous MessageNext Message »
From:Scott Tanner Date:June 5 2007 3:59am
Subject:Re: Diff between restore from tar and recover from power outage
View as plain text  
   If mysql has been shut down, and given enough time for the tables to
be flushed to disk, then backing up the data dir using tar is fine. You
can tar the data dir without shutting down, providing all transactions
have been stopped and the tables have been flushed to disk. This is how
we backup our servers, and we haven't had an issue yet (restoring daily
to a testing environment).

Regards,
Scott Tanner  

On Mon, 2007-06-04 at 14:57 -0700, Wm Mussatto wrote:
> On Mon, June 4, 2007 14:21, murthy gandikota said:
> > Hi
> >   When restoring a DB from a tar file, I had to repair some of the tables.
> > Whereas when the DB is started after a power failure, everything works
> > fine. I noticed this on RedHat linux and MySQL5.
> >
> >   Any thoughts?
> >
> >   Thanks
> >   Murthy
> >
> What was in the tar file?  If you tar'ed the data directory, it is almost
> guaranteed to fail since only part of the updated information may be
> actually written to disk.  If the power failure occurred on a system with
> a correctly configured UPS, mysql probably got a shut down command so the
> disk files were in a stable state.
> 
> Normally you should dump the databases and then tar that.  (see mysqldump
> command for details).
> 
> -------
> 
> William R. Mussatto, Senior Systems Engineer
> http://www.csz.com
> Ph. 909-920-9154 ext. 27
> FAX. 909-608-7061
> 
> 

Thread
Lock Tables QuestionDavid T. Ashley4 Jun
  • Re: Lock Tables QuestionGerald L. Clark4 Jun
    • Re: Lock Tables QuestionDavid T. Ashley4 Jun
      • RE: Lock Tables QuestionJerry Schwartz4 Jun
        • Re: Lock Tables QuestionDavid T. Ashley4 Jun
          • Re: Lock Tables QuestionGerald L. Clark4 Jun
            • Diff between restore from tar and recover from power outagemurthy gandikota4 Jun
              • Re: Diff between restore from tar and recover from power outageWm Mussatto4 Jun
                • Re: Diff between restore from tar and recover from power outageScott Tanner5 Jun
                  • Re: Diff between restore from tar and recover from power outagemos5 Jun
                    • Re: Diff between restore from tar and recover from power outageBaron Schwartz5 Jun
            • Re: Lock Tables QuestionDavid T. Ashley4 Jun
  • Re: Lock Tables QuestionBrent Baisley5 Jun
    • Re: Lock Tables QuestionDavid T. Ashley5 Jun
      • Re: Lock Tables QuestionBaron Schwartz5 Jun
        • Re: Lock Tables QuestionDavid T. Ashley5 Jun
          • Re: Lock Tables QuestionPaul McCullagh5 Jun