oracle的闪回查询,闪回删除:
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了oracle的闪回查询,闪回删除:,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1844字,纯文字阅读大概需要3分钟。
内容图文
![oracle的闪回查询,闪回删除:](/upload/InfoBanner/zyjiaocheng/458/33e2dac29a9040e89b3e2c05f5d1531a.jpg)
-----------------
0
1 row selected.
SCOTT@ORA12C> select count(*) from t1 as of timestamp to_timestamp(‘2015-09-20 14:54:00‘,‘yyyy-mm-dd hh24:mi:ss‘);
COUNT(*)
-----------------
91692
1 row selected.
SCOTT@ORA12C> flashback table t1 to timestamp to_timestamp(‘2015-09-20 14:54:00‘,‘yyyy-mm-dd hh24:mi:ss‘);
flashback table t1 to timestamp to_timestamp(‘2015-09-20 14:54:00‘,‘yyyy-mm-dd hh24:mi:ss‘) *
ERROR at line 1:
ORA-08189: cannot flashback the table because row movement is not enabled
SCOTT@ORA12C> alter table t1 enable row movement;
Table altered.
SCOTT@ORA12C> flashback table t1 to timestamp to_timestamp(‘2015-09-20 14:54:00‘,‘yyyy-mm-dd hh24:mi:ss‘);
Flashback complete.
SCOTT@ORA12C> select count(*) from t1;
COUNT(*)
-----------------
91692
1 row selected.
注意system表空间下面的表不能闪回,不能跨越DDL语句,
SYS@ORA12C> flashback table t2 to timestamp to_timestamp(‘2015-09-20 15:07:25‘,‘yyyy-mm-dd hh24:mi:ss‘);
flashback table t2 to timestamp to_timestamp(‘2015-09-20 15:07:25‘,‘yyyy-mm-dd hh24:mi:ss‘) *
ERROR at line 1:
ORA-08185: Flashback not supported for user SYS
但是可以查询:
SYS@ORA12C> select count(*) from t2 as of timestamp to_timestamp(‘2015-09-20 15:07:25‘,‘yyyy-mm-dd hh24:mi:ss‘);
COUNT(*)
-----------------
91694
1 row selected.
可以重新建一张表或者直接insert:
SYS@ORA12C> create table t3 as select * from t2 as of timestamp to_timestamp(‘2015-09-20 15:07:25‘,‘yyyy-mm-dd hh24:mi:ss‘);
Table created.
SYS@ORA12C> insert into t2 select * from t2 as of timestamp to_timestamp(‘2015-09-20 15:07:25‘,‘yyyy-mm-dd hh24:mi:ss‘);
91694 rows created.
@ORA12C> commit;
Commit complete.
oracle的闪回查询,闪回删除:
标签:oracle闪回
本文系统来源:http://7642644.blog.51cto.com/7632644/1696517
内容总结
以上是互联网集市为您收集整理的oracle的闪回查询,闪回删除:全部内容,希望文章能够帮你解决oracle的闪回查询,闪回删除:所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。