Oracle 8i Locks

We are having problems with users locking each other throughout the day, in which one user is doing a select, and the other an update. In the last case, the user doing the following select statement acquired an exclusive lock:
SELECT "INVENTORY"."INVENTORY_ID",
SubStr( "INVENTORY"."RECEIPT_NUMBER", 1, 7 ) receipt_number,
"INVENTORY"."AGENCY_REPORT_YEAR",
"INVENTORY"."AGENCY_REPORT_NUMBER",
"INVENTORY"."AGENCY_REPORT_SUFFIX",
"INVENTORY"."NUMBER_OF_PACKAGES"
FROM "INVENTORY"
WHERE ( Upper ( receipt_officer_id ) Like '2026542%' )
Should an exclusive lock be placed here?
TIA
null

For the select statement there wont't be any locks on the table.
In the select statement are you using the SELECT ... FROM table FOR UPDATE OF also (The sql statement you have given does not have the update clause) then a Row Share lock will be held on the table.
Refer to the following URL http://technet.oracle.com/doc/oracle8i_816/server.816/a76965/c23cnsis.htm#9975
for the table lock modes that statements acquire and operations that those locks permit and prohibit.

Similar Messages

  • Oracle 10g - lock statistics

    What are the different situations in which Oracle will lock existing table/index statistics automatically?
    As per my undrstanding to lock the statistics we must use "dbms_stats" package with lock_table_stats/lock_schema_stats procedures. I dont see any other situation where Oracle automatically locks the statistics.
    Please share your experience.

    I dont see any other situation where Oracle automatically locks the statistics.Oracle never locks the statistics on its own. Oracle has only given methods so that one can decide whether to collect the statistics for volatile/static tables; so that the execution plans do not change drastically.

  • Where can I get oracle dead lock information

    Hi Experts,
    two days back I find oracle dead lock information at SM21 log file but when I checked today the old data was over written by new data.
    Where can I find oracle dead lock information other than SM21? can anyone please help
    Thanks in advance
    Regards
    Veera
    Edited by: Veerab on Apr 27, 2011 8:22 AM

    Hi,
    Have you refered [SAP Note 84348 - Oracle deadlocks, ORA-00060 |https://service.sap.com/sap/support/notes/84348]? It contains good detailed description about possible oracle deadlock situations and analysis.
    Along with the trace file generated by oracle (at directory /oracle/<SID>/saptrace/usertrace/), You can get historical information from alert<SID>.log file located at /oracle/<SID>/saptrace/background/.
    In alert<SID>.log file the deadlock situation is written with deadlock graph at the time of occurances.
    Regards,
    Bhavik G. Shroff

  • How can I prevent oracle from locking accounts after failed logins?

    how can I prevent oracle from locking accounts after failed logins?
    Thanks

    svarma wrote:
    So what is the difference between the profile settings ...FAILED_LOGIN_ATTEMPTS and the parameter settings SEC_MAX_FAILED_LOGIN_ATTEMPTS?
    Prior to 11g we only used profiles to control failed_login_attempts.. Then why we need thsi new parameter now?http://download.oracle.com/docs/cd/E11882_01/server.112/e17110/initparams221.htm#I1010274
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17222/changes.htm#UPGRD12504
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/statements_6010.htm#SQLRF01310
    As documented ...
    FAILED_LOGIN_ATTEMPTS is a property of a profile, and will lock an account
    SEC_MAX_FAILED_LOGIN_ATTEMPTS is an initialization parameter and will drop a connection but says nothing about locking accounts.

  • Oracle's locking strategy question

    I have a question related to Oracle's locking mechanism which I understand is related to taking "snapshots in time" to avoid writers blocking readers (which happens in SQL Server).
    Suppose I had a table T1 with 1 billion records and column C1 = 4 in every row. Suppose the following events occur:
    12:00 update T1 set C1 = 5
    12:01 select C1 from T1 where ... (and this statement returns only one row)
    1:00 the update statement executed at 12:00 finally finishes
    Would oracle return the value 4 regardless or which row was selected at 12:01?
    Why would this be more correct than locking the table and waiting until 1:00 and returning 5? Sure, this would be a long wait, but at 12:00 a command was issued to set every value to 5!

    You are question is related to oracle transaction
    control and read consistency in the database in
    Oracle database all the SQL and DML runs with SCN
    timestamp.
    for example
    Session 1 SQL 12:00 > UPDATE t1 SET c4=5 ;
    ---assuming this runs for an hour
    before updating c4=5 it takes the snapshot of the C4
    column data and keeps in
    UNDO segments to make other sessions read
    consistent.
    Session 2 SQL 12:01 > SELECT c4 FROM t1 WHERE ....
    this will return 4 as the DML is not yet comminted in
    the Session 1
    To happen this Oracle database server process reads
    the data from UNDO to answer your question.locks are
    matianed at the database BLOCK header level.
    Let me put a simple thought here
    You have two debit cards issued for one account one
    is with you and the other one is with your beloved
    one.Balance in your account = Rs 40000
    1) at 12:00 you went to a ATM and inserted your debit
    card to draw amt Rs 20000
    and your transaction is still processing ( you not
    recieved the cash)
    2) at 12:01 your beloved one went an another ATM and
    interested to see the balance so do you think Rs
    40000 should be shown or Rs 20000.
    hope you got some ideaNot to pick nits, but I think this is a bad example. If you had such an important action (especially if it was going to take a long time to complete) you would/should have some kind of lock on modifying the account value so that this very thing couldn't happen! Only one transaction at a time gets to update the balance. In a sense, that might make Oracle look like the SQL Server you appear to be familiar with (the 2nd transaction would wait. A very long time!) But for a bank account type transaction, you almost have to.
    Gaff

  • Oracle Explicit Locks

    Hello experts ,
    Once again i want to clear my basic knowldge in terms of oracle locks.
    what i knows is that oracle atumatically locked the object whenever we perform any dml operation.( update,delete)
    but it is row level exclusive lock ( i.e. RX,in v$locked_object, it show locked mode 3 )
    It is implicit lock which oracle provided automatically.
    and the other lock is Explicit lock,
    it is either we have to locked the by using LOCK statement ( by using LOCK statement we can lock the table in modes
    (i.e row share(2),row exclusive(3), share(4), row share exclusive(5),exclusive(6) )
    OR
    the table is also locked by statemet "select ..for update"( but its row exlusive lock (RX 3))
    but
    when and in what condition we apply explicit lock?
    what are the practical future of these lock?
    can you please explain about these explicit lock like
    row share(2)
    row exclusive(3)
    share(4)
    row share exclusive(5)
    exclusive(6)
    I have read about these lock from books , blogs and other internet sites , but still my concepts is not clear
    in these area.
    Thanks in advance for your help.
    Regards,
    Prashant Mhatre

    Oracle uses locks (aka enqueues) to prevent destructive concurrent operations on a resource. Here is a short description of the different lock types written by Jonathan Lewis ("the international recognized Oracle Expert"): http://jonathanlewis.wordpress.com/2010/06/21/locks/.
    Except of the SELECT FOR UPDATE case I don't think there are many situation in which setting an explicit lock is necessary - the server knows where and when locks have to be used.

  • Ingres vs Oracle exclusive locking

    Ingres allows an exclusive lock on tables, set lockmode on tablename where readlock = exclusive which means the users can't access the same
    rows that are being modified by another query.
    Is there anything in oracle that does the same thing ? All of Oracle's locking seesm to be that you can
    still read data. And that is what my user is afraid of. He doesn't want to read old data, when it's
    being changed.
    How do you work around this ?
    Thanks.

    Ingres allows an exclusive lock on tables, set lockmode on tablename where readlock = exclusive which means the users can't access the same
    rows that are being modified by another query.
    Is there anything in oracle that does the same thing ? All of Oracle's locking seesm to be that you can
    still read data. And that is what my user is afraid of. He doesn't want to read old data, when it's
    being changed.
    How do you work around this ?
    Thanks.

  • Does Index in Oracle Text lock local files?

    Hi, I am planing to implement content search using file datastore. Let me explain how the whole search going to work, Users are going to upload the file, I am going to store the information about the file like filename, size, keywords, file path etc in Oracle table and I am going to store the original file in a different server. When indexing on filepath, does index lock local files on the Operating system? Does it affect the live data? Please I need answers to this ASAP. Can anyone help?
    Thanks,
    Meena

    Hi,
    there are differences between the Engine of Text indexing, in 10G it was Verity, in 11G (from version 11.1.0.7) it is the Stellent technology, but I do not hope this is it.
    Maybe you could make a dump of the creation of the indexes in both 10g and 11g. This can be done through:
    select ctxsys.ctx_report.create_index_script('KSK_FILE_TABLE_CTX1') from dual;
    This wil give you a create script with all the parameters. Maybe there is a different in your default settings for text indexes, possible the FILTER.
    Herald ten Dam
    Superconsult.nl

  • Oracle 8i locking and timeout

    Hi,
    I am talking to an Oracle 8.1.7 db through Perl DBI for a certain Web Application.
    In the back-end, a script is invoked every hour to sync parts of this db, with the master db. The sync'ing script takes quite a while to complete and it consists of a single transaction ( several update statements followed by a single commmit at the very end).
    Now, I want to know what happens to any user who tries to modify something through the web-interface. If a query from the web-interface finds that a row is locked by the syncing script, how long will it wait before a timeout? ( if any timeout occurs at all, in the first place ! ). Can I control this timeout?
    Please repond ASAP.
    Thanks in advance,
    Rajesh

    How much control do you have over the SQL being generated? There is a keyword 'NOWAIT' that can be added to a statement indicating that it shouldn't wiat for resources-- if it can't lock them immediately, it returns an ORA-00054 (if memory serves) resource locked and NOWAIT specified. Otherwise, by default, the statement will wait indefinitely.
    In ODBC, you can specify a query timeout that will kill all queries after some amount of time.
    Justin

  • Oracle's Locking Architecture

    I'm specifically talking about 9i & 10G.
    Is there any info that explains Oracle Locking mechanisms? I tried to find something on metalink but all I found was how to detect locks. I need to start from the beginning so that I understand the lock types when data is read, modified or deleted.
    Any info please?

    So in a nutshell, Oracle obtains an UPDATE lock to
    modify data but does obtain any locks to read data.
    Have I read this correctly?Effectively, yes.
    That's Oracle's magic ..... 'readers do not block writers and writers do not block readers'
    Oracle uses a 'Consistent Read' mechanism to rebuild any data block back to the time of query. If a user updates a row but has not committed, and another needs to see that row, the second user will recreate the image of the row using the in-memory copy of the updated row and the rollback/undo information about the row.
    A query only needs to put sufficient locks in place to ensure the table does not get whacked. Nothing at the row level.
    An update needs sufficient locks to ensure other writers can not change the row ... and to tell the readers to rebuild the block instead of using the 'current' version.

  • Root issue for oracle AE  lock

    Hi Friends,
    What kind of root issue leads to AE lock(Edition Lock) in oracle 11.2?
    How do we implement a solution for AE type locked?
    Thanks
    newdba

    Hi Karan,
    Thanks for your explaining. the reason is we have slow performance in database. Per checked, I found lots of block with AE. per your recommendation as
    OWNER VIEW_NAME TEXT_LENGTH TEXT TYPE_TEXT_LENGTH TYPE_TEXT OID_TEXT_LENGTH OID_TEXT VIEW_TYPE_OWNER VIEW_TYPE SUPERVIEW_NAME EDITIONING_VIEW READ_ONLY
    SYS CURRENTEDITION_OBJ 1490 select o."OBJ#",o."DATAOBJ#",o."OWNER#",o."NAME",o."NAMESPACE",o."SUBNAME",o."TY N N
    N N
    Thanks
    newdba

  • Oracle database locks

    Today I ran the following queries in my 2 node RAC database. Enterprise database server 11.7 linux version.
    SQL> select * from dba_blockers;
    no rows selected
    SQL> select * from dba_waiters;
    no rows selected
    SQL> SELECT substr(DECODE(request,0,'Holder: ','Waiter: ')||g.sid,1) sess,s.machine,s.serial#,s.sql_id sqlid,
    2 id1, id2, lmode, request, g.type, g.inst_id, seconds_in_wait
    3 FROM GV$LOCK g, gv$session s
    4 WHERE (id1, id2, g.type) IN
    5 (SELECT id1, id2, type FROM GV$LOCK WHERE request>0)
    6 and g.sid = s.sid
    7 and g.inst_id = s.inst_id
    order by sess desc;
    SESS MACHINE SERIAL# SQLID ID1 ID2 LMODE REQUEST TY INST_ID SECONDS_IN_WAIT
    Waiter: 6462 appserver 49027 2vzvm60fvf506 276026 0 0 6 TM 2 2078
    Holder: 6492 database server 8546 276026 0 3 0 TM 1 28815
    SQL> SELECT a.sql_text
    FROM gv$sqltext a,
    gv$session b
    WHERE a.address = b.sql_address
    AND a.hash_value = b.sql_hash_value
    AND b.sid = &1
    ORDER BY a.piece; 2 3 4 5 6 7
    Enter value for 1: 6492
    old 6: AND b.sid = &1
    new 6: AND b.sid = 6492
    no rows selected
    INST_ID SID OBJECT_OWNER OBJECT_NAME LOCKED_MODE OS_USER_NAME
    1 6492 ABC XYZ Row-X (SX) oracle
    2 6462 ABC XYZ None appuser
    I wanted to know why dba_blockers or dba_waiters not showing blocked or waiting sessions, why no sqlid associated to holder session ?
    Thanks for your time and help

    Thanks for your quick response. you provided good information
    I understood that currently no session is holding the lock for which other session is waiting, i.e dba_blockers showing zero rows.
    But how the below query is showing holder and waiting session and no sql query associated to holding session.
    SQL> SELECT substr(DECODE(request,0,'Holder: ','Waiter: ')||g.sid,1) sess,s.machine,s.serial#,s.sql_id sqlid,
    2 id1, id2, lmode, request, g.type, g.inst_id, seconds_in_wait
    3 FROM GV$LOCK g, gv$session s
    4 WHERE (id1, id2, g.type) IN
    5 (SELECT id1, id2, type FROM GV$LOCK WHERE request>0)
    6 and g.sid = s.sid
    7 and g.inst_id = s.inst_id
    order by sess desc;
    SESS MACHINE SERIAL# SQLID ID1 ID2 LMODE REQUEST TY INST_ID SECONDS_IN_WAIT
    Waiter: 6462 appserver 49027 2vzvm60fvf506 276026 0 0 6 TM 2 2078
    Holder: 6492 database server 8546 276026 0 3 0 TM 1 28815

  • Oracle Drive Locking Issue

    Hi,
    We have Oracle Drive installed with Oracle 10.1.2 Portal. When a user opens an MS
    Word file, immediately in the MS Windows Explorer window, the STATUS attribute
    shows "Locked by <user>", where <user> is the userid of the user.
    However, the STATUS attribute for other users on other computers using Oracle
    Drive with MS Windows Explorer do not immediately see this "Locked by <user>"
    message. Is there a way to get this message propagated immediately to the other
    users so that they do not open the file expecting to be able to write to the file?
    It takes the other users a while and a lot of hitting the REFRESH menu option
    to see this propagated to all of the other users.

    I'v found the problem. I need to le empty in the port box...
    So, thank you :)

  • Oracle 9i lock file (lkDBNAME)

    Greetings,
    Could you please give me some info on the $ORACLE_HOME/dbs/lkDBNAME ?
    What is it used for? can we delete it or rename it?
    Is it created automatically by the Oracle Instance upon startup?
    What happens if the Instance is shut down?
    Thanks.

    t is a lock file use by the oracle background process. When an oracle instance starts, one of the background processes locks the file, by creating it first. This prevents a new background process from getting the lock. You are not suppossed to delete it or rename it.

  • CMP - Oracle Rdb - Locked transaction

    Can anyone shed some light as to why CMP to Rdb mapped entity beans
    cause serious locking issues in Oracle Rdb?
    Also, how best to control databse transaction (read & read-write tx)
    in CMP?
    Best regards,
    Bobby Brown from the beautiful country Australia...

    Thanks Justin for your help.
    I have found the error.
    In debug mode, the comerror.Description() did return a bstrt containing the exception's description. So, I was able to put the description in a STL string.
    In Release mode, then comerror.Description() returned an empty bstrt. When i tried to put this empty bstrt in my STL string, this raised an exception (the STL string tried to read a NULL char*).
    So I had an exception generated into my catch block, this interrupted my program and i could not rollback my transaction.

