RAC 11gR2
Application Context for more usefull and simple Its new Feature in ORACLE RAC 11G
DBMS_APPLICATION_INFO to use and diagnose where the application creating a problem.And why query hang else what ever follow steps .
exec dbms_application_info.set_module(module_name => 'UPDATE RECORD', action_name => 'UPDATE TAB1');
exec DBMS_APPLICATION_INFO.SET_CLIENT_INFO(CLIENT_INFO => 'SUNRAY');
UPDATE TAB1 SET COL1='UPDATED';
create table TAB1 (COL1 varchar2(10)); --- Session 1
insert into tab1 values ('FIRST'); --- Session 1
update tab1 set col1='SECOND'; --- Session 2
Now the Session 2 is hang and going to waiting forever because the same row is beaing updated by another session i.e. Session2 and not commit but session 1
Because we set application context using the DBMS_APPLICATION_INFO package, we can easily identify the problematic code location via the simple query
select sid,event,module,action,client_info
from v$session where state='WAITING' and
WAIT_CLASS='Application';
-------------------
Else old method ---- v$session, v$process, v$sesison_wait, v$system_wait, dba_objects.
Application Context for more usefull and simple Its new Feature in ORACLE RAC 11G
DBMS_APPLICATION_INFO to use and diagnose where the application creating a problem.And why query hang else what ever follow steps .
exec dbms_application_info.set_module(module_name => 'UPDATE RECORD', action_name => 'UPDATE TAB1');
exec DBMS_APPLICATION_INFO.SET_CLIENT_INFO(CLIENT_INFO => 'SUNRAY');
UPDATE TAB1 SET COL1='UPDATED';
create table TAB1 (COL1 varchar2(10)); --- Session 1
insert into tab1 values ('FIRST'); --- Session 1
update tab1 set col1='SECOND'; --- Session 2
Now the Session 2 is hang and going to waiting forever because the same row is beaing updated by another session i.e. Session2 and not commit but session 1
Because we set application context using the DBMS_APPLICATION_INFO package, we can easily identify the problematic code location via the simple query
select sid,event,module,action,client_info
from v$session where state='WAITING' and
WAIT_CLASS='Application';
-------------------
Else old method ---- v$session, v$process, v$sesison_wait, v$system_wait, dba_objects.
No comments:
Post a Comment