What is lock table

what is lock table

Hi
1)Go to se11 transaction.
2)Click on lock object radio button and give a lock object name starting with 'E'.For example 'ESAMPLE'.Click CREATE.
3)In the TABLE tab, you can give the table name for which you require a lock.In the LOCK PARAMETERS tab,you can give the table fields based on which the table should be locked.
4)Call a function module in your program ENQUEUE_lockobjectname to obtain a lock on the required table.In our example the FM will be ENQUEUE_ESAMPLE.
5)To release the lock on the table,call the function module DEQUEUE_lockobjectname.In our example the FM will be DEQUEUE_ESAMPLE.
Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.
testing the locking of tables...
data: varkey like rstable-varkey.
varkey = sy-mandt.
locking the tables............................
call function 'ENQUEUE_E_TABLE'
exporting
MODE_RSTABLE = 'E'
tabname = 'MARA'
varkey = varkey
X_TABNAME = ' '
X_VARKEY = ' '
_SCOPE = '2'
_WAIT = ' '
_COLLECT = 'X'
exceptions
foreign_lock = 1
system_failure = 2
others = 3
case sy-subrc.
when 1.
message i184(bctrain) with 'Foreignlock'.
when 2.
message i184(bctrain) with 'system failure'.
when 0.
message i184(bctrain) with 'success'.
when others.
message i184(bctrain) with 'others'.
endcase.
unlocking the table...............
call function 'DEQUEUE_E_TABLE'
exporting
MODE_RSTABLE = 'E'
tabname = 'MARA'
varkey = varkey
X_TABNAME = ' '
X_VARKEY = ' '
_SCOPE = '3'
_SYNCHRON = ' '
_COLLECT
<REMOVED BY MODERATOR>
preet
Edited by: Alvaro Tejada Galindo on Jun 12, 2008 6:21 AM