Maybe you are looking for

  • Help me pleaseee idk what happen to my phone PLEASE

    i was using my snapchat nd then i clicked on a name and it went to safari and it froze andthen the screen went black but it looks like its on and i cant reset nor turn it off  and ive neverdropped my phone what can i do?somebody help me pleaseee i wo

  • Unable to view bt bill for 3 months so far

    It all started around March with this "new updated" software The bill simply doesn't show My own view is that the software is deliberately useless to try and force customers to use direct debit There's no simple html option either, just pages of bad

  • Why Bother with Apple TV?

    Get a Mini, hook it up via DVI to your TV, and enjoy your music, movies, rented movies, downloaded movies, photos, etc - without streaming anything or buying another box that will just need to be replaced in 6 months. At least with a Mini you get a w

  • Place Dialogue Box is HUGE and won't resize

    When I hit File Place, the dialogue box takes up the entire screen, and I can't resize it. The only way I can resize is if I hit "Use Adobe Dialog" in the bottom left of the screen. That lets me resize, but if I ever hit "Use OS Dialog"   and hit Pla

  • Need help file sharing with a powermac G4 and ibook

    I need to transfer files from my G4 to an ibook. I am using ethernet slot B on the G4 and the ibook has an airport card. I also have a router. Does anyone have an easy way to do this? I want to set up a connection between these two computers without