温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

sql中retention guarantee使用场景和作用有哪些

发布时间:2021-11-10 09:28:15 来源:亿速云 阅读:201 作者:小新 栏目:关系型数据库

小编给大家分享一下sql中retention guarantee使用场景和作用有哪些,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!

 SQL>alter tablespace undo_samll retention guarantee; 表空间已更改。 

SQL> select tablespace_name,block_size,extent_management  segment_space_management,contents,retention from dba_tablespaces; 

需要注意的是这种guarantee模式只针对undo tablespace别的表空间是不适用的。 

在Oracle 10g中我们还可以设置undo_retention=0来让Oracle自动调整保留提交后undo信息的时间。       



10g RETENTION GUARANTEE 的作用  

1、先解释下undo_retention 

设置undo_retention,保证commit 后的数据在undo segment中保留多长时间。但是并不能保证commit后的undo 信息在undo_retention的时间内一定不被覆写,当undo segment不够时,还是会覆盖已commitundo 信息。 

2、如果需要保证在undo_retention时间内undo 信息一定不被覆写的话,可以对undo segment设置RETENTION GUARANTEE。但是这个参数受到undo_retentionundo size的限制。如果undo size 太小,undo_retention设置太久,设置retention guarantee 时就会报错:   

ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDOTBS2'   

3、设置该参数 

 alter tablespace undotbs2 retention guarantee;   

撤销该参数 

 alter tablespace undotbs2 retention noguarantee; 

看完了这篇文章,相信你对“sql中retention guarantee使用场景和作用有哪些”有了一定的了解,如果想了解更多相关知识,欢迎关注亿速云行业资讯频道,感谢各位的阅读!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

sq
AI