oracle查询buffer cache中undo大小

1.Does undo buffer exists or changes will directly write to undo datafiles?

Undo blocks are database blocks, so they will sit in the buffer cache like others, eg
虽然无法控制undo buffer大小,但是可以查询到其大小,如下

SQL> select count(*)
  2  from v$bh
  3  where file# in (
  4    select file#
  5    from   v$datafile
  6    where  name like '%UNDO%' );

  COUNT(*)
----------
      5473




2.Does redo contains both undo & redo related changes?

Yes. Any change to any block (undo or otherwise) is protected by redo (unless explicitly instructed not to)


3.If db crashes with uncommitted data in undo buffer it will get cleared automatically ,then we are able rollback database with redo ? 

During instance restart, we do instance recovery. We use the redo logs to resurrect all the changes to database blocks, which *includes* undo blocks. Those undo blocks can then be used to undo any uncommitted transactions (ie, uncommitted at the time of the crash) 

 

in memory undo is a change in the way we manage undo for some transactions. We usually put undo in a block as you generate it - with in memory undo (IMU) we put the undo into a data structure instead - this data structure is easier/faster to process by queries that need the undo for read consistency purposes or rolling back. 

设计IMU控制的参数有:

_in_memory_undo Default is TRUE and enabled. To disable it change parameter to FALSE. 

_imu_pools Default is 3 on some system. This sets the number of IMU pools. It is not related to memory allocation for IMU. 

_recursuve_imu_transactions This enables Oracle’s own SQL to use IMU. Default is FALSE. 

_db_writer_flush_imu Allows Oracle the freedom to artificially age a transaction for increased automatic cache management.

可以直接通过下列查询到IMU大小:

SQL> select * from v$sgastat where name like 'KTI-UNDO'; 

POOL NAME BYTES 
------------ -------------------------- ---------- 
shared pool KTI-UNDO 8522272 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值