Similar Messages

  • Lock tables when load data

    Are there any way to lock tables when i insert data with SQL*Loader? or oracle do it for me automatically??
    how can i do this?
    Thanks a lot for your help

    Are there any problem if in the middle of my load (and commits) an user update o query data ?The only problem that I see is that you may run short of undo space (rollback segment space) if your undo space is limited and the user is running a long SELECT query for example: but this problem would only trigger ORA-1555 for the SELECT query or (less likely since you have several COMMIT) ORA-16XX because load transaction would not find enough undo space.
    Data is not visible to other sessions, unless, the session which is loading data, commits it. That's the way Oracle handle the read committed isolation level for transaction.
    See http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96524/c21cnsis.htm#2689
    Or what happens if when i want to insert data someone has busy the table?You will get blocked if you try to insert data that has the same primary key as a row being inserted by a concurrent transaction.

  • What are the tables for documents in PP Orders

    Hi all,
    What are the tables for Document Items (type D) in PP orders ?
    Regards,
    Magda

    Welcome to SCN, please refer to the rules of engagement, link at the top of every forum, please search before asking basic questions.
    Thread locked.
    Thomas

  • Timeout when inserting row in a locked table

    How can I set the timeout before an INSERT statement fails with error ORA-02049 (timeout: distributed transaction waiting for lock) when the entire table has been lock with LOCK TABLE .
    Documentation says to modify DISTRIBUTED_LOCK_TIMEOUT parameter, but it is obsolete in Oracle 8i.
    Any idea ???

    You could set an alarm() in a signal. Then on return (for whatever reason) you clear the alarm, inspect the return code of the sql execute call and determine what happened (i.e. did the transaction completed or did the alarm get you).
    Hope it helps.
    -Lou
    [email protected]
    How can I set the timeout before an INSERT statement fails with error ORA-02049 (timeout: distributed transaction waiting for lock) when the entire table has been lock with LOCK TABLE .
    Documentation says to modify DISTRIBUTED_LOCK_TIMEOUT parameter, but it is obsolete in Oracle 8i.
    Any idea ???

  • How to use lock object? what we lock either total ztable or only record?

    Hi
    How to use lock object? what we lock either total ztable or only particular record?
    Don't tell create lock object on se11 with E letter & acll it in program with eENQUEUE & DEQUEUE.
    just tell me we will lock only particular record or total ztable?
    specify with example.
    Thanks.

    Hi
      Go to SE11, in the option 'Lock object' enter the name of your lock,
    begin with 'E', suppose 'EXXXX' And create. In tab 'Tables' fill the
    table name where the record you want to lock exist and select the
    lock mode. Lock mode can be shared and exclusive. If 'shared',
    when you lock the record, other can also read data, but can not
    modify. If 'exclusive', when you lock the record, other can neither
    read nor modify the record. After save and activate, you will get two
    function module.'ENQUEUE_EXXXX' to lock record,
    'DEQUEUE_EXXXX' to release lock on one record.
    When use this function module it only lock one record at a time. It
    does not lock the table.

  • MM42 change material, split valuation at batch level, M301, locking table

    Dear All,
    I'm working on ECC 6.0 retail and I have activated split valuation at batch level.  Now in MBEW for this specific material I have almost 14.400 entries.
    If I try to change some material data (MM42) I receive an error message M3021 A system error has occurred while locking and then Lock table overflow.
    I used SM12 to see the table (while MM42 is still running) and it seems that MBEW is the problem.
    What should I do?  For any material modification the system has to modify every entry in MBEW? Is there any possibility to skip this?
    Thank you.

    Hi,
    Symptom
    Key word: Enqueue
    FM: A system error has occurred in the block handler
    Message in the syslog: lock table overflowed
    Other terms
    M3021 MM02 F5 288 F5288 FBRA
    Reason and Prerequisites
    The lock table has overflowed.
    Cause 1: Dimensions of the lock table are too small
    Cause 2: The update lags far behind or has shut down completely, so that the lock entries of the update requests that are not yet updated cause the lock table to overflow.
    Cause 3: Poor design of the application programs. A lock is issued for each object in an application program, for example a collective run with many objects.
    Solution
    Determine the cause:
    SM12 -> Goto -> Diagnosis (old)
    SM12 -> Extras -> Diagnosis (new)
    checks the effectiveness of the lock management
    SM12 -> Goto -> Diagnosis in update (old)
    SM12 -> Extras -> Diagnosis in update (new)
    checks the effectiveness of the lock management in conjunction with updates
    SM12 -> OkCode TEST -> Error handling -> Statistics (old, only in the enqueue server)
    SM12 -> Extras -> Statistics (new)
    shows the statistics of the lock management, including the previous maximum fill levels (peak usage) of the partial tables in the lock table
    If the owner table overflows, cause 2 generally applies.
    In the alert monitor (RZ20), an overrunning of the (customizable) high-water marks is detected and displayed as an alert reason.
    The size of the lock table can be set with the profile parameter u201Cenque/table_size =u201C. specifies the size of the lock table in kilobytes. The setting must be made in the profile of the enqueue server ( u2026_DVEBM.. ). The change only takes effect after the restart of the enqueue server.
    The default size is 500 KB in the Rel 3.1x implementation of the enqueue table. The resulting sizes for the individual tables are:
    Owner table: approx 560.
    Name table: approx 560.
    Entry table: approx 2240.
    As of Rel 4.xx the new implementation of the lock table takes effect.
    It can also be activated as described in note 75144 for the 3.1I kernel. The default size is 2000 KB. The resulting sizes for the individual tables are:
    Owner table: approx 5400
    Name table: approx 5400
    Entry table: approx 5400
    Example: with the
    u201Cenque/table_size =32000u2033 profile parameter, the size of the enqueue table is set to 32000 KB. The tables can then have approx 40,000 entries.
    Note that the above sizes and numbers depend on various factors such as the kernel release, patch number, platform, address length (32/64-bit), and character width (Ascii/Unicode). Use the statistics display in SM12 to check the actual capacity of the lock table.
    If cause 2 applies, an enlargement of the lock table only delays the overflow of the lock table, but it cannot generally be avoided.
    In this case you need to eliminate the update shutdown or accelerate the throughput of the update program using more update processes. Using CCMS (operation modes, see training BC120) the category of work processes can be switched at runtime, for example an interactive work process can be converted temporarily into an update process, to temporarily increase the throughput of the update.
    For cause 3, you should consider a tuning of the task function. Instead of issuing a large number of individual locks, it may be better to use generic locks (wildcard) to block a complete subarea. This will also allow you to considerably improve the performance.

  • Error  " RFC Status :-  Lock table overflow "in event trace  ( SWEL )

    Hi experts ,
    I will not mention this post as URGENT but you guys can understand the importance as I am in PRD Support of my workflows .
    My Workflow is throughing error in SWEL  , as below   and after error its getting deactivated .
    The workflow is triigering based on the  BO : DRAW and event CREATED .
    Error :  RFC Status           Lock table overflow
    In feedback after error the message is : A system error has occurred in lock management .
    I have resolved the deactivation problem after error  , but   can any body please suggest me  what is the root cause of this error , so that i can try to avoid that error .
    Regards
    Prabhudutta
    Edited by: Prabhudutta Behera on Nov 20, 2008 5:58 AM

    This error I have not faced. i will suggest you to check SWU3 transaction Code and check everything is configured. Also check SM12 and SM58. Also I will ask you to contact the Basis Guys related to this issue. Also check WF-BATCH is having all the authorization required. Try to replicate this from the system where Workflow is working.
    Thanks
    Arghadip

  • Command object locks table (TX)

    Im having locking probmlems with ODP.NET. Im updating same table with many connections in many threads. I get table locks for hours (over 24 hours) and I cant find any timout to set. The CommandTimeout on the Command object is not implemented.
    In the V$Lock table I can see two locks on the same table made by two session ids from the same computer.
    Im using transactions on the Connection object.
    How do I set a timout for the update so that the lock will dissapear?
    String connString = "Data Source="     + dsn + ";"
              + "User ID="          + user + ";"
              + "Password="          + pwd;
    OracleConnection conn = new OracleConnection(connString);
    String sql = "UPDATE ABDATA2 SET ABNAVN='SOLNA STAD ' WHERE OBJID = -21805738";
    OracleCommand command = new OracleCommand(sql, m_conn);
    //command.CommandTimeout = 60000; Exists but not supported
    command.ExecuteNonQuery();
    Is there anyone who has a clue?

    Hi Neo, thanks for responding;
    I did not publish the report with saved data, and I'm not sure what you mean about appending the string value?  Could you explain that part?
    The parameter I created is only declared as a string with no default value with a name of "CodeTableName".  I used the Create paramter button you have in the Command object window to make it.
    I then added the parameter name to my SQL statement as listed above.
    The actual code table names in the database is actually longer then what the parameter calls for.  They all start with "TIBURON.ZZ_" and end with "_Codes".  I didn't want the users to have to remember the full names so that's why the SQL statement shows those additional parts.
    The report works perfect when I'm running this report from Crystal Reports 9 or CR11 itself.  It's only when I upload the report to our web server that the users isn't provided a prompt to enter a parameter.  They only have button labed "Run Report".
    Any ideas?
    Thanks,
    Joe

  • Lock tables during partition exchange

    Hi,
    I want to do the following thing:
    there are 9 partitioned tables (set A) and 9 non partitioned (set B).
    There is a continuous dataflow into set A.And there is also a dependency between the nine flows within each transaction into set A (there is no dependency between different transactions.).
    What I want is to exchange the nine partitions of set A with set B. This because I want to have a performance boost instead of copying the data from A into B.
    I need to lock the tables of set A to make sure there is NO insertion of data into one of the tables of set A to avoid loss of dependency and thus loss of data.
    I tried several things: lock tables, run autonomous transaction in which the exchange takes place, commit and unlock. But no success.
    Who can help me to solve my problem: to lock all nine tables of set A and make sure the dependency remains consistent and no data gets lost?
    Thanks.
    jurgen

    Why you are bothering about LOCKing the table,
    you can goahead and do the exchange the table,
    since, its ongoing activity, exchanged partition will be there till you merge, drop it.
    if you found some more rows after exchange, then you can insert same into that table, or make another table.
    Thanks

  • Db_associate fails with : Lock table is out of available lock entries

    Hi
    Occasionally on startup my app needs to rebuild its secondary database, so I call db_associate with DB_CREATE set. If the primary db is large the associate fails with "Lock table is out of available lock entries". Both databases are hashes, so I have not configured any special lock sizes as I didn't think I needed to.
    What lock configuration does db_associate need to succeed?
    I am using version 4.7.25
    Thanks
    Ashley

    Hi Ashley,
    You should be sizing the locking subsystem with high enough values so the secondary database rebuilds successfully, then run the "db_stat -C" utility and see how many locks, lock objects and lockers did you need to perform the operation and reconfigure the locking subsystem with values slightly bigger than what you needed, so you make sure that you'll have enough resources for the next time you'll rebuild the secondary.
    "Lock table is out of available lock entries" means that the Berkeley DB locking subsystem has not been configured for enough locks. For more information, see the "Configuring locking: sizing the system" section of the Berkeley DB Reference Guide, included in your download package and also available at:
    http://download.oracle.com/docs/cd/E17076_01/html/programmer_reference/lock_max.html
    To see what locks are held in the database environment at any time, you can dump the lock table using the -Cl options:
    % db_stat -h [database environment directory] -Cl -N
    Additional documentation:
    db_stat: http://download.oracle.com/docs/cd/E17076_02/html/api_reference/C/db_stat.html
    set_lk_max_locks: http://download.oracle.com/docs/cd/E17076_01/html/api_reference/C/envset_lk_max_locks.html
    Bogdan Coman

  • Error locking table TBTCO

    Hi,
    We are having issue in locking "Error locking table TBTCO" at our SM12 statics Maximum Number of Lock Owners     3603
    Even on increasing the enque/table_size it not effecting the lock owner. Our environment having enq replication server.
    The profile parameter for enque/serverinst = $(SCSID) (00)
    enque replication server instance number is 10
    What could be the correction need to be done?
    Regards,
    RMav

    You have to check the reason for the error in the lock.
    Get the Work Process number that logged the error in SM21. Check the trace file of this work proces. At the same timestamp of the error in SM21 you do find the root cause in the work process trace.
    Usually this is caused by a overflow in the enqueue table, but not always. For this reason you have to check the work process trace the reasl root cause.
    To check if the enqueue is suffering a overflow you should go to SM12 -> Extras -> Statistics
    If in the statistics you do find that the "Maximum Fill Level" reached the maximum number of locks in these itens, for example:
    Maximum Number of Lock Owners 39481
    Maximum Fill level 458                               
    Current Fill Level -25
    Maximum Number of Lock Arguments 39481  <<<
    Maximum Fill level 39480                                 <<<
    Current Fill Level 15
    Maximum Number of Lock Entries 39481    <<<
    Maximum Fill level 39480                             <<<
    this means that the enqueue was really suffering under an overflow situation.
    Just for your information, the TBCTO is the table for the status of the jobs. So, every job need
    to write the status in this table and also lock this table firstly.
    Clébio

  • Locking tables

    I am declaring and using the following cursor:
         CURSOR curCompany IS
              SELECT c.Company_ID, c.No_Employees
                   FROM Company c
                   WHERE (SELECT COUNT(*) FROM Student s
                        WHERE s.Company_ID = c.Company_ID) > 0;I would like to include a FOR UPDATE OF Student.col to it so rows could be locked while they are being updated, but can't.
    1) What is the best way of locking the table? I've been reading up on LOCK TABLE and am willing to use it but would like to hear what you guys have to say on this.
    2) Is there an operator/function like EXISTS that would replace the sub-query in the WHERE clause?

    I will tell you real world scenario:
    <br><br>
    Let suppose I have a table from I am getting series for my transaction depending on some parameter.<br>
    <br>
    Here at the time of pre insert in my form I use as follows:
    <br><br>
    Select series from table_name FOR UPDATE;
    <br><br>
    Offcourse I add in condition also.
    <br><br>
    At the time of post insert I release the lock as follows:
    <br><br>
    Update table_name SET series+1 with condition.
    <br><br>
    Why I am doing this because I want to make sure same number is not used by two transaction.
    <br><br>
    Raj<br><br>
    <b>www.oraclebrains.com<a>
    <br><font color="#FF0000" size="1">POWERED by the people, to the people and for the people WHERE ORACLE IS PASSION.</font></b>

  • Hi gurus what is lock objects in datadictionary ,can explain with example

    hi gurus what is lock objects in datadictionary ,can explain with exple

    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.
    You have to use these function module in your program.
    Hope this will give a basic idea.
    Here is a Link with good example
    Lock Objects
    Look the following Links for additionl info.
    http://help.sap.com/saphelp_nw04/helpdata/en/c2/2d7037ecc92a7ee10000009b38f8cf/content.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    http://articles.techrepublic.com.com/5100-6329_11-5066352.html
    Hope this Helps

  • Lock table for edit.

    Hi ,
    i have a program that unite some table to one big table,
    and i look for lock those tables while the program is running.
    lock table just for editing,the users can watch.
    there is a way to do this???

    Hi,
    i did this like that:
    FORM locktable USING    P_ITAB_TABNAME.
      CALL FUNCTION 'ENQUEUE_E_TABLE'
       EXPORTING
      MODE_RSTABLE         = 'E'
         TABNAME               = P_ITAB_TABNAME
      VARKEY               =
      X_TABNAME            = ' '
      X_VARKEY             = ' '
      _SCOPE               = '2'
      _WAIT                = ' '
      _COLLECT             = ' '
    EXCEPTIONS
      FOREIGN_LOCK         = 1
      SYSTEM_FAILURE       = 2
      OTHERS               = 3
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " locktable
    and when i'm runnning the program it crash and give me  this msg:
    CALL_FUNCTION_CONFLICT_TYPE.
    what did i do wrong???

  • MC603 Lock Table Overflow Error in Maintenance Order Settlement

    Hello,
    I am running RKO7KO8G- "Settlement of Maintenance Orders" program in background. For few Orders I am getting "MC603:Lock Table overflow " error. What might be the problem for this?
    Number of Order processed in a job is around 10,000.
    I checked in SM12 table.No entry is found
    Size of the Lock table details is
    Min - 4096
    Max - 102400
    Diff Value - 4096
    Profile Value - 10000
    Current Value - 10000
    Regards,

    Hello Srinivas,
    Please take a look at the below link.
    http://help.sap.com/saphelp_nw04/helpdata/en/37/a2e3ab344411d3acb00000e83539c3/content.htm
    As I already said, there is no standard value to define. You need to consider the no.of locks being generated and act accordingly to address this problem.
    I suggest you please go through the lock management documentation to address this kind of problems in the feature.
    Thanks,
    Siva Kumar

Maybe you are looking for

  • BaseLine date different from Terms Of Payment Date

    Hi, My client posted 3 documents dated 23.12.2009,17.12.2009,14.12.2009  respectively. The terms of payment has been set to accept document date as default for the baseline date. This means that the baseline dates for the  documents should be same as

  • Need to find the source code for java.util.LinkedList

    Hello all, I'm new to the forums and I actually need the LinkedList source file as well as all the source files for all Java packages and libraries. Please post a link here if you can, or email me at [email protected] Thanks again! copter_man

  • Time conversion problem using sql developer

    Hi, I migrated my data from sql server 2 oracle 10g using the following procedure 1.Created a ODBC from Access-2003 to sql server 2.Imported the tables 3. Used Quick migrate feature in SQL DEVELOPER 2 migrate the data to oracle.... Now when i view th

  • How do I get a chart execute on a FUNCTION/PROCEDURE and not just on  query

    So I have the following function. It does return a SQL statement which should populate a stack bar chart: create or replace FUNCTION stacked_repair RETURN VARCHAR2 is l_var VARCHAR2(32767); BEGIN l_var := 'SELECT NULL LINK,to_char(open_time,"YYYY-Q")

  • Unable to remove Keep with Previous Pgf

    On the Paragraph Designer tab, once the tick boxes on Keep with Previous Pgf have been checked, I am unable to remove the checks/settings. I untick them and try to apply the new settings, but the ticks reappear every time. I am using FM 10 on Win 7