This work is licensed under a Creative Commons Attribution-NonCommercial 2.5 License.


Oracle Apps FND User name Locks Record



Ever wondered how to find the person in Oracle Apps that locks a specific record?
Its simple, I find this SQL quite useful. Blaah, you will know the user that is sleeping over the record by locking it. This SQL joins the locking session to FND_USER, so as to display the APPS User Name of the person that locks the record.

In the example below, lets say we need to find the list of people that are locking tables in Purchasing. Aslo, lets assume we need to find the screen/conc process that locks the record.

SELECT c.owner
,c.object_name
,c.object_type
,fu.user_name locking_user_name
,fl.start_time
,vs.module
,vs.machine
,vs.osuser
,vs.sid
,vp.pid
,vp.spid AS os_process_to_kill
,vs.serial#
,vs.status
,vs.saddr
,vs.audsid
,vs.process
FROM fnd_logins fl
,fnd_user fu
,v$locked_object vlocked
,v$process vp
,v$session vs
,dba_objects c
WHERE vs.sid = vlocked.session_id
AND vlocked.object_id = c.object_id
AND vs.paddr = vp.addr
AND vp.spid = fl.process_spid(+)
AND vp.pid = fl.pid(+)
AND fl.user_id = fu.user_id(+)
AND c.object_name LIKE 'PO%';


OWNER PO
OBJECT_NAME PO_HEADERS_ALL
OBJECT_TYPE TABLE
LOCKING_USER_NAME PASSIANIL
START_TIME 26-SEP-2006
MODULE POXPOEPO
MACHINE xxappsserver01
OSUSER Xxtstuser
SID 2785
PID 661
OS_PROCESS_TO_KILL 27975
SERIAL# 5518
STATUS INACTIVE
SADDR 000000077DD814F0
AUDSID 13482253
PROCESS 3563

Comments on ""

 

Anonymous Anonymous said ... (10:35 PM) : 

Thanks!

 

Anonymous Anonymous said ... (5:56 AM) : 

it is quite good..

 

post a comment