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'
闪回操作前启用行移动功能
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'
相关推荐
lklong 2020-11-22
oraclemch 2020-11-06
shilukun 2020-10-10
周嘉笙 2020-11-09
zhuzhufxz 2020-09-16
bfcady 2020-08-16
Hody 2020-08-16
FightFourEggs 2020-08-16
数据库设计 2020-08-16
yanghuatong 2020-08-16
dbasunny 2020-08-16
罗罗 2020-08-16
ihuaqiang 2020-08-16
choice0 2020-07-30
娜娜 2020-07-28
solarspot 2020-07-28
踩风火轮的乌龟 2020-07-26
娜娜 2020-07-20
xwb 2020-07-19
娜娜 2020-07-18
流云追风 2020-07-04
dataminer 2020-06-25
娜娜 2020-06-22
zhangchaoming 2020-06-21