閃回 Flashback

 閃回 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 權限。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章