Posts

Showing posts from May, 2018

DB Blocking and log_switch_history

--Check the existing blocking sessions in database: set lines 130 pages 1000 col BLOCKING_STATUS for a100 select s1.INST_ID,s1.username || '@' || s1.machine || ' ( SID=' || s1.sid || ' )  is blocking ' || s2.username || '@' || s2.machine || ' ( SID=' || s2.sid || ' ) ' AS blocking_status from gv$lock l1, gv$session s1, gv$lock l2, gv$session s2 where s1.sid=l1.sid and s2.sid=l2.sid and l1.BLOCK=1 and l2.request > 0 and l1.id1 = l2.id1 and l2.id2 = l2.id2 / --Check internal blocking sessions which are holding in background: set lines 200 set pages 1000 col event for a40 col obj for a30 select inst_id,sid,blocking_session BSID,blocking_instance BINST,sql_id,event,last_Call_et,wait_time_micro, (select object_name from dba_objects where object_id = row_wait_obj#) obj, decode(event,'enq: TX - row lock contention',dbms_rowid.ROWID_CREATE(1,ROW_WAIT_OBJ#,ROW_WAIT_FILE#,ROW_WAIT_BLOCK#,ROW_WAIT_ROW#),null) rid f...