Friday, February 4, 2022

Max_idle_blocker_time Parameter

One of the new parameter introduced in oracle 21c (but backported to 19c, could see this parameter available in 19.12 version) is the MAX_IDLE_BLOCKER_TIME Parameter.
 
The role of this parameter is to control the blocking session piling up in the instance. If a blocking session is pretty much idle, all the other possibly many blocked sessions do not have to keep waiting until the blocker session issue commit or rollback.
 
Incase of Oracle 19c database, we could specify an amount of time that a session can be idle after which it can be terminated via the resource plan directive MAX_IDLE_TIME, but there was no option related to limiting idle time for a session which was blocking all other session. However, that was now possible in Oracle 21c.
 
c##rajesh@XEPDB1> show parameter max_idle_blocker_time
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- -------------------
max_idle_blocker_time                integer     0
 
c##rajesh@XEPDB1> alter system set max_idle_blocker_time=1;
 
System altered.
 
From the session#1 perform an update but do not commit or rollback.
 
c##rajesh@XEPDB1> update scott.emp
  2  set sal = sal+1
  3  where deptno = 10;
 
3 rows updated.
 
From session#2 performing update on the same rows hangs like this
 
demo@XEPDB1> conn demo/demo@pdb1
Connected.
demo@XEPDB1> set timing on
demo@XEPDB1> update scott.emp set comm = 0;
 
After a minute session#1 terminates automatically, because it was idle
 
c##rajesh@XEPDB1> select * from dual;
select * from dual
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 3728
Session ID: 392 Serial number: 53450
 
 
ERROR:
ORA-03114: not connected to ORACLE
 
Session#2 transaction is completed as there is no row level lock now.
 
demo@XEPDB1> update scott.emp set comm = 0 ;
 
14 rows updated.
 
Elapsed: 00:00:56.37
 
 

No comments:

Post a Comment