Thursday, 6 February 2014

kill sessions

1) To determine what session has a lock on this record, please execute the following steps:

a) Run the following to determine what tables are locked:

647

SELECT a.object_id, a.session_id, substr(b.object_name, 1, 40)
FROM v$locked_object a, dba_objects b
WHERE a.object_id = b.object_id
AND b.object_name like 'AP_%'
ORDER BY b.object_name;

b) Look at the results and insert whatever AP_% tables are returned from a) into the script below:

SELECT l.*, o.owner object_owner, o.object_name
FROM SYS.all_objects o, v$lock l
WHERE l.TYPE = 'TM'
AND o.object_id = l.id1
AND o.object_name in ('AP_INVOICES_ALL', 'AP_INVOICE_LINES_ALL', 'AP_INVOICE_DISTRIBUTIONS_ALL');

c) SELECT SID, SERIAL#
FROM v$session
WHERE SID in (647);

2) Once the locking sessions have been identified, please use the below command to kill such sessions.

ALTER SYSTEM KILL SESSION '647,38937' IMMEDIATE;

Find user in oracle apps by which table is locked.

select client_identifier from V$session where sid = 783

No comments:

Post a Comment