闪回数据================================================
恢复删除的数据,未删除表
select * from dc_std_code as of timestamp sysdate-5/1440;
查找数据
select * from dc_std_code as of timestamp to_timestamp('2015-09-30 16:03:00','YYYY-MM-DD hh24:mi:ss');
恢复数据
insert into dc_std_code select * from dc_std_code as of timestamp to_timestamp('2015-09-30 16:03:00','YYYY-MM-DD hh24:mi:ss');
获取当前数据的svn 918515
SELECT CURRENT_SCN FROM V$DATABASE;
查询svn的数据
select * from dc_std_code as of scn 918515;
恢复数据
insert into dc_std_code select * from A as of scn 918515; alter table DC_STD_CODE enable row movement
flashback table DC_STD_CODE TO TIMESTAMP to_timestamp('2015-09-30 12:00:00','yyyy-mm-dd hh24:mi:ss');
FLASHBACK TABLE "BIN$04LhcpnoanfgMAAAAAANPw==$0" TO BEFORE DROP RENAME TO dc_std_code1;
FLASHBACK TABLE "BIN$04LhcpnqanfgMAAAAAANPw==$0" TO BEFORE DROP RENAME TO dc_std_code2;
SELECT OBJECT_NAME, ORIGINAL_NAME, TYPE
FROM USER_RECYCLEBIN
WHERE BASE_OBJECT = (SELECT BASE_OBJECT FROM USER_RECYCLEBIN
WHERE ORIGINAL_NAME = 'DC_STD_CODE2')
AND ORIGINAL_NAME != 'DC_STD_CODE2';
清理回收站
Purge recyclebin
闪回库==============================================================
开启恢复数据库功能
SHUTDOWN IMMEDIATE
STARTUP MOUNT
查看数据库状态
alter database open;
数据库恢复
shutdown immediate
startup mount
恢复数据库到某一个时间点
Flashback database to timestamp to_timestamp('09-10-14 14:37:05','yy-mm-dd hh24:mi:ss');
Flashback database to scn 947921;
alter database open;
恢复记录日志
alter database open resetlogs;
startup mount
recover database until time '2016-06-30:15:50:00'
alter database open resetlogs