Query To Kill Locked Object's Session

Hi ,
Im trying to write script to getting sid & Serial# for frequently locked objects in my database.
i have tried with 3 ways as following, Pl Guide me for choosing better.
Query 1:
SELECT SID,SERIAL# FROM V$SESSION WHERE SID IN (SELECT SID FROM V$LOCKED_OBJECT WHERE OBJECT_ID IN ('34943','34957','34966')));
Query 2:
select
     sess.sid,
     sess.serial#
from
     v$locked_object lo,
     dba_objects ao,
     v$session sess
where
ao.object_id = lo.object_id
     and
lo.session_id = sess.sid
     AND
AO.OBJECT_ID IN('34943','34957','34966');
Query 3:
select
sid,
serial#
from
select
sid,
serial#
from
v$session
) y,
select
b.session_id
from
select
object_id,
session_id,
locked_mode
from
v$locked_object
) b,
select
object_id,
object_name,
owner
from
dba_objects
where
object_name in ('PMA_DEFECT_DETAILS',
'PMA_DEFECT_HEADER',
'PMA_DEFECT_TRANS')
) c
Where
b.object_id = c.object_id
) x
Where
x.session_id = y.sid ;
Edited by: Abk on Jan 2, 2009 6:31 PM
Edited by: Abk on Jan 2, 2009 6:34 PM

Hi..
To know the lock you can use the query below, you will know the sid and find the serial# from v$session.
>
col sid for 9999
col id1 for 99999999
col id2 for 99999999
col lmode head "Lock Held" form a14
col request1 head "Lock Request" form a16
col type head "Lock Type" form a40
col ctime head "Time Held" form 99999
select sid,
DECODE(TYPE,
'BL','Buffer hash table',
'CF','Control File Transaction',
'CI','Cross Instance Call',
'CS','Control File Schema',
'CU','Bind Enqueue',
'DF','Data File',
'DL','Direct-loader index-creation',
'DM','Mount/startup db primary/secondary instance',
'DR','Distributed Recovery Process',
'DX','Distributed Transaction Entry',
'FI','SGA Open-File Information',
'FS','File Set',
'IN','Instance Number',
'IR','Instance Recovery Serialization',
'IS','Instance State',
'IV','Library Cache InValidation',
'JQ','Job Queue',
'KK','Redo Log "Kick"',
'LS','Log Start/Log Switch',
'MB','Master Buffer hash table',
'MM','Mount Definition',
'MR','Media Recovery',
'PF','Password File',
'PI','Parallel Slaves',
'PR','Process Startup',
'PS','Parallel Slaves Synchronization',
'RE','USE_ROW_ENQUEUE Enforcement',
'RT','Redo Thread',
'RW','Row Wait',
'SC','System Commit Number',
'SH','System Commit Number HWM',
'SM','SMON',
'SQ','Sequence Number',
'SR','Synchronized Replication',
'SS','Sort Segment',
'ST','Space Transaction',
'SV','Sequence Number Value',
'TA','Transaction Recovery',
'TD','DDL enqueue',
'TE','Extend-segment enqueue',
'TM','DML enqueue',
'TS','Temporary Segment',
'TT','Temporary Table',
'TX','Transaction',
'UL','User-defined Lock',
'UN','User Name',
'US','Undo Segment Serialization',
'WL','Being-written redo log instance',
'WS','Write-atomic-log-switch global enqueue',
'XA','Instance Attribute',
'XI','Instance Registration',
decode(substr(TYPE,1,1),
'L','Library Cache ('||substr(TYPE,2,1)||')',
'N','Library Cache Pin ('||substr(TYPE,2,1)||')',
'Q','Row Cache ('||substr(TYPE,2,1)||')',
'????')) TYPE,
id1,id2,
decode(lmode,
0,'None(0)',
1,'Null(1)',
2,'Row Share(2)',
3,'Row Exclu(3)',
4,'Share(4)',
5,'Share Row Ex(5)',
6,'Exclusive(6)') lmode,
decode(request,
0,'None(0)',
1,'Null(1)',
2,'Row Share(2)',
3,'Row Exclu(3)',
4,'Share(4)',
5,'Share Row Ex(5)',
6,'Exclusive(6)') request1,
ctime, decode(BLOCK,
          0, 'Not Blocking',
          1, 'Blocking',
          2, 'Global',block) status
