dbTalk Databases Forums  

How to undo changes / deletes ?

comp.databases comp.databases


Discuss How to undo changes / deletes ? in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
kunt
 
Posts: n/a

Default How to undo changes / deletes ? - 01-23-2008 , 11:51 AM






Hi all,
is there a way to undo changes in a database (e.g. those made because of
a recent human error, an erroneous delete/update query)

For example reversing all transactions made in the last N days?

On any database? In particular I am most interested in postgres and
mysql... secondarily Oracle.

Thank you

Reply With Quote
  #2  
Old   
DonO
 
Posts: n/a

Default Re: How to undo changes / deletes ? - 01-23-2008 , 02:16 PM






On Jan 23, 11:51 am, kunt <k... (AT) no (DOT) net> wrote:
Quote:
Hi all,
is there a way to undo changes in a database (e.g. those made because of
a recent human error, an erroneous delete/update query)

For example reversing all transactions made in the last N days?

On any database? In particular I am most interested in postgres and
mysql... secondarily Oracle.

Thank you
You can do "rollback" in Oracle I know. I think in MySQL as well if
the table is InnoDB I believe. This will only allow you to do so if a
"commit" has not been issued after the statement. It would typically
apply if you did something like this from a command line....

Quote:
DELETE * FROM tableName;
oh shit...

Quote:
ROLLBACK
If you're looking for data that's days old, I think you'll need a
backup strategy in place or redundant tables...

D.


Reply With Quote
  #3  
Old   
DonO
 
Posts: n/a

Default Re: How to undo changes / deletes ? - 01-23-2008 , 02:16 PM



On Jan 23, 11:51 am, kunt <k... (AT) no (DOT) net> wrote:
Quote:
Hi all,
is there a way to undo changes in a database (e.g. those made because of
a recent human error, an erroneous delete/update query)

For example reversing all transactions made in the last N days?

On any database? In particular I am most interested in postgres and
mysql... secondarily Oracle.

Thank you
You can do "rollback" in Oracle I know. I think in MySQL as well if
the table is InnoDB I believe. This will only allow you to do so if a
"commit" has not been issued after the statement. It would typically
apply if you did something like this from a command line....

Quote:
DELETE * FROM tableName;
oh shit...

Quote:
ROLLBACK
If you're looking for data that's days old, I think you'll need a
backup strategy in place or redundant tables...

D.


Reply With Quote
  #4  
Old   
DonO
 
Posts: n/a

Default Re: How to undo changes / deletes ? - 01-23-2008 , 02:16 PM



On Jan 23, 11:51 am, kunt <k... (AT) no (DOT) net> wrote:
Quote:
Hi all,
is there a way to undo changes in a database (e.g. those made because of
a recent human error, an erroneous delete/update query)

For example reversing all transactions made in the last N days?

On any database? In particular I am most interested in postgres and
mysql... secondarily Oracle.

Thank you
You can do "rollback" in Oracle I know. I think in MySQL as well if
the table is InnoDB I believe. This will only allow you to do so if a
"commit" has not been issued after the statement. It would typically
apply if you did something like this from a command line....

Quote:
DELETE * FROM tableName;
oh shit...

Quote:
ROLLBACK
If you're looking for data that's days old, I think you'll need a
backup strategy in place or redundant tables...

D.


Reply With Quote
  #5  
Old   
Michael Austin
 
Posts: n/a

Default Re: How to undo changes / deletes ? - 01-23-2008 , 02:45 PM



kunt wrote:
Quote:
Hi all,
is there a way to undo changes in a database (e.g. those made because of
a recent human error, an erroneous delete/update query)

For example reversing all transactions made in the last N days?

On any database? In particular I am most interested in postgres and
mysql... secondarily Oracle.

Thank you
delete from xyz;
rollback;
and there cannot be an autocommit (if so you are hosed) -- if not, the
rollback.

If it is recent - as in an hour ago -- it is called RESTORE FROM BACKUP

There is no "recycle bin" in Mysql.


Oracle has a "flashback area" not sure how extensive it can be, but no
other DB has that level of recovery.

Oracle also has logminer which allows you to restore from backup up to
the point of "doing something stupid" and then extract all other
transactions except the one that caused your problem.



Reply With Quote
  #6  
Old   
Michael Austin
 
Posts: n/a

Default Re: How to undo changes / deletes ? - 01-23-2008 , 02:45 PM



kunt wrote:
Quote:
Hi all,
is there a way to undo changes in a database (e.g. those made because of
a recent human error, an erroneous delete/update query)

For example reversing all transactions made in the last N days?

On any database? In particular I am most interested in postgres and
mysql... secondarily Oracle.

Thank you
delete from xyz;
rollback;
and there cannot be an autocommit (if so you are hosed) -- if not, the
rollback.

If it is recent - as in an hour ago -- it is called RESTORE FROM BACKUP

There is no "recycle bin" in Mysql.


Oracle has a "flashback area" not sure how extensive it can be, but no
other DB has that level of recovery.

Oracle also has logminer which allows you to restore from backup up to
the point of "doing something stupid" and then extract all other
transactions except the one that caused your problem.



Reply With Quote
  #7  
Old   
Michael Austin
 
Posts: n/a

Default Re: How to undo changes / deletes ? - 01-23-2008 , 02:45 PM



kunt wrote:
Quote:
Hi all,
is there a way to undo changes in a database (e.g. those made because of
a recent human error, an erroneous delete/update query)

For example reversing all transactions made in the last N days?

On any database? In particular I am most interested in postgres and
mysql... secondarily Oracle.

Thank you
delete from xyz;
rollback;
and there cannot be an autocommit (if so you are hosed) -- if not, the
rollback.

If it is recent - as in an hour ago -- it is called RESTORE FROM BACKUP

There is no "recycle bin" in Mysql.


Oracle has a "flashback area" not sure how extensive it can be, but no
other DB has that level of recovery.

Oracle also has logminer which allows you to restore from backup up to
the point of "doing something stupid" and then extract all other
transactions except the one that caused your problem.



Reply With Quote
  #8  
Old   
Lennart
 
Posts: n/a

Default Re: How to undo changes / deletes ? - 01-24-2008 , 12:24 PM



On Jan 23, 9:45 pm, Michael Austin <maus... (AT) firstdbasource (DOT) com> wrote:
[...]
Quote:
Oracle has a "flashback area" not sure how extensive it can be, but no
other DB has that level of recovery.

Really? What's wrong with Recovery Expert for DB2?

/Lennart



Reply With Quote
  #9  
Old   
Lennart
 
Posts: n/a

Default Re: How to undo changes / deletes ? - 01-24-2008 , 12:24 PM



On Jan 23, 9:45 pm, Michael Austin <maus... (AT) firstdbasource (DOT) com> wrote:
[...]
Quote:
Oracle has a "flashback area" not sure how extensive it can be, but no
other DB has that level of recovery.

Really? What's wrong with Recovery Expert for DB2?

/Lennart



Reply With Quote
  #10  
Old   
Lennart
 
Posts: n/a

Default Re: How to undo changes / deletes ? - 01-24-2008 , 12:24 PM



On Jan 23, 9:45 pm, Michael Austin <maus... (AT) firstdbasource (DOT) com> wrote:
[...]
Quote:
Oracle has a "flashback area" not sure how extensive it can be, but no
other DB has that level of recovery.

Really? What's wrong with Recovery Expert for DB2?

/Lennart



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.