Home >Database >Mysql Tutorial >oracle 数据库闪回相关语句介绍

oracle 数据库闪回相关语句介绍

WBOY
WBOYOriginal
2016-06-07 17:55:451337browse

本文将详细介绍oracle 数据库闪回相关语句,需要了解跟多的朋友可以参考下

1\将表闪回到某一时间点:

闪回操作前启用行移动功能

Sql代码
alter table emp enable row movement;

执行闪回语句:
Sql代码
flashback table emp to timestamp to_timestamp('20120709195000','YYYYMMDDHH24:MI:SS');

2\闪回回收站:
Java代码
SQL>show recyclebin;
SQL>drop table emp;
SQL>show recyclebin;
ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME
EMP BIN$b+XkkO1RS5K10uKo9BfmuA==$0 TABLE 2012-11-07:15:30:47

SQL>flashback table emp to before drop;或
SQL>flashback table "BIN$b+XkkO1RS5K10uKo9BfmuA==$0" to before drop;

清理回收站
清除回收站中的单个表:purge table emp
清除整个回收站:purge recyclebin
清除不同的对象回收站:purge user_recyclebin或purge dba_recyclebin
彻底删除一个table: SQL>drop table emp purge; --表不能被恢复了。

3\闪回事物查询:
Sql代码
select * from flashback_transaction_query where TABLE_NAME= 'EMP'
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn