如何还原Oracle表中的数据? [英] How to restore the data in a Oracle table?

查看:105
本文介绍了如何还原Oracle表中的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在工作中犯了一个严重错误,我在oracle表上执行了更新的查询,而没有'where'子句,并且此表上的所有内容都发生了变化,我想知道是否有任何方法可以恢复表上的数据.我知道我可以使用闪回,但是还有另一种方法吗?如果您知道如何在oracle中制作闪回表,请告诉我.

I did a terrible mistake on my work, I executed an updated query on a oracle table without the 'where' clause and everything changed on this table, I was wondering if there is any way to restore the data on a table. I know I can use Flashback, but Is there another way to do that? If you know how to make a flashback table in oracle, please let me know.

我正在使用Oracle 10g R2 10.2.0.1

I'm using Oracle 10g R2 10.2.0.1

推荐答案

首先,您是否提交了更改?如果没有,您只需发出rollback即可还原您的更改.

First, did you commit the change? If not, you can simply issue a rollback to revert your changes.

假设您确实提交了更改,其他用户是否同时修改了该表?您是否需要保留其他人所做的更改,而仅还原您在交易中所做的更改?还是可以将整个表还原到进行更改之前的某个时间点?

Assuming that you did commit your changes, are other users modifying the table at the same time? Do you need to preserve the changes that others have made and only revert the changes you made in your transaction? Or can you restore the entire table to a point in time before your changes were made?

如果您可以将整个表恢复到某个时间点

If you can restore the entire table to a point in time

FLASHBACK TABLE <<table name>>
  TO TIMESTAMP( systimestamp - interval '10' minute )

会将表恢复到10分钟前的状态,前提是执行此操作所需的UNDO保持可用(因此,您在犯错后只有有限的时间可以闪回该错误).为了发布FLASHBACK TABLE,您还必须确保

will return a table to the state it was in 10 minutes ago assuming that the UNDO necessary to do so remains available (so you only have a limited time after making a mistake to be able to flashback that mistake). In order to issue a FLASHBACK TABLE, you also have to make sure that

  • 表已启用行移动ALTER TABLE <<table name>> ENABLE ROW MOVEMENT
  • 您必须在表上具有FLASHBACK特权或FLASHBACK ANY TABLE系统特权.
  • The table has enabled row movement ALTER TABLE <<table name>> ENABLE ROW MOVEMENT
  • You must have FLASHBACK privileges on the table or the FLASHBACK ANY TABLE system privilege.

这篇关于如何还原Oracle表中的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