加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

闪回 Flashback

发布时间:2020-12-15 18:17:18 所属栏目:百科 来源:网络整理
导读:?闪回 Flashback 存储过程 set pagesize 9999 spool /home/oracle/WLB_CONFIRM_UP.txt select text from dba_source as of timestamp to_timestamp ('2012-05-10 12:13:00','yyyy-mm-dd hh24:mi:ss') where name = 'WLB_CONFIRM_UP' and owner='WZOLSCM'; sp

?闪回 Flashback 存储过程
set pagesize 9999
spool /home/oracle/WLB_CONFIRM_UP.txt
select text from dba_source as of timestamp to_timestamp('2012-05-10 12:13:00','yyyy-mm-dd hh24:mi:ss')
where name = 'WLB_CONFIRM_UP' and owner='WZOLSCM';
spool off


基本的闪回查询
任何 select 语句可以针对以前某个版本的表。下面的示例:
select * from scott.emp;
select sysdate from dual;
delete from scott.emp where empno = 7369;
commit;

下面这个误删除行和正确的行都显示
select * from scott.emp as of timestamp to_timestamp('2011-07-12 23:57:11','yyyy-mm-dd hh24:mi:ss');

下面这个只显示删除的行,以了解删除了哪些行。该查询的输出可以用于修复目的,以便将那些行重新插入回表中。
select * from scott.emp as of timestamp to_timestamp('2011-07-12 23:57:11','yyyy-mm-dd hh24:mi:ss') minus select * from scott.emp;



drop table <table_name> purge;
删除表并且不将它转移到回收站。

purge table <table_name>;
从回收站中清除表。如果存在多个具有相同原始名称的对象,那么将清除时间最久的对象。也可以通过指定回收站名称来避免这种混淆。

purge index <index_name>;
从回收站中清除索引---这里同样可以指定原始名称或回收站名称。

purge tablespace <tablespace_name>;
表空间中清除所有删除的对象。

purge tablespace <tablespace_name> user <user_name>;
表空间中清除属于一个用户的所有删除的对象。

purge user_recyclebin;
清除删除的所有对象。

purge dba_recyclebin;
清除所有删除的对象,但是执行它需要 DBA 权限。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读