top of page

Find locks present in oracle database

  • shiva ram
  • Oct 3, 2024
  • 1 min read

Below query will help you in providing sessions causing lock in the database.

col session_id head 'Sid' form 9999
col object_name head "Table|Locked" form a30
col oracle_username head "Oracle|Username" form a10 truncate
col os_user_name head "OS|Username" form a10 truncate
col process head "Client|Process|ID" form 99999999
col mode_held form a15
select lo.session_id,lo.oracle_username,lo.os_user_name,
lo.process,do.object_name,
decode(lo.locked_mode,0, 'None',1, 'Null',2, 'Row Share (SS)',
3, 'Row Excl (SX)',4, 'Share',5, 'Share Row Excl (SSX)',6, 'Exclusive',
to_char(lo.locked_mode)) mode_held
from v$locked_object lo, dba_objects do
where lo.object_id = do.object_id
order by 1,5
/

Recent Posts

See All
Monitor tablespace usage

Use below query to check all the space related details of tablespaces. set feedback off set pagesize 70; set linesize 2000 set head on...

 
 
 
Monitor UNDO tablespace usage

Use below script to get the details about undo tablespace usage. select a.tablespace_name, SIZEMB, USAGEMB, (SIZEMB - USAGEMB) FREEMB...

 
 
 
Monitor TEMP tablespace usage

Run the below scripts to get the temp tablespace usage. select a.tablespace_name tablespace, d.TEMP_TOTAL_MB, sum (a.used_blocks *...

 
 
 

Comments


CONTACT US

Join our mailing list

bottom of page