BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for Linux: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
Oralce 10g是否使用由隐含参数_in_memory_undo决定,默认情况为TRUE。
引用
_in_memory_undo TRUE Make in memory undo for top level transactions
此外imu还涉及以下参数
imu pool在shard_pool分配的个数,注意此参数和实际分配的个数不符,只作为阀值存在:
引用
_imu_pools 3 in memory undo pools
DBWR是否刷新imu pool:
引用
_db_writer_flush_imu TRUE If FALSE, DBWR will not downgrade IMU txns for AGING
递归操作是否启动imu:
引用
_recursive_imu_transactions FALSE recursive transactions may be IMU
基于以上参数我们再深入探索。
查看imu pool在shared_pool分配的大小,可以看到在shared_pool中分配了1235304 BYTES。
引用
SQL> select * from v$sgastat where name='KTI-UNDO';
POOL NAME BYTES
------------ ---------------------------------------- ----------
shared pool KTI-UNDO 1235304
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
transactions integer 187
SQL> select KTIFPNO,KTIFPPSI from X$KTIFP;
Oracle alert日志也可以看到分配给imu pool数量,用ILAT =18表示
引用
Autotune of undo retention is turned on.
IMODE=BR
ILAT =18
LICENSE_MAX_USERS = 0
SYS auditing is disabled
通过以下视图可以查看Oracle触发imu刷新内存的条件
引用
SQL> col INDX for 999
SQL> col KTIFFCAT for a50
SQL> select indx,ktiffcat,ktiffflc from X$KTIFF;
INDX KTIFFCAT KTIFFFLC
---- -------------------------------------------------- ----------
0 Undo pool overflow flushes 0
1 Stack cv flushes 34142
2 Multi-block undo flushes 0
3 Max. chgs flushes 51607
4 NTP flushes 492
5 Contention flushes 679
6 Redo pool overflow flushes 1
7 Logfile space flushes 0
8 Multiple persistent buffer flushes 0
9 Bind time flushes 0
10 Rollback flushes 4945
当系统启用imu,部分事务即可通过imu提交。
引用
SQL> select name,value from v$sysstat where name like '%commits%';
NAME VALUE
---------------------------------------------------------------- ----------
user commits 42785
IMU commits 40411
当然了Oracle使用imu特性也是通过latch保护的,每一个imu pool都有相应的latch保护。每个事务独立的使用imu pool。
引用
SQL> select LATCH#,NAME,GETS,MISSES from v$latch where name ='In memory undo latch';
LATCH# NAME GETS MISSES
---------- ---------------------------------------- ---------- ----------
192 In memory undo latch 14548635 74
SQL> select NAME,GETS,MISSES from v$latch_children where name='In memory undo latch';
NAME GETS MISSES
---------------------------------------- ---------- ----------
In memory undo latch 2997946 31
In memory undo latch 286606 4
In memory undo latch 6641899 13
In memory undo latch 4328804 13
In memory undo latch 113778 13
In memory undo latch 121081 0
In memory undo latch 58811 0
In memory undo latch 0 0
In memory undo latch 0 0
In memory undo latch 0 0
In memory undo latch 0 0
NAME GETS MISSES
---------------------------------------- ---------- ----------
In memory undo latch 0 0
In memory undo latch 0 0
In memory undo latch 0 0
In memory undo latch 0 0
In memory undo latch 0 0
In memory undo latch 0 0
In memory undo latch 0 0