flashbackup闪回数据库

某时间删除了一个表
SQL> delete test1;

50000 rows deleted.

1、关闭数据库,启动到mount状态(abort数据库能快速关闭,但是可能会丢数据)
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup mount;

2、基于时间戳闪回数据库(20:55)
SQL> flashback database to timestamp to_timestamp('2015-09-22 20:55:00','yyyy-mm-dd hh24:mi:ss');

Flashback complete.
3、以只读模式打开数据库
SQL> alter database open read only;

Database altered.

4、查看表是否闪回
SQL>select count(*) from test1;

  COUNT(*)
----------
     50000
5、上述说明20:55分数据库是没有删除的,而数据库其他的表也有读写数据,所以尽可能的闪回到表被删除的那个时间的临界点

6、关闭数据库
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup mount;

7、基于时间戳闪回数据库(20:59)
SQL> flashback database to timestamp to_timestamp('2015-09-22 20:59:00','yyyy-mm-dd hh24:mi:ss');

Flashback complete.

8、以只读模式打开数据库
SQL> alter database open read only;

Database altered.

9、查看表是否存在
SQL> select count(*) from test1;

  COUNT(*)
----------
         0
10、重复执行基于时间闪回数据库(20:57)
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup mount;
SQL> flashback database to timestamp to_timestamp('2015-09-22 20:57:00','yyyy-mm-dd hh24:mi:ss');

Flashback complete.
SQL> alter database open read only;

11、查看表是否存在
SQL> select count(*) from test1;

  COUNT(*)
----------
     50000

12、以RESETLOGS模式打开数据库,让数据库日志重置
SQL> alter database open resetlogs;

Database altered.         

 

转载于:https://www.cnblogs.com/houzhiqing/p/4833378.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值