Chinaunix首页 | 论坛 | 博客
  • 博客访问: 251146
  • 博文数量: 110
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 115
  • 用 户 组: 普通用户
  • 注册时间: 2016-07-22 15:26
个人简介

10多年的信息工作,随时记录心得和资料,希望能结识更多的朋友

文章分类

全部博文(110)

文章存档

2017年(12)

2016年(12)

2015年(14)

2014年(12)

2009年(15)

2008年(45)

我的朋友

分类: Oracle

2009-07-13 16:22:13

开发人员今天不小心误删除了某个表中的部分数据,需要恢复回来,下面利用oracle flashback闪回误删除的表数据

注意:flashback table 需要下面几个条件

1.       需要有flashback any table的系统权限或者是flashback这个表的对象权限;

2.       需要有对这个表的基本的dmlalter操作权限;

3.       必须保证该表row movement(这主要是让flashback记住表的rowid)

具体的操作为:

SQL> flashback table tb_task_info to timestamp to_timestamp('2009-07-13 14:30:00','yyyy-mm-dd hh24:mi:ss');

 

flashback table tb_task_info to timestamp to_timestamp('2009-07-13 14:30:00','yyyy-mm-dd hh24:mi:ss');

 

ORA-08189: cannot flashback the table because row movement is not enabled

但是抛出了8189错误,原因就是因为表没有row movement,改变下表的属性:

SQL> alter table tb_task_info enable row movement;

 

Table altered

然后再执行上面的闪回操作

SQL> flashback table tb_task_info to timestamp to_timestamp('2009-07-13 14:30:00','yyyy-mm-dd hh24:mi:ss');

 

Done

查询原来的表误删除的数据闪回回来了.

阅读(951) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~