The implementation of the exclusive line locking in Oracle

Hi all

Since the beginning of learning Oracle, I've known that oracle has no row-level lock. Row level locking is achieved by ITL in the header of the block.
In this context, I am curious how statement "lock table in exclusive mode of line" is implemented? Update for all ITLs lines all the blocks belonging to the table?

Best regards
Leon

I'm not sure what you mean by Oracle has no blockage at the level of the lines. Line level Oracle most certainly is a lock. A single line in a table can be locked without blocking the other lines of the table, or even of other lines in the same block.

You are right that this works through the ITL. When a DML is run, if a session doesn't has not already open transaction, Oracle will create one, by booking a slot/segment/wrap in the rollback segment header. Then, in the block where the line should be blocked, an ITL slot is reserved in the block header, that contains this transaction id, essentially pointing to this location of rollback segment. Now, to lock a specific line in the directory of the line, there is a byte of the lock. The locking byte is either 0, which means that the row is not locked, or she will 1.n value, where n is the number of ITL sites reserved in the block header. Thus, if the locking byte is not null, it points to slot ITL of the transaction that holds the lock. So, you can see that it is very easy for a transaction lock a single line in a block, or all lines in the block. Simply set the byte corresponding to the ITL (s) appropriate locking.

This fact implies, it is that Oracle has no "centralized list of the locks on level line. Row-level locks are inherent in the structure of datablock, as stated above.

Hope the helps to clarify your understanding.

-Mark

Tags: Database