from
v$lock
where sid>5
and type not in ('MR','RT')
order by decode(request,0,0,2),block,5
==================================================
To know the session:--
col username for a20
col program for a20
col osuser for a15
SELECT NVL(s.username, '(oracle)') AS username,
s.osuser,
s.sid,
s.serial#,
p.spid,
s.status,
s.module,
s.machine,
s.program,
TO_CHAR(s.logon_Time,'DD-MON-YYYY HH24:MI:SS') AS logon_time
FROM v$session s,
v$process p
WHERE s.paddr = p.addr
ORDER BY s.username, s.osuser;
>
HTH
Anand

Similar Messages

  • How to find locked object query?

    There is random error ORA-00054 coming during execution of one process which is using SELECT FOR UPDATE NO WAIT statement.
    Logs of process is showing row is accessed only once but still it gets error of "resource busy".
    So there must be any other session which is locking object and it is not identifid. I want to identify which other session/user is locking object.
    I am trying with below query which shows session id, terminal name and object name which is locked.
    SELECT a.sid,a.serial#, a.username,c.os_user_name,a.terminal,
    b.object_id,substr(b.object_name,1,40) object_name,sysdate
    from v$session a, dba_objects b, v$locked_object c
    where a.sid = c.session_id
    and b.object_id = c.object_id But i want information of SQL query from v$sqltext so i can find out throughout the applicaiton where it is executed?
    Thanks

    Finding session that it locking is not a problem.
    Finding SQL responsible is not necessarily straightforward.
    You might be lucky. You might not.
    If the SQl responsible for locking the row ran for a long time or was blocked by something else, AND you're on version >= 10g AND you're licensed for Diagnostic Pack, then you should find some evidence in ASH - DBA_HIST_ACTIVE_SESS_HISTORY.
    Doug Burns has a 10-part series on the subject.
    http://oracledoug.com/serendipity/index.php?/archives/1477-Diagnosing-Locking-Problems-using-ASH-Part-1.html
    There is another current thread on the same issue:
    How to find sql statement which generates LOCK

  • Query about SAP locks /enqueue objects

    I have created an lock object for a bespoke table which has 5 key fields.  For arguments sake let's call them
    WERKS QMGRP QMCOD OTGRP OTEIL.
    The problem I have is the following:
    User 1 has a house profile that can access the following data:
    WERKS QMGRP QMCOD OTGRP OTEIL
    9026  HOUSE CUST
    User 2  has a functional profile which gives them access to the following:
    WERKS QMGRP QMCOD OTGRP OTEIL
    9026  HOUSE CUST 
    9026  HOUSE CUST   CS    C001
    9026  HOUSE CUST   CS    C002
    I am building a front-end to the table to enable the users to change data associated with these keys.  My problem is the following.  If User 2 locks the entries,(s)he has access to first, the user 1 entry will be locked to changes,  which is correct.  If, however, user 1 locks its entry first, <b>all</b> of user 2's entries are locked even though only the first entry is allowed to be accessed by both.  I think this is happening because the SAP lock object does not recognise '   ' '    ' as a separate value to 'CS' 'C001'.  It thinks because 9026 HOUSE CUST '   ' '    ' is locked, then the other entries should be locked because they share 9026 HOUSE CUST from the key, even though there are other values in the key following 9026 HOUSE CUST.
    What I want is if user 1 locks its entry first, then only the entry that matches the key  totally for user 2 is locked, leaving the other 2 entries to which user 2 has access free to be edited.
    Is there a way I can get the SAP lock object to recognise this eitehr by changing the enqueue function module or by the way I cal the enqueue object or not?
    Any help would be appreciated.
    Hope this makes sense
    Larissa

    Hi Larissa,
    As far as I know, You cannot change generated enqueue function module. The other way as i think might work would be to create a new FM and do manipulation (for space to be changed as some other value) before calling this generated Enqueue FM.
    Hope this helps.
    Regards,
    Vicky
    PS: Award points if helpful

  • Locked Objects

    Hi,
    I want to ask is that if i can find any objects in the V$locked_Object then do i need to kill those sessions always????
    The thing is when i see some objects in the locked_objects i am looking for the query which is locking the object. But after some that that sesssion removed from V$locked_Object
    Sometimes if i track any locked object and find the query related to it that time query is normal query of SELECT.
    1. So do i need to worry about it to resolve lock? And always i need to kill that session which is in V$Locked_Object.
    2. Also please let me know how can i check which SQL statements in a day locking objects in the database Can we check this one?
    Please give any idea about.

    DBA_BLOCKERS lists the sessions that hold a lock that another session is blocked on a request for. DBA_WAITERS lists the sessions that are blocked requesting a lock that some other session holds. Are you seeing any rows in these tables? If we're talking about a bunch of sessions that are taking out row share locks, for example, there's nothing to be concerned about because those aren't (generally) going to block anyone else.
    If you are, are the blocks resolving themselves? A session that takes out a lock might block another session temporarily, but as long as the blocker finishes its processing and releases the lock within a reasonable time frame, the waiter should be able to continue after the lock is released. There may be options to redesign the application so that the blocker locks fewer objects/ fewer rows/ holds the lock for less time in order to decrease contention, but certainly nothing that would require DBA intervention.
    The case where a DBA needs to be involved is when
    - A session takes out a lock that is capable of blocking other sessions
    - For whatever reason, that session fails to release the lock
    - One (or more) other sessions are blocked waiting for the lock to be released
    The classic example of this would be an application that was poorly designed to do pessimistic locking and to hold locks across user interactions. So if an application does a SELECT FOR UPDATE to lock a particular row and holds that row while waiting for a human to do something, but the human decides to go to lunch/ work in a different application/ go on vacation, every other user that tries to lock that same row is going to block, which can be highly unpleasant.
    Justin

  • Ora-04021 timeout occurred while waiting to lock object

    Hai All
    When adding a column into a table then an error comes error
    Error Message:
    ORA-04021: timeout occurred while waiting to lock object .....
    How it happens ...what is the solution....please help
    Shiju..

    Hi
    Identify the session that is using this object, kill it and then perform the ALTER table... or wait until the session that is accessing this table release it.
    Rgds
    Adnan

  • Lock object issue

    Dear Experts,
    We are using the fn. Module "SD_SALES_DOCUMENT_ENQUEUE", to process a sales order with multi line item and to unlock the table, we are using "DEQUEUE_ALL", but for some reason, in the sales order processing when the system comes to next line item, the lock object is throwing an error, I'm not sure if this is due to the lock not being released on the order.
    1st item success
    2nd item failure
    3rd item success
    4th item failureu2026.not always the same pattern, but usually.
    Please suggest .
    Thanks
    -Amit

    Hi Zekeriya,
    I have tried with the query you mentioned but didnt get any output.STILL THE PROBLEM PERSISTS...
    SQL> select s1.username || '@' || s1.machine
    || ' ( SID=' || s1.sid || ' ) is blocking '
    || s2.username || '@' || s2.machine || ' ( SID=' || s2.sid || ' ) ' AS blocking_status
    from v$lock l1, v$session s1, v$lock l2, v$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 ; 2 3 4 5 6 7 8
    no rows selected

  • Is it possible to get locked objects in passed time?

    Hi,
    I would like to get locked objects in passed time. The oracle version is 9i.
    For example,
    Can I get a list locked objects five days ago? Because I would like to keep locked objects statistics?
    Does these information stored?
    regards,

    Hi,
    your best shot is ASH (active session history). It contains information about active sessions, their wait events, wait times, blockers, objects accessed, SQL running etc. For recent events you may query V$ACTIVE_SESSION_HISTORY, if you are interested in older data then you can try
    looking in DBA_HIST_ACTIVE_SESS_HISTORY.
    There are many limitations when analyzing ASH data, such as:
    1) limited retention time
    2) periodic sampling (you won't be able to see anything that falls in between snapshots)
    3) bias towards longer events
    etc.
    so you need to be careful when analyzing these data.
    Best regards,
    Nikolay

  • Patch 9239090 - ORA-04021: timeout occurred while waiting to lock object

    Hello Guys,
    I need help urgently to comlete an upgrade of ebs 12.1.1 to 12.1.3.
    We are upgrading ebs 11i to 12i going live this weekend. We have encountered "ORA-04021: timeout occurred while waiting to lock object" on patch 9239090 with two Workers:
    In adctrl:
    1 Run AutoPatch R120 AFUTLGRS.pls FAILED
    2 Run AutoPatch R120 AFUTLOGS.pls FAILED
    sqlplus -s APPS/***** @/u02/applfinp/apps/apps_st/appl/admin/OFPROD/out/p001invok.sql
    Connected.
    create or replace package wf_bes_cleanup AUTHID CURRENT_USER as
    ERROR at line 1:
    ORA-04021: timeout occurred while waiting to lock object
    I have done everything everything imaginable but cannot get pass these 2 failed workers.
    1) I have checked are there are no locks blocking on any objects:
    select s1.username || '@' || s1.machine
    || ' ( SID=' || s1.sid || ' ) is blocking '
    || s2.username || '@' || s2.machine || ' ( SID=' || s2.sid || ' ) ' AS blocking_status
    from v$lock l1, v$session s1, v$lock l2, v$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 ;
    2) I also checked and there is space in the database.
    3) From adctrl, I have tried restarting the jobs one by one but the worker 1 hangs at and eventually fails on several (12) attempts.
    4) The solution on Doc ID 1291064.1 is not the problem:
    SQL> select SUPPLEMENTAL_LOG_DATA_MIN, SUPPLEMENTAL_LOG_DATA_PK, SUPPLEMENTAL_LOG_DATA_UI, FORCE_LOGGING
    from v$database;
    SUPPLEME SUP SUP FOR
    NO NO NO NO
    5) Manual execution still gave ORA-04021:
    sqlplus -s APPS/apps @/u02/applfinp/apps/apps_st/appl/admin/OFPROD/out/p001invok.sql
    sqlplus -s APPS/apps @/u02/applfinp/apps/apps_st/appl/admin/OFPROD/out/p002invok.sql
    6) The alert log has no related errors
    7) I Finally, after over 6 hours of waiting, I could only get the patch to continue after by using adctrl option 8 to skip these two workers.
    After proceeding, I have yet hit two more errors and now stuck:
    I have hit another error with the same patch:
    create or replace package body FND_LOG as
    /* $Header: AFUTLOGB.pls 120 ...
    AD Worker error:
    ORA-04021: timeout occurred while waiting to lock object
    Unable to process file in PACKAGE mode.
    Not converting file for Invoker's Rights because it appears to be a package body creation script (based on the filename).
    File is: /u02/applfinp/apps/apps_st/appl/fnd/12.0.0/patch/115/sql/AFUTLOGB.pls
    AD Worker warning:
    Product Data File
       /u02/applfinp/apps/apps_st/appl/admin/xniprod.txt
       does not exist for product "xni".
      This product is registered in the database but the above file does not exist in APPL_TOP.  The product will be ignored without error
    AD Worker error:
    The following ORACLE error:
    ORA-04063: package body "APPS.FND_LOG" has errors
    ORA-06508: PL/SQL: could not find program unit being called: "APPS.FND_LOG"
    ORA-06512: at "APPS.FND_FUNCTION", line 834
    ORA-06512: at "APPS.FND_MENU_ENTRIES_C_DELTRG", line 4
    ORA-04088: error during execution of trigger 'APPS.FND_MENU_ENTRIES_C_DELTRG'
    Can I stop and restart this patch 9239090?

    Hello,
    I later executed the failed jobs or scripts manually (successfully) for the patch to continue
    sqlplus -s APPS/apps @/u02/applfinp/apps/apps_st/appl/admin/OFPROD/out/p001invok.sql
    sqlplus -s APPS/apps @/u02/applfinp/apps/apps_st/appl/admin/OFPROD/out/p002invok.sql
    The patch ended with the following :
    The following Oracle Reports objects did not generate successfully:
    ap reports/US APXARATE.rdf
    ar reports/US ARXCTA.rdf
    fa reports/US FASRSVED.rdf
    ont reports/US OEXOEORD.rdf
    pa reports/US PAXACMPT.rdf
    pa reports/US PAXALRUN.rdf
    pa reports/US PAXACRPT.rdf
    pa reports/US PAXCPGAL.rdf
    pa reports/US PAXPCRFD.rdf
    The patch execution ended but the patch number is not record in apps.ad_bugs table:
    select TO_CHAR(CREATION_DATE,'dd-Mon-yyyy, hh24:mm:ss'), BUG_NUMBER from apps.ad_bugs where bug_number in ('9239090');
    no rows selected
    JFI
    Patches located in ad_applied_patches to which there is no a corresponding record in ad_bugs:
    SQL> SELECT a.patch_name, TO_CHAR(max(a.last_update_date),'dd-Mon-yyyy, hh24:mm:ss')
    2 FROM applsys.ad_applied_patches a
    3 WHERE NOT EXISTS (SELECT '1'
    4 FROM ad_bugs b
    5 WHERE b.bug_number = a.patch_name)
    6 group by a.patch_name;
    PATCH_NAME TO_CHAR(MAX(A.LAST_UP
    9239090 26-Oct-2013, 00:10:27
    AutoConfig 25-Oct-2013, 17:10:51
    merger9179588 25-Oct-2013, 11:10:30
    merger_post_5903765 27-Apr-2013, 23:04:45
    mergeu6678700 25-Oct-2013, 16:10:09
    What could have happened that this was not recorded in ad_bugs?
    How to I get this recorded in the ad_bugs table?
    Thanks
    Mathias

  • Create lock object with fun command

    Hallo,
    Is it possible to create a lock object with the fun command? I tried to use:
    FUN ( ENQUEUE _<lockobject> , <interface> ).
    When I fill the importing parameters, execute the script and afterwards refresh the interace than the import parameters are empty. Is there a way to create a lock object with the fun command or at least with inline abap?
    regards,
    Wolfgang

    Hi Wolfgang,
    in general your way of including the FUN command was correct.
    The loss of import parameter values must have been caused by some other reason, not related to the invoke of enqueue. Maybe try it again.
    If, for any reason, using FUN is not possible, it's always an alternative to use ABAP. .... ENDABAP. with correct ABAP coding inbetween (e.g. CALL FUNCTION ...).
    Nevertheless regarding enqueue you need to consider, that the lock you set by running eCATT test scripts in this way, will last (only) as long as the session in which the function was called is active. Means, it lasts as long as you do not close the SECATT transaction (/n or similar) and not use commands like RESCON in your test script. Check your locks with transaction sm12.
    Be aware, that interfering with an applications lock handling and strategy might also harm running transactions or the data processed by this transactions. Usually there is no need to call the enqueue modules from a test.
    Best Regards
    Jens

  • About lock object in Dynpro ABAP

    Hi Expert,
      We develop the Dynpro ABAP program to modify SAP document on EP,
    ( like Sales Order, Purchase order...ect. ).
    In tranditional  ABAP program, we use lock object(lock entry) to lock sigle document( SO, PO.. etc. )
    In Dynpro ABAP , how to lock the single document ?

    You can also use the "ENQUEUE" and "DEQUEUE" function modules to lock records in WDA as well.
    Check out the thread  [The effect of Session Expiration on Lock Table   |The effect of Session Expiration on Lock Table].
    Hope it helps.

  • Lock Object error during batch load

    Batch load was delayed about an hour. First error message in the Server Log said "Object is already locked by user""Error 1053010 processing request [Lock Object]-Disconnecting"Then it went through a series of "Object locked by user admin" and "received client request: create Temporary Object(from user admin)"It did this several times until connection.Although from time to time we have had problems with Objects getting locked and preventing maintenance in the Application Manager. This is the first time that is has prevented a batch load. Does anyone know what could have triggered this during the load process?

    This happened to us a lot, I think it's due to people opening objects, then letting their session time out, leaving a phantom lock.We solved the problem by calling the UNLOCKOBJECT function before any dimbuilds. 99.9% of the time this raises an error, "..object x is not locked..", but the rare time that the otl is inadvertently locked, it prevents the script from failing.<br><br>HTH,<br><br>Jeff McAhren<br>Dallas, Texas<br><br>ex to unlock the outline for app/db flash:<br><br>UNLOCKOBJECT 1, "FLASH" "FLASH" "FLASH"

  • Locked objects, Locked rows in a table, kind of locks

    Well, final question for the day.
    I created multiple session using sql plus, and in one session sql plus got lunch, it hour glasses and does nothing. I called up a DBA friend and he opined that it might be becasue one of my sessions has got a lock on a row in a table. I was also told that locks can be table level locks and row level locks.
    Please help me understand the below( I did try to read about locks, but atleast after first reading it is more confusing.. in order to update a row in a table why would oracle obtain a table level lock?)
    1. What are the different database objects which can get locked ?
    2. What are the different kinds of locks and what do they mean?
    3. When a row is locked by a session, can we identify that particular session and how ?
    4. What is the difference between pessimistic locking and optmistic locking ?
    5. Any scripts which I can use to get lock related info from database ?
    Gony

    1. What are the different database objects which can get locked ?There are locks which oracle acquire on any useful resource. We , as the users are most focussed on tables and their locks. But locks do happen in memory as well.
    2. What are the different kinds of locks and what do they mean?http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/dynviews_2.htm#REFRN30121
    3. When a row is locked by a session, can we identify that particular session and how ?Sure, there is a default script that comes up, utllockt.sql which can show you. Other than that, you can EM to do so as well. Read this,
    4. What is the difference between pessimistic locking and optmistic locking ?http://download.oracle.com/docs/cd/B28359_01/server.111/b28274/instance_tune.htm#sthref748
    5. Any scripts which I can use to get lock related info from database ?See #4 above.
    HTH
    Aman....

  • Periodic Schedule failures due to locked objects

    We are periodically encountering issues with nightly schedules against BW Bex universes.  Some schedules will fail with the error "A database error occured.  The database error text is: Error getting variables for cube (Cube\Query name) (catalog cube): Object requested is currently locked by user (user) (WIS 10901).  This doesn't happen all the time and we can't reproduce it on demand.  We have checked st22 for any further explaination and there is no record of anything.  We have already applied Note 1528921 which we thought would resolve the issue but that did not.  I have not found anything that points to the root cause of the issue.  Has anyone else come across this and resolved it?

    Check also SAP note [1615620|https://bosap-support.wdf.sap.corp/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3030303136313536323026].

  • Lock object problem on custom table

    Hi all.
    I am having a bit of an issue with a lock object on a home made table. We're using the UWL and a custom IView to display an extended invoice. No problem releasing the workitem lock, just the table entry lock.
    I can see the lock in SM12. Tried dequeue/dequeue all RFCs from backend, no luck.
    The lock is set from a custom RFC. This RFC succesfully releases the lock when used in SAPGUI, and we have an RFC enabled wrapper around it. However, once used in the portal, the locks aren't released. My suspicion is that it has to do with sessions and I can't see a way to control that since dynpro uses a connection pool IIRC.
    Anyone have any ideas on how to solve this?

    Small correction if you are not aware. Do not create your custom tables in APPS schema? Custom tables are supposed to created in custom schema such as XXPO and a synonym created for the table in APPS schema.
    When creating an EO, you do not need to provide the schema name. You would need to enter only the table name.
    Hope this helps.

  • About lock object and how to create it

    Hi ABAP gurus,
    Can any one explain about the Lock Objects and How to create Lock object step by step.
    Rgds,

    Hi Rangamma,
    Check this info.
    Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.
    SAP Provide three type of Lock objects.
    - Read Lock(Shared Locked)
    protects read access to an object. The read lock allows other transactions read access but not write access to
    the locked area of the table
    - Write Lock(exclusive lock)
    protects write access to an object. The write lock allows other transactions neither read nor write access to
    the locked area of the table.
    - Enhanced write lock (exclusive lock without cumulating)
    works like a write lock except that the enhanced write lock also protects from further accesses from the
    same transaction.
    You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
    Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
    Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
    Technicaly:
    When you create a lock object System automatically creat two function module.
    1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
    2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
    Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.
    SAP Provide three type of Lock objects.
    - Read Lock(Shared Locked)
    protects read access to an object. The read lock allows other transactions read access but not write access to
    the locked area of the table
    - Write Lock(exclusive lock)
    protects write access to an object. The write lock allows other transactions neither read nor write access to
    the locked area of the table.
    - Enhanced write lock (exclusive lock without cumulating)
    works like a write lock except that the enhanced write lock also protects from further accesses from the
    same transaction.
    You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
    Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
    Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
    Technically:
    When you create a lock object System automatically creat two function module.
    1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
    2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    GO TO SE11
    Select the radio button "Lock object"..
    Give the name starts with EZ or EY..
    Example: EYTEST
    Press Create button..
    Give the short description..
    Example: Lock object for table ZTABLE..
    In the tables tab..Give the table name..
    Example: ZTABLE
    Save and generate..
    Your lock object is now created..You can see the LOCK MODULES..
    In the menu ..GOTO -> LOCK MODULES..There you can see the ENQUEUE and DEQUEUE function
    Lock objects:
    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    Match Code Objects:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/41/f6b237fec48c67e10000009b38f8cf/content.htm
    http://searchsap.techtarget.com/tip/0,289483,sid21_gci553386,00.html
    See this link:
    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
    Hope this resolves your query.
    <b>Reward all the helpful answers.</b>
    Regards

Maybe you are looking for

  • TS1368 Error code

    I tried to download ITunes and received the following error; Apple Application Support was not found Apple Application Support is required to run ITunes.  Please uninstall ITunes, then install ITunes again Error 2 (Windows error 2) this is what I rec

  • LMS 3.0.1 SNMP working.

    Hi all. After i upgraded my MDF to 1.50 the SNMP is not working. I alread applied the fix to bug CSCsl00042-0 but still not working. The SO is solaris 9. Follow the package details. 1. CiscoWorks Common Services 3.1.1 2. CiscoView 6.1.7  3.  LMS Port

  • DTW price lists

    Hello everyone, I know there are some threats about this topic, but I am still a little confused, as those threats all seem to be importing/updating prices based on items rather than business partners. My scenario is that ... for example 3 suppliers

  • Can i share my ibooks with others

    Does anyone know if we are able to share books with other Apple users?

  • I need to change the country on my personal profile.

    Trying to purchase ExportPDF and can't do it from my account now because I don't live in the same country anymore.  I was told to contact customer service and when I clicked on the link I was taken to a self help page and then to this forum.  Anyone