2、闪回查询15分钟前的数据
select * from 表名 as of timestamp (sysdate-15/1440);
查询指定时间的数据
SELECT * FROM t1 AS OF TIMESTAMP TO_TIMESTAMP('2022-10-13 11:25:17', 'YYYY-MM-DD HH:MI:SS');
保存闪回数据
create table xxxx_bak as select * from t1 AS OF TIMESTAMP TO_TIMESTAMP('2022-10-13 11:25:17', 'YYYY-MM-DD HH:MI:SS');
3、回退改修改
UPDATE xxx t SET col1 = (
select col1 from xxx_bak where t.sl= ms.sl
)
WHERE exists(
select 1 from xxx_bak ms where t.sl = ms.sl
);
4、查看undo空间大小
select sum(bytes)/1024/1024 "current undo size(M)" from dba_data_files where tablespace_name='UNDOTBS1';
查看undo设置:
show parameter undo
select value from v$parameter where name ='undo_retention'
更新undo retention 时间大小
rac:
alter system set undo_retention=14400 sid='xxx' SCOPE=BOTH;
alter system set undo_retention=14400 sid='xxx' SCOPE=BOTH;
single:
alter system set undo_retention=14400 SCOPE=BOTH;




