暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

误删除回退

www 2025-03-05
157

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;

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论