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

Similar Messages

  • Oracle Error Code and Message for Query Timeout

    Hi,
    I need to catch the oracle error code and message for query timeout.
    I am using Oracle 9i and could not find any relevant error code/message
    for query timeout in Oracle Error Messages.
    If anyone has encountered such error messages, please let me know the
    Oracle Code or Error message.
    Thanks & Regards,
    Kanjana

    Fly is correct in that Oracle will normally let a query run forever in the absense of a user profile or dbms_resource setting that limits a users (query) resouce usage.
    The errors returned for these condition would probably vary but errors ORA-02092 "exceeded session limit on CPU usage, you are being logged off" and ORA-02093 "exceeded call limit on CPU usage" might be of interest.
    But for distributed queries Oracle does impose a time limit. See Oracle error ORA-02049 "timeout: distributed transaction waiting for lock"
    HTH -- Mark D Powell --

  • Statement for Lock and Unlock an Oracle user (Urgent)

    Hi DBAs.
    I just want to know about the statement used for lock and unlock the Oracle user thru sysdba suer.
    Thanks
    Hassan

    Hey,
    SQL> alter user <USERNAME> account lock;
    and
    SQL> alter user <USERNAME> account unlock;
    Cheers,
    Marcello M.
    Sorry Justin, same answer........
    Message was edited by:
    Marcello M.

  • Finding the lock wait timeout in Oracle 11g

    Want to know how to find the lock wait timeout set on Oracle 11g

    Hi,
    To find number of seconds a distributed transaction waits for a lock:
    SELECT *
      FROM v$parameter
    WHERE NAME = 'distributed_lock_timeout';To find all parameter's related to lock you can use something like this:
    SELECT *
      FROM v$parameter
    WHERE NAME like '%lock%';Thanks,
    Shankar

  • Difference between and lock and eneque in oracle

    Please give the difference between a lock and eneque in oracle
    Naveen

    Here is what Oracle defines an Enqueue to be in the 9.2 Glossary >>
    enqueue
    Shared memory structures that serialize access to database resources. Enqueues are local to one instance if Real Application Clusters is not enabled. When you enable Real Application Clusters, enqueues can be local or global to a database. (See also: latch, lock, and resource.)
    <<
    There is also a type of enqueue associated with Advanced Queueing. Similar concept but different specialized purpose.
    Generally speaking Locks on the other hand serialize access to row data. Oracle actually records row locks in the data blocks.
    Enqueues, Locks, and Latches are perform the same basic function: serialize access but the methods are implemented differently and applied to different functional areas of the rdbms.
    HTH -- Mark D Powell --

  • SQL Updates, locks and multithreading

    I am trying to do the following:
    Updating 5M rows in multiple database writer thread using OCI. I have not set any Oracle parallel execution related parameters yet.
    However, it is found that there is no performance improvement in doing this in multiple threads.
    My questions:
    1. Does Oracle lock the table during each update? I think it does and that is why there is no performance enhancement.
    - If yes, is there any way to tell Oracle not to lock the table during updates. As it is, my threads will never update the same row in parallel.
    2. Is the way out is to do the following?
    - Partition the table
    - Do an "ALTER SESSION ENABLE PARALLEL DML"
    - Fire updates
    3. Is there any OCI way of doing this?
    Thanks in advance,
    ~Sri

    I am trying to do the following:
    Updating 5M rows in multiple database writer thread using OCI. I have not set any Oracle parallel execution related parameters yet.
    However, it is found that there is no performance improvement in doing this in multiple threads.
    My questions:
    1. Does Oracle lock the table during each update? I think it does and that is why there is no performance enhancement.
    - If yes, is there any way to tell Oracle not to lock the table during updates. As it is, my threads will never update the same row in parallel.Unless you're explicitly locking the table, Oracle won't lock it. Oracle doesn't ever escalate row locks to table locks.
    My guess is that something in your system is bottlenecked. Perhaps your disk, CPU, or RAM is maxed out. Perhaps your system is busy waiting to switch redo logs. There are lots of potential bottlenecks here, you'd have to do some investigation to figure out what's taking so long.
    One quick thing you might try is to use the /*+ append */ hint (i.e. insert /*+ append */ into table (your query here)). This tells the database to do a parallel direct path load, avoiding most redo log generation. This improves the speed, but isn't particularly friendly for database recovery. Make sure you read the documentation on this hint before you use it.
    You may also be able to change your SQL to use the bulk collection syntax.
    I'd also take a look at this bit of the Oracle documentation, "Serial and Parallel INSERT"
    <http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/server.817/a76965/c21dlins.htm#2507>
    There's a pretty good asktom article over here. Search the site and you'll find lots of info on this sort of thing.
    <http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1119033812977>
    2. Is the way out is to do the following?
    - Partition the table
    - Do an "ALTER SESSION ENABLE PARALLEL DML"
    - Fire updatesI'm assuming that you have the partitioning options in your database. If so, this is likely to be faster, though I'm not sure by how much. Have you benchmarked a test to see? Of course, if you account for the time to partition the table, you're likely to remove all of your performance gain.
    Also, unless you are able to spread your inserts across the various partitions, you're unlikely to see any performance benefit.
    This strikes me as a pretty drastic approach.
    3. Is there any OCI way of doing this?Well, you could execute the SQL above against the table from OCI. I'd recommend doing this sort of thing from SQL*Plus or something of that genre, though, simply because folks may get upset at you if your application partitions their tables for them.
    Thanks in advance,
    ~Sri

  • Dead lock and Blocking Lock

    I would like to understand what is major difference between Dead Locks and Blocking Locks in Oracle. If someone could explain or point me to good web Link I would really appreciate
    Thanks.

    Tony's advise is very good.
    In simple terms a blocking lock is a lock being held by one session that is preventing another session from performing an DML operation on the same data until the holding session commits or rollbacks.
    A deadlock is a situation where two or more sessions lock data in such a manner as each session is waiting on a resource held by another session so that none of the session can complete their unit of work. That is session A locks row 1 then session B locks row 2 followed by session A attempts to lock row 2 while session B now attemps to lock row 1. Neither session A or B will ever be able to complete thier transaction releasing the locks and allowing waiting sessions to process since each session is waiting on a resource that the other session has while holding a resource the other session needs. In other words a deadlock. Oracle detects deadlocks and kills one of the sessions freeing resources.
    HTH -- Mark D Powell --

  • Locking and blocking - puzzlement.

    I have a table - relatively simple
    CREATE TABLE Sysstat
    M_Time     DATE,
    Usr_pct    NUMBER(10, 0),
    Sys_pct    NUMBER(10, 0),
    <a few more NUMBER(10, 0) deleted...
    CONSTRAINT Sysstat_PK PRIMARY KEY (M_Time)
    );Issue (From an SQLPlus session) the command DELETE FROM Sysstat - but do not COMMIT.
    Go to SQLDeveloper - and (try to) do the following
    INSERT INTO Sysstat
    SELECT ROUND(TO_DATE  (Sysstat_ext.M_Time, 'DD-MM HH24:MI:SS'), 'MI') AS "Measurement Time",
           ROUND(TO_NUMBER(Sysstat_ext.Usr_pct),    0) AS "% Usr",
           <fields deleted>
    FROM Sysstat_ext
    COMMIT;The SQLDeveloper session completely hangs - forever* (at least 20 mins at this stage).
    As I understood matters with Oracle there were three possibilities.
    1) PK violation. The SQLDeveloper session "sees" that there are still records in Sysstat (changes
    are uncommitted as far as he's concerned), but there is a PK violation in the data to
    be inserted anyway, so the SQLDeveloper session should tell the user Sysstat_PK violation.... error...
    2) No potential PK violation. The SQLDeveloper session doesn't know whether the SQL*Plus
    session will commit its deletions or not, therefore the SQLDeveloper session commits and Oracle keeps track of the
    necessary chains of pointers internally and/or when the SQL*Plus session tries to commit, it's accepted or refused
    depending on whether this will cause other issues (FK violation for example)
    or
    3) Oracle knows that there's a deadlock and after a certain period (configurable?) rolls back the SQLDeveloper session
    and informs the user.
    Could some kind soul explain to me what, exactly, is going on - and why my reasoning is so obviously erroneous.
    I have been looking at Kyte's architecture book, so maybe a concrete example (I've never deadlocked Oracle
    before) would help clarify the concepts for me.
    Paul...

    Paulie wrote:
    >
    Could some kind soul explain to me what, exactly, is going on - and why my reasoning is so obviously erroneous.
    I have been looking at Kyte's architecture book, so maybe a concrete example (I've never deadlocked Oracle
    before) would help clarify the concepts for me.I've now read a bit about mutexes in Oracle - not that I understood all of it.
    no deadlock is occuring.Well, what else should one call a session that is blocked indefinitely? Is there another
    computer science term for this phenomenon?
    I suspect a Mutex wait is the cause.OK - so, some sort of device to "regulate concurrent access to a shared resource". That's fine.
    The blogs and websites which discuss this seem to be a propeller-head's wet dream with obscure X$_Blah
    table configs and Totallyunknown_even_to_Oracle_Support parameters being bandied about like there's
    no tomorrow.
    What I would like to know is a bit more prosaic (and perhaps a level less technically sophisticated).
    Is my reading of Oracle's Locking/Latching/Multi-User behaviour correct in what I wrote originally, i.e.
    Scenarios:
    1) PK violation. The SQLDeveloper session "sees" that there are still records in Sysstat (deletion
    is uncommitted as far as he's concerned), but there is a PK violation in the data to
    be inserted anyway, so the SQLDeveloper session should tell the user Sysstat_PK violation.... error...
    no change to database - SQLDev user informed
    2) No potential PK violation. The SQLDeveloper session doesn't know whether the SQL*Plus
    session will commit its deletions or not, therefore the SQLDeveloper session commits and Oracle keeps track of the
    necessary chains of pointers internally and/or when the SQL*Plus session tries to commit, it's accepted or refused
    depending on whether this will cause other issues (FK violation for example)
    or
    3) Oracle knows that there's a deadlock and after a certain period (configurable?) rolls back the SQLDeveloper session
    and informs the user.
    Or am I still competely at sea with what Oracle is about? I was of the understanding that whatever* happened,
    you should never have a situation where a session hangs indefinitely, due to Oracle's system
    of multi-version concurrency - basically, I'm asking what is going on here and how does it
    fit with my current* (and obviously mistaken) understanding of how Oracle works.
    Thanks for your input so far.
    Paul...A basic truism exist for Oracle.
    Readers do not block writers & writers do not block readers!
    What you fail to recognize is that your test case has two WRITERS; both are doing DML!
    two sessions want to change same resource & to maintain data consistency & integrity
    the changes must be serialized. One must complete before the second can proceed.
    Oracle utilizes Interested Transaction List (ITL) to maintain block level data consistency.
    SELECT DECODE(request,0,'Holder: ','Waiter: ')||sid sess,
    id1, id2, lmode, request, type
    FROM V$LOCK
    WHERE (id1, id2, type) IN
    (SELECT id1, id2, type FROM V$LOCK WHERE request>0)
    ORDER BY id1, request
    /

  • Oracle Vm Manager login timeout

    We are testing Oracle Vm Manager and notice that the timeout when logged into the web interface is really low. It logs you out after a minute the you have to refresh and login again. It is driving us crazy. Is there a way to increase the logout time for the Manager web interface?

    Hi,
    another option is the following:
    Include some shared="true" into /opt/oc4j/j2ee/home/config/secure-web-site.xml
    <web-app application="default" name="jmsrouter_web" load-on-startup="true" root="/jmsrouter" shared="true" />
    <web-app application="javasso" name="javasso-web" root="/jsso" shared="true" />
    <web-app application="ascontrol" name="ascontrol" load-on-startup="true" root="/em" ohs-routing="false" shared="true" />
    <web-app application="datatags" name="webapp" load-on-startup="true" root="/webapp" shared="true" />
    <web-app application="help" name="ohw-ovs-help" load-on-startup="true" root="/help" shared="true" />
    <web-app application="OVS" name="webapp1" load-on-startup="true" root="/OVS" shared="true" />
    <web-app application="OVS" name="webservices" load-on-startup="true" root="/OVSWS" shared="true" />
    <access-log path="../log/default-web-access.log" split="day" />
    Regards
    Sebastian

  • Error 131 Transaction rolled back by lock wait timeout

    Hello all,
    I was trying to run apriori, and then HANA writer in my database.
    Apriori executes directly, and then I configure and try to execute HANA Writer. But it keeps executing for more than half an hour, and then gives the following error: Error 131 Transaction rolled back by lock wait timeout. Lock timeout occurs while waiting TABLE_LOCK of mode EXCLUSIVE.
    Bimal suggested me to reduce the data to be analysed, so then I reduced it to a pretty small part and executed again.
    It gave me the same error after more than 30 minutes waiting executing.
    after having this error, I tried just execute apriori, but with a filter of 5 transactions and than it worked. After that I tried to visualize the results, and got the following error:
    It means that my HANA memory is full?
    I got the view from HANA:
    Regards!
    Error 131 Transaction rolled back by lock wait timeout 

    Hi Jurgen,
    I'm a developper for PAL from Shanghai team.
    Could you please provide some details information about this case:
    -          How many records did you use ?
    -          What’s the value of “MIN_SUPPORT” and “MIN_CONFIDENCE” did you use ?
    The algorithm of apriori will consume much memory when the input data is very large and min_support is low.
    So I suggest you set “MIN_SUPPORT” and “MIN_CONFIDENCE” as 0.9 firstly, check if it can output result.
    Thanks,
    Peng

  • Lock and send ASO

    Hi,
    We are running Essbase version 11.1.1.2 and Smartview 11.1.1.2 (Build 122).
    I have some users that would like to load some data via Excel into an ASO cube. I am aware this would be slower than using BSO.
    I have tried both HSSETVALUE and the ad-hoc with submit data and I get an error 'You do not have sufficient access to perform a lock on this database'.
    I am pretty sure this is because of the 'lock and send' nature of submit data and the fact you can't lock a block on ASO because no blocks exist.
    I have read something about the 'classic add-in' having the option of not locking before sending. What is this? I actually don't think I have it. I have Excel 2010 and everything is consolidated under one ribbon I think from memory.
    What are my options? The cube is big and an ASO for a reason, there's a large number of big dimensions. I could change the Excel sheets to load to SQL Server and run via a rules file. But I would rather load from Excel.
    Rgds
    James

    The oldest release I have is 11.1.1.3, but if I go to this ASOsamp.Sample intersection:
         1 to 13 Years
         Sale
         004118
         Original Price
         Cash
         Under 20,000
         Digital Cameras
         No Promotion
         80101
         Curr Year
    Jan     5
    In either Smart View or the Add-In and put in a different number and submit it (Smart View) or Send (add-in), it works. Of course I'm logged in as the admin.
    Does your user id have write rights?
    http://docs.oracle.com/cd/E12825_01/epm.111/epm_security/frameset.htm?apas02.html
    Regards,
    Cameron Lackpour
    Edited by: CL on Nov 20, 2012 11:21 AM
    'Cause spelling my name is beyond me.

  • Can Oracle Apps OFA and Business Intelligence Suite be integrated?

    Hi,
    Is it possible to integrate Oracle Applications' "Oracle Financial Analyzer" and "Oracle Business Intelligence Suite" into Oracle Portal at all?
    I know they are all web enabled products using HTML, Disco viewer and Oracle Reports, and I'm pretty certain I've seen a demo of OBIS working from Portal already somewhere.
    I want to put Larry's Daily Business Close into practice!!
    I need an urgent answer on this please...
    John

    Hi I looked at this last year with the add of an Oracle Express consultant in the UK, we had an express 6.3 implementation of OFA and 1.0.2.2 of 9iAS. The problem was how get a dynamic implemention OFA within a portlet. At the time the only conclusion was to host the web enabled OFA within an iFrame portlet, this however had its own problems due to the timeout settings within Express Server causing hanging sessions, requiring administrator rectification and the user having to close and restart the portal session. NOT RECOMMENDED FOR PRODUCTION ENVIRONMENT. It may be implementable now but I doubt it.

  • [Macromedia][Oracle JDBC Driver]Execution timeout expired

    From time to time, I get "[Macromedia][Oracle JDBC Driver]Execution timeout expired" errors in my log files on queries that should normally take < 10 ms. If this happens too often (the exact count seems to be different every time), ColdFusion stops responding (and logging!).
    Between CF and the Oracle DB server I have a firewall.
    The firewall seems to be ok, Oracle stops receiving db requests without further errors and CF stops without writing anything in the log files.
    What now? I'm using the latest CF9, fully patched and updated. We use a reboot script for the time beeing, but we'd like to know what is going on.

    Is there any way you can bypass the firewall on a networking level to rule it out?

  • 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.

Maybe you are looking for