Emergency ----- Database Emptied - Loss Everything - What can be done??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • peter.mathews@gmail.com

    Emergency ----- Database Emptied - Loss Everything - What can be done??

    Hello,
    I have ran a script in which I created a temporary table and dropped
    the table at the end of the script. Unfortuantely not only was this
    table dropped but all of the other tables in the database were dropped
    as well.

    Unfortuantely, the backups are made every day at midnight. So all of
    the information for the past 23 hours has been currently destroyed.

    What I need to know.

    1. Is there anyway of recovering this data.
    2. And 2 is this a common occurence with temporary tables. btw - I am
    a newbie and more than open to being in the wrong.

    Specs are as follows

    Linux, Php, Apache, Mysq 4.1.10

  • Bill Karwin

    #2
    Re: Emergency ----- Database Emptied - Loss Everything - What canbe done??

    peter.mathews@g mail.com wrote:[color=blue]
    > Hello,
    > I have ran a script in which I created a temporary table and dropped
    > the table at the end of the script. Unfortuantely not only was this
    > table dropped but all of the other tables in the database were dropped
    > as well.
    >
    > Unfortuantely, the backups are made every day at midnight. So all of
    > the information for the past 23 hours has been currently destroyed.[/color]

    Yeah, this points out a principle of backups: run backups on a schedule
    such that you can tolerate lost data of the full backup interval. That
    is, if your business can tolerate only 1 hour of lost data, make the
    backups every hour.
    [color=blue]
    > 1. Is there anyway of recovering this data.[/color]

    Probably not. All I can suggest is that if you use MyISAM tables, you
    might be able to use an "undelete" tool. Depending on your operating
    system, there might be an undelete tool that can read the raw bytes on
    the disk device and reconstruct the file. But it's possible that some
    other file activity has overwritten that area of the disk by now. I
    don't have much experience with undelete tools, so I can't say if it
    will help in the case of a

    If you use InnoDB tables, I bet it's even more tricky to recover dropped
    tables. I have no suggestion in this case.
    [color=blue]
    > 2. And 2 is this a common occurence with temporary tables.[/color]

    No, that's not common in my experience. It should be relatively
    straightforward that "DROP [TEMPORARY] TABLE tableName" drops only one
    table. You can use the TEMPORARY keyword, and it will drop the named
    table only if it's a temporary table.

    Read http://dev.mysql.com/doc/mysql/en/drop-table.html for more information.

    Regards,
    Bill K.

    Comment

    • peter.mathews@gmail.com

      #3
      Re: Emergency ----- Database Emptied - Loss Everything - What can be done??

      Thank you for the reply. Point taken about back-ups.

      Sounds as if this is less a mysql issue now and more of a linux file
      recovery issue. I'll take up more hunt there.

      thanks again.

      Comment

      Working...