Similar Questions

  • Failure to get the db line lock: ORA-01157

    Hello

    I have a client that uses that the customer is using Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production with the partitioning, Real Application Clusters, Automatic Storage Management. An application has been installed recently in which scripts created a .dbf file instead of save on the disk group. So if I run the query I see the following output below

    SQL> select name from v$datafile;
    NAME
    --------------------------------------------------------------------------------
    +RIAMSTG_DBF1/riamstg/datafile/oamstg_mds.259.821014833
    +RIAMSTG_DBF1/riamstg/datafile/oamstg_ias_opss.256.821014833
    +RIAMSTG_DBF1/riamstg/datafile/oamstg_oam.274.821014833
    +RIAMSTG_DBF1/riamstg/datafile/oamstg_ias_iau.276.821014835
    +RIAMSTG_DBF1/riamstg/datafile/bistg_mds.279.821875255
    +RIAMSTG_DBF1/riamstg/datafile/bistg_biplatform.278.821875255
    /db/oracle/112/db/dbhome_1/dbs/rbacx.dbf
    

    Now, when we reboot the DB we see the error below.

    ORA-01157: cannot identify/lock data file 18 - see DBWR trace file
    ORA-01110: data file 18: '/db/oracle/112/db/dbhome_1/dbs/rbacx.dbf'
    ORA-27037: unable to obtain file status
    Linux-x86_64 Error: 2: No such file or directory
    

    In my view, that the error may be related to the .dbf file. How can I move this ASM format?

    -Extreme

    It should be ALTER TABLESPACE OFFLINE RBACX without the single quotation mark character.   (I had the character to reach the unknown tbsname).

    Hemant K Collette

  • How to check the sessions of locking in oracle 10g

    Hello

    I tried to get hang of the sessions. I had the session blocking using v$ lock view.

    Pls help how to get hang of the sessions.

    Kind regards
    Vincent

    >
    SQL > SELECT SID, SQL_ID, name of USER BLOCKING_SESSION FROM v$ session WHERE BLOCKING_SESSION IS NOT NULL;
    SELECT SID, SQL_ID, username, BLOCKING_SESSION FROM v$ session WHERE BLOCKING_SESSION IS NOT NULL
    *
    ERROR on line 1:
    ORA-00904: "BLOCKING_SESSION": invalid identifier
    >

    What is your version of the database? Please show us all the 5 digits of the version (select from version$ v); *

    10.1_

    SQL> select * from v$version;
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - Prod
    PL/SQL Release 10.1.0.4.0 - Production
    CORE    10.1.0.4.0      Production
    TNS for Linux: Version 10.1.0.4.0 - Production
    NLSRTL Version 10.1.0.4.0 - Production
    
    SQL> SELECT SID, SQL_ID, USERNAME, BLOCKING_SESSION FROM v$session WHERE BLOCKING_SESSION IS NOT NULL;
    
    no rows selected
    

    In 10.2*

    SQL> select * from v$version;
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for HPUX: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    
    SQL> SELECT SID, SQL_ID, USERNAME, BLOCKING_SESSION FROM v$session WHERE BLOCKING_SESSION IS NOT NULL;
    
    no rows selected
    

    11g _ _ (showing a situation of real lock)

    SQL> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    
    5 rows selected.
    
    SQL> SELECT SID, SQL_ID, USERNAME, BLOCKING_SESSION FROM v$session WHERE BLOCKING_SESSION IS NOT NULL;
    
           SID SQL_ID        USERNAME                       BLOCKING_SESSION
    ---------- ------------- ------------------------------ ----------------
           145 62ttrb9xf43zr SCOTT                                      26
    
    1 row selected.
    

    Published by: user12035575 on 10 Sep, 2011 12:42

  • Problem with the compatible version of line lock tables

    I tested the effect of locking in the tables in activated version to assess restrictions workspace manager to update the records in different workspaces and I met a locking issue where I can't seem to update different registers of the same table in different sessions if these same records have already been updated and committed in a different workspace.

    I run the tests on 11.2.0.3.  I have ROW_LEVEL_LOCKING worth IT.

    Here's a simple test case (I have many other test cases that are not as well, but understand why it is a problem of blocking will help me understand the results of others my test case):

    -Alter tablespace names in accordance with the requirements

    create table t1 (id varchar2 (36) not null, name varchar2 (50) not null) tablespace XXX;

    ALTER table t1 add the key primary t1_pk (id) of constraint using index tablespace XXX;

    exec ('LIVE') dbms_wm.gotoworkspace;

    insert into t1 values ('1 ', 'name1');

    insert into t1 values ('2 ', 'name2');

    insert into t1 values ('3 ', 'name3');

    commit;

    exec dbms_wm.enableversioning ('t1');

    exec ('LIVE') dbms_wm.gotoworkspace;

    exec dbms_wm.createworkspace ('TESTWSM1');

    exec dbms_wm.gotoworkspace ('TESTWSM1');

    -Update 2 files in a workspace not LIVING for the update later in different workspaces

    Update t1 set name = name | ' changed ' where id in ('1 ', ' 2');

    commit;

    quit smoking;

    -Now in a separate session (called session 1 for this example), run the following without commit the changes:

    exec ('LIVE') dbms_wm.gotoworkspace;

    Update t1 set name = 'modified' where id = '1';

    -Now in another session (session 2) update a different record in the same table.  The update below is blocked waiting on the transaction in the session 1 to perform (by commit / rollback):

    exec ('LIVE') dbms_wm.gotoworkspace;

    Update t1 set name = 'modified' where id = '2';

    I am surprised, recordings of the different IDS cannot be updated in different sessions which is why is session 1 blocking the update of the 2 folder that is not being updated anywhere else.  I tried this using different workspaces not LIVING with similar results.  I tried to change the properties of the table for example, initrans with and always get a lock.  Changes made to the properties of the table are correctly propagated to _LT tables but not all tables in handler related workspace created for table T1 that precedes.  I don't know if that's the problem.

    Note an example of the query Manager space background likely to create the lock is something like:

    UPDATE TESTWSM. T1_LT SET LTLOCK = WMSYS.LT_CTX_PKG. CHECKNGETLOCK (: B6, LTLOCK, NEXTVER,: B3, 0, 'UPDATE', VERSION, DELSTATUS,: B5), NEXTVER = WMSYS.LT_CTX_PKG. GETNEXTVER (NEXTVER,: B4, VERSION,: B3: B2, 683) WHERE ROWID =: B1

    Any help with this will be appreciated.  Thanks in advance.

    Hello

    The reason for the block is actually the same as above.  The splits is registered at the level of the version/savepoint, not necessarily just the workspace.  In your example, workspaces TESTWSM1 and TESTWSM2 have a single version and the LIVE workspace has 3 versions.  A new version is always implicitly created during a CreateWorkspace operation if the most RECENT/current version has modified data.  The lines for the id = "1" and id = "2" are changed in each workspace to the child and before creating a workspace.  However, since the id = "3" LIVE online has changed after the creation of TESTWSM1, it is in a different version of those other 2 rows.  So when the updates for the id = "1" and id = "2" are executed, the line is attempted to be divided between TESTWSM1, TESTWSM2 and the latest version of LIVE.  No other line has been updated with this combination so we try to introduce a set of lines in the metadata table.  As this happens multiple sessions at the same time, one of them is obliged to block until the other transaction issues a commit or rollback.

    It is not a way to avoid these LMD.  The lock is acquired in this case is a short-lived transaction lock and they are required for the correct rows be returned for a particular workspace.

    Kind regards

    Ben

  • Create a new line, the prior editing lock

    LCD display 9, Acrobat 9, Windows 7

    Gurus-

    I'm doing a table of observations, and when you create a new line the prior is locked for editing.

    To add a line, I put a button in the table with this code:

    _Row1.addInstance (true);
    xfa.for.Recalculate (true);

    I'm not familiar with the code to browse an index of the table, so don't have no idea how to put in place so that in addition to these two lines above, code goes something along the lines of access = 'protected' to every cell in the previous row.

    Ideas?

    Hello

    First of all, my script was incorrect. ReadOnly must be enclosed in quotes, for example: = "readOnly";

    In addition, you must remove the Row1 readOnly lines and it should work. This is because the reference to Row1 is included in the variable of the bow.

    For example:

    pRow.comment.access = "readOnly";
    

    Hope that helps,

    Niall

  • How can I lock the "to:" lines in the window of writing?

    Since the last version of Tbird, when you enter a ' to:' address, as soon as I hit tab or enter, the ' to:' line scrolls to the top and looks that I did not choose an address. But I really, it's just that I do not see the address because it scrolls upwards out of sight.

    With the help of Win8 64-bit Win7 on Sony VAIO mode.

    Thanks heaps for all your help!

    I followed your suggestion to safe mode (which solved my problem) then go back and using the process of elimination to weed out the offending module.

    The Add on the cause of the problem was "Stationery 0.8.4" by Arivald (photo below). I don't remember installing or never using it, but whatever...

    I'm glad to be back to normal again. Extremely grateful to you and the Group of volunteers that run Mozilla. I liked your products!

  • During the ETG Table lock

    Hello

    I want to clone a table in our database. Version: 11.2.0.4


    Test case:

    CREATE TABLE test_1

    (IDENTIFICATION NUMBER)

    /

    INSERT INTO test_1 (id) values (5);

    COMMIT;

    Now-> I want to start cloning from the table. BUT! After cloning, I must write off line-counts of the original and cloned table. (simple audit)

    To avoid any DML operation during cloning I lock the table in exclusive mode.

    Test_1 in MODE EXCLUSIVE TABLE LOCK.

    -> Now I start the operation of the ETG

    -> DDL's implicit VALIDATION here

    CREATE TABLE test_clone

    AS

    SELECT * from test_1

    /

    -> DDL's implicit VALIDATION here too

    -> Here would be County-parts to start... (The Original County and County of Clone)

    Problem: My DDL statement makes two implicit commits-> first before the DDL and second after the DDL.

    So, in this case the lock on the original table will be released before cloning could begin. --> During a long race THAT DEC can other data manipulations arrive on the original of another session table.

    And in this case if I count the original and the clone table lines I can get a different result.

    Do you know a solution for this?

    -> I can't start a procedure or a second session-> This cloning is done in a DB-Patch which we deliver to DBA.

    -> I can only run an anonymous pl/sql block

    -> In fact, I don't want to use the INSERT INTO (append)... because an ETG is faster and I want to know if there could be a solution for this problem with the DDL.

    I thought to create a trigger on the original table that fires if a DML arrived-> but what happens if a DBA ends the script... then this trigger there. So, I would avoid this change in structure.

    How I could lock the original table so that I can run a DDL in the same session after it without to release the lock on the original table? -> I don't think that would work, but you may know...

    Thanks in advance!

    In fact, I wanted to know if if it was very important how it could be solved. -> In my case, it would have been good to get to know a solution said that maybe I don't know yet.

    A better solution IMHO and the most common way to do it is just put the table in READ ONLY mode.

    ALTER TABLE myTable READ ONLY

    ... do the ETG

    In general, there are many more controls to perform AFTER the operation than just the count of lines. These controls can should be performed by multiple sessions/users for an autonomous transaction will not help you here.

    Reading using only keep data available without him to be changed. You can then rename the original table to keep data online for a period of time or to allow time for it to be saved.

  • Can I change the subject line of a message or add a note for my reference?

    I'm still new with tuberculosis after using Outlook for years. In Outlook, it was possible to change the subject line, even though the content was lock. It was nice to put the content in your context, a note, etc. You can do this in Thunderbird or is another way to add a note?

    I think that the Add-on EditEmailSubject would add the functionality you want.

  • My verse ATT modem (non apple devices to use this modem} is connected to the ATT line, Time Capsule (iPhones, Macs Time Capsule use) via ethernet Uverse.) Non apple devices can collect data from iPhones or Mac using the time Capsule?

    My verse ATT modem ({use of devices not apple wifi of this modem} is connected to the ATT line, Time Capsule (iPhones, Macs use the wifi of the time Capsule) and connect to the Uverse modem via ethernet.)

    Both devices are set to the highest security and each uses separate passwords.

    Non apple devices can collect data from iPhones or Mac using the time Capsule?

    With a bit of work by someone who knows how to do such things, not Apple computers could read some files on the Mac if file sharing is configured on the network... devices non-Apple and... He knew the device passwords or administrator for Macs.

    Mac could also play the files on other Macs if file sharing has been implemented and the device password or admin was known.

    If you ask if a PC can read the files on the Time Capsule, the answer is Yes, without doubt, assuming that the PC knew the password of device for the time Capsule.

  • Strange logo appearing before the addrees line

    There is a logo dimmed at the beginning of the address line (where the lock is in the https pages). And is not a logo of plug-in or add-on.

    Don't know what it is or where it comes from. Should I be worried?
    Thank you
    Gregory

    You no longer see favicon for the site on the address bar, but you now see an icon that indicates what type of connection you have.

    If you click the icon with a normal unencrypted HTTP connection you will see:

    • This Web site does not provide identity information.
    • Your connection to this Web site is not encrypted.

    Only an encrypted HTTPS connection can provide additional information.

    The change is for security reasons to prevent websites from spoofing the favicon as a padlock icon or another indication of a secure site.

  • Qosmio G10-133: the blue lines on screen

    To all those who can help you:

    I turned on my Qosmio yesterday to find a series of unwanted blue lines, distorting the Qosmio logo. Lines and distortion continued until the operating system came at the opening of my office. At this point the whole system locked and the screen went completely blank.

    The Qosmio player suffers from the same problem. The boot system, but crashes when the display is asked to do something.

    I can open the operating system in safe mode, but the lines still appear to a lesser extent on the screen.

    I have run all the tests and has been through the manual troubleshooting section. I tried to reinstall the drives and roll back to the previous facility. But, for all that I try, nothing will change.

    Qosmio my friend did exactly the same thing a month or two it is a. Solution from Toshiba was to replace the motherboard.

    My Qosmio is still under warranty, and I am very happy to send it because Toshiba has one of the best customer service I've had to face.

    But, I was wondering if anyone had any ideas?

    Thank you very much.

    Hello

    I also very pleased with the customer support service Toshiba m.
    I think that the simplest and the best way to resolve this weird display problem is to bring the unit to the ASP. Laptop you is guaranteed to be protected and a replacement is free.

    Good bye

  • Problem by typing the new line (enter does not work)

    Hello

    When I try to type several lines as a comment, or when I try to type several lines in a knot of formula,
    I can't jump to the next line.
    Enter or SHIFT + ENTER doesn't let me type on the next line.
    Is there a solution for this problem?

    Thank you
    Giovanni Vandewaetere.

    Thank you!

    Turning off caps lock Num toured :-)

  • How to change Microsoft Security Essentials at the request of the parameters of scanning from the command line or in a script.

    Is it possible to change the parameters of the scheduled scan of the Microsoft Security Essentials from the command line or in a script?

    I know that I can use the command to schedule the MpCmdRun.exe tool command line to run, but that do not change or remove the existing scheduled scan that appears in the software. Run regedit to merge into the corresponding registry keys does not work because the keys are "locked", probably by the running of MSSE program.

    Suggest you post it in one of the forums dedicated to MSE - Microsoft Security Essentials: scanning, detection and removal of threats MowGreen Update Services - consumer safety

  • 2 phones connected to the same line with PAP2

    Hello

    Is it possible to connect a phone to the first port, a second, and use both in the same line?

    I configured and only works with a single line.

    Thank you

    Yair.

    Hello

    No, this is not the right way. The first port belongs exclusively to recording the line1, second port exclusively to recording of line 2.

    If you want two phones (such as another in the bedroom lounge) ringing on incoming call, simply use the "splitter" to make the phones at the same time and that's it - SPA/PAP Traffic has enough power to operate up to 3 analog telephone devices on each of the ports. I used to have 2 analog phones in parallel on (the only one) FXS ports of SPA-1001 and it works beautifully.

    PS: mae good course use you only 2-wire cable (internal thread) to connect the PAP2T FXS1 port and the phone (s). The 4-wire cable may make some analog phones crashing the device PAP2T IDE oucederomsurlesecondport FXS1.

  • version lockbox to the command line client

    Hi, we are the extent of the UnixAgent deploy/creation of script, the agent uses local FglAM, but that the agent requires credentials to be released to customers, is there a way to release the safe area of the command line, possibly using fglcmd. Can you please indicate thanks

    It's one of our developers (thank you Robert C)

    "You need to write a groovy script to do and run the script using fglcmd. I will attach an example of this. Make sure that the script is updated to change ' @EMBEDDED_FGLAM_NAME @ '. You may also need to change the security zone that is out, but the server API documentation should help with that. »

    /*

    * Copyright 2013 Dell Inc.

    * ALL RIGHTS RESERVED.

    *

    * This software is confidential and exclusive information

    * Dell Inc. ("confidential information"). You must not

    * disclose such confidential information and should use it only in

    * compliance with the terms of the license agreement that you have entered

    * in with Dell Inc.

    *

    * DELL INC. MAKES NO REPRESENTATION OR WARRANTY REGARDING

    THE SOFTWARE ADEQUACY, EXPRESS OR IMPLIED,

    * INCLUDING BUT NOT LIMITED TO THE IMPLICIT GUARANTEES

    * MERCHANTABILITY, FITNESS HAS A PARTICULAR PURPOSE, OR

    * ABSENCE OF COUNTERFEIT. DELL ACCEPTS NO LIABILITY FOR ANY

    * DAMAGES SUFFERED BY LICENSEE AS A RESULT OF THE USE, MODIFICATION

    * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.

    */

    import com.quest.nitro.service.sl.interfaces.credentials.CredentialManagementException;

    import com.quest.nitro.service.sl.interfaces.credentials.InvalidPasswordException;

    Import org.apache.log4j.Logger;

    def EMBEDDED_FGLAM_NAME = ' @EMBEDDED_FGLAM_NAME @ '.

    def LOG = Logger.getLogger ("release-system-lockbox-to-default");

    Log.info ("freeing up the lockbox to named FglAM '" + EMBEDDED_FGLAM_NAME + "'");

    def CMS is server. CredentialManagementService;

    def systemLockbox = cms.getDefaultLockbox ();

    def defaultFglam = cms.listCredentialClients () .find {EMBEDDED_FGLAM_NAME.equals (it.getHostName ())}

    If (defaultFglam == null) {}

    LOG.error ("failed to FglAM with the hostname = '" + EMBEDDED_FGLAM_NAME + "'");

    return;

    }

    try {}

    defaultFglam.assignLockbox (systemLockbox, null);

    }

    {} catch (GUY CredentialManagementException)

    LOG.error ("Plan credential error freeing lockbox", FMC).

    }

    {} catch (InvalidPasswordException Rei)

    LOG.error ("invalid password to release the security zone", ipe);

    }

    Log.info ("done releasing lockbox system default");

Maybe you are looking for