How to avoid deadlock - ORA-00060 in trigger

Hi,
We are using 11.2.0.3 and have a trigger which acts upon a mutex table.
Trying to catch when value from other program has changed locked value from 0 to 1 to indicate they have finished.
Once they finished we need to lock the mutex table by updating locked value.
Code below gives error ORA-00060 - deadlock.
Any idea how to avoid but allow us to updat ethe mutex table in trigger at star t to say we are locking and at end to indicate we are finished.
Thanks
CREATE OR REPLACE TRIGGER example_trg AFTER UPDATE
ON por_zic_flags
FOR EACH ROW
when (NEW.locked = '0' and old.locked = '1')
declare
PRAGMA AUTONOMOUS_TRANSACTION;
I INTEGER;
v_locked por_zic_flags.locked%type;
begin
select locked
into v_locked
from por_zic_flags
--where tabname = ‘table name’
  for update;
update por_zic_flags set locked = '2';--, guid = '100'; -- unique seq#
commit;
-- call procedure do processing on other tables
-- Now indicate finished processing
select locked
into v_locked
from por_zic_flags
  for update;
update por_zic_flags set locked = '0';--, guid = '100'; -- unique seq#
commit;
end;

>
Trying to catch when value from other program has changed locked value from 0 to 1 to indicate they have finished.
Once they finished we need to lock the mutex table by updating locked value.
Code below gives error ORA-00060 - deadlock.
Any idea how to avoid but allow us to updat ethe mutex table in trigger at star t to say we are locking and at end to indicate we are finished.
>
Triggers should not be used for non-transactional purposes like this.
A simple SELECT . . . WHERE (myLock = 'UNLOCKED') FOR UPDATE can be used to query the record and lock it if the lock is not already set. Then your code can update the lock value and that will prevent the same query by other users from being successful.
But you haven't really provided any information about what you are trying to do.
If you want to prevent two processes from executing at the same time you can use Oracle's LOCK functionality.
See this thread for how to use DBMS_LOCK to create your own locks that can serialize access to your procedures.
Re: possible to lock stored procedure so only one session may run it at a time?

Similar Messages

  • HOw to avoid DeadLocks when you schedule a Sql Server Agent Job and calling SSIS packages

    Hi All,
    I have scheduled 2 packages in in Sql Server Agent jobs .
    First job which is having Package 1 executing at 11 AM and where I am inserting the data in the table.
    Second job which is having Package 2 executing at 12 AM and where I am updating the data in the table based on the first job inserted records.
    When I am executing my first job it taking more time and executing till 12 AM and from 12 AM my job 2 also starting ,so getting deadlocks conflicts because inserting happening from job1 and updating happening from Job 2.
    How to avoid deadlocks and fix the issue.
    Please Suggest .
    Thanks & Regards,
    Anand

    Hi Anand,
    Here is another solution, you can set the Job 2 not to run based on a schedule, and create another SQL Server Agent Job which starts at 12 AM and run with a specified time interval to execute a SQL statement in which you do the following steps:
    1. Get the status information of Job 1 using the statement:
    DECLARE @i int;
    EXEC @i = msdb.dbo.sp_help_job @job_name = ‘Job Name'
    2. If the value of @i is 1 which means the status of job 1 is success and current time is, then start the job 2. So, the statement is as follows:
    IF @I = 1
    EXEC msdb.dbo.sp_start_job @job_name= ‘Job Name’
    Regards,
    Mike Yin
    TechNet Community Support

  • How to avoid Deadlocks ?

    Hello friends,
    When I'm loading
    the data, primarily we are disabling constraints on all tables in a database, after data
    loaded into the target tables we are
    enabling all constraints on all tables in a database. But the user running a query against tables during the constraints enabling Then there is deadlock
    . why there is deadlock? How to
    resolve that?
    Regards
    Anji

    >Use batch loading , that during the gap , user would access the table.
    That is the best solution.
    Deadlock prevention:
    http://www.sqlusa.com/bestpractices/deadlock/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • How to avoid deadlock

    I have two portions of codes, code 1.1 simply call the wait() for x, and wait for x to complete some tasks. Code 1.2 calls notify() after all tasks have been completed. The problem is that code 1.1 may miss the notify() from code 1.2. For example, in a network environment, x.wait() may be executed after x.notify(), or the notify() is simply lost. How can I handle this problem? I am thinking about starting a thread(add it as an attribute to x) after the nofify call in code 1.2 to tell the waiters not to wait stop waitting, but the wait() is a final method, I can't overwrite it. It seems that I can't do it that way. Any suggestion? Thank you in advance.
    //code 1.1
    //x needs to perform some tasks
    //let's wait for it to complete
    synchronized (x){
       x.wait();
    //code 1.2
    //x completes its tasks
    //let's notify the guy who is waiting
    synchronized (x){
      x.notify();
    }

    First, that's not really deadlock.
    How you solve it depends on your requirements.
    If it's just that you need 1.1 not to be stuck forever, but it's okay for 1.1 to execute to completion before 1.2 gets to the notify, then you have 1.2 set a flag before calling notify. 1.1 checks that flag before calling wait. If it hasn't been set--meaning 1.2 hasn't gotten around to calling notify--then 1.1 can wait. If the flag has been set--1.2 has already called notify--then 1.1 doesn't wait, and just moves on.

  • Deadlock ORA-00060 with Transformations

    Hi everyone,
    we are on SP 10 together wih Oracle 10.2.0.2.0. In our development system I made already some big test loads (~Mio entries) from Data Store to cube. As sometimes in 3.0B we get a self-deadlock because processes killed each other, but now it happens more often. The bad thing with such an error from a Data Store to cube, that there is no possibility to make a manual update so a restart is necessary.
    Has anyone suffered the same? Any proposals others than too less data or use PSA and Update-rules?
    My current solution is to set the data-package size so high that the load is done in one package, what is really not a good solution. Is there a possibility to reduce the paralellility to one at a cube load other than my method?
    Best regards
    Harald.

    Hi Harald,
    Kindly look into the following notes :
    980555       ORA 600 [kdtdelrow-2] during insert with deadlock
    1015152      ORA 600 [kdtdelrow-2] during insert in Oracle 10.2.0.2
    1003217       ORA-600 [kdiblLockRange:not validated] during an insert
    hope this helps,
    Regards
      KK

  • How to avoid deadlock when multithreading updates one table same time?

    Multithreading calls the stored procedure at the same time to update data in one table. For a instance,
    Table1
    Col1 Col2 Col3
    C1 1 1
    C1 2 2
    C1 3 3
    C2 1 1
    Table2
    Col1 Col2 Col3
    C1 1 10
    C1 2 4
    C1 3 3
    C2 1 1
    There are several steps I want:
    1. Get the data in Table1 where Col1 = C1 in a cursor which has Col1 column and Col2 column.
    2. Cycle them one by one, and get the Col3 data from Table2 where Col1 = C1 and Table2.Col2 = Table1.Col2. (Due to deadlock is my concern, we use temp table, definityly it is not a good way. :( )
    3. Update Table1 Set Col3 = Table2.Col3.
    My new idea is when I get the collection from Table1 which Col1 = C1, I use this way below.
    First I set transaction in below way.
    SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
    Then
    select * from Table1 where Col1 = C1 for update nowait;
    In my opinion, if one thread lock the data for update, other thread won't select out that locked data. Does it work?
    Thank you.
    Best regards,
    Andreas

    Why is the data submitted as a collection in the first place?
    A collection is great as a program data structure - dealing with program variables. It is a very poor choice to use it to deal with Oracle data in a CRUD fashion.
    The purpose, ito dealing with Oracle data, of a PL/SQL collection is for one thing and one thing only - context switching.
    To reduce the number of times you need to step out of PL/SQL and into the SQL engine in order to pass data from one to the other. A collection allows you a bigger buffer area and thus less context switches.
    And that's it.
    A client (Java, C#, etc) that submits data to Oracle to be CRUD via a collection is a design flaw. A collection resides in "expensive" dedicated, non-sharable and non-scalable server memory.
    In order to CRUD a collection, you either need to write bare bones feature methods yourself, or cast that collection into a SQL structure and use more powerful and flexible and feature rich SQL against it.
    Which then begs the question - why did the client not submit that data directly to the SQL engine, either into a permanent table or a temporary table?
    Performance and scalability are issues that need to be addressed at core design level. It is not something that can be tacked on and "fixed" after the fact. So you need to make very sure that your reasons for not wanting to use a temp table (for example), are valid and sound technical reasons.

  • DEADLOCK DETECTED ( ORA-00060 )

    Hi,
    We are getting deadlocks when the System (Exteranl-Portal-
    Production) Cache Upload process runs. It's Looks like
    application problem.
    We have been getting this deadlock problem whenever the CACHE job gets
    executed.
    Basically its a portal SRM Business package system.
    We have scheduled the CACHE job on portal at 1 AM MSTAZ time , so it
    will use Jco to connect R3 and SRM system to bring the data.
    We have been observing this deadlock problem only at the time of cache
    job.
    But cache job is executing succesfully , but we could see the deadlock
    in the logs.
    In the beginning of trace file (Location:-
    /oracle/RPE/saptrace/usertrace/) we found the information as follows
    more rpe_ora_1835342.trc
    Dump file /oracle/RPE/saptrace/usertrace/rpe_ora_1835342.trc
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    ORACLE_HOME = /oracle/RPE/102_64
    System name:    AIX
    Node name:      fsp55a08
    Release:        3
    Version:        5
    Machine:        000788ABD600
    Instance name: RPE
    Redo thread mounted by this instance: 1
    Oracle process number: 17
    Unix process pid: 1835342, image: oracle@fsp55a08
    2009-05-31 01:00:49.485
    ACTION NAME:() 2009-05-31 01:00:49.485
    MODULE NAME:(JDBC Thin Client) 2009-05-31 01:00:49.485
    SERVICE NAME:(SYS$USERS) 2009-05-31 01:00:49.485
    SESSION ID:(275.1229) 2009-05-31 01:00:49.485
    DEADLOCK DETECTED ( ORA-00060 )
    [Transaction Deadlock]
    The following deadlock is not an ORACLE error. It is a
    deadlock due to user error in the design of an application
    or from issuing incorrect ad-hoc SQL. The following
    information may aid in determining the deadlock:
    Deadlock graph:
    Blocker(s)--  -Waiter(s)--
    Resource Name          process session holds waits  process session holds waits
    TX-00050010-00003981        17     275     X             18     284           X
    TX-00010000-000038a3        18     284     X             17     275           X
    session 275: DID 0001-0011-00000139     session 284: DID 0001-0012-0000004F
    session 284: DID 0001-0012-0000004F     session 275: DID 0001-0011-00000139
    Rows waited on:
    Session 284: obj - rowid = 0000561D - AAAFYdAAJAAAHUlAAU
      (dictionary objn - 22045, file - 9, block - 29989, slot - 20)
    Session 275: obj - rowid = 00005617 - AAAFYXAAJAAAG1aAAc
      (dictionary objn - 22039, file - 9, block - 27994, slot - 28)
    Information on the OTHER waiting sessions:
    Session 284:
      pid=18 serial=1236 audsid=672749 user: 21/SAPRPEDB
      O/S info: user: rpeadm, term: unknown, ospid: 1234, machine: fsp65003
                program: JDBC Thin Client
    Please help me on this issue.
    Please let me know if you need any more information on the same.
    Thank you in advance.
    Regards,
    A.Naresh
    SAP-BASIS

    Hi,
    Check SAP Note 84348 - Oracle deadlocks, ORA-00060
    Thanks
    Sunny

  • How to resolve ORA-00060: deadlock detected in Workflow

    Hi there,
    I have defined a custom workflow which initiated from Trigger
    AFTER UPDATE of status_code ON pa.pa_proj_elements
    The WF activities includes:
    -Set item attributes
    -Find users and add users to adhoc role
    -Send Action & FYI notification
    -Update status_code using standard API PA_PROGRESS_PUB.UPDATE_PROGRESS, this API will add a new role in pa_percent_completes table.
    But the API failed to update the status_code with the following error:
    ORA-00060: deadlock detected while waiting for resource in Package PA_PROGRESS_PUB Procedure UPDATE_PROGRESS...
    Please help.

    sorry, typo mistake on the standard API will in fact create a row in pa_percent_completes table.

  • ORA-00060: Deadlock detected

    I getting error as "ORA-00060: Deadlock detected. More info in file /d01/oracle/VIS/db/tech_st/10.2.0/.................". Following are my observations on the occurence of this error.
    The deadlock is encountered first time when trying to login to applications. I have R12 vision instance on linux.
    Following the content of the alert_VIS.log file
    Mon Jun 15 04:41:41 2009
    Starting ORACLE instance (normal)
    LICENSE_MAX_SESSION = 0
    LICENSE_SESSIONS_WARNING = 0
    Picked latch-free SCN scheme 3
    Using LOG_ARCHIVE_DEST_1 parameter default value as /d01/oracle/VIS/db/tech_st/10.2.0/dbs/arch
    Autotune of undo retention is turned on.
    IMODE=BR
    ILAT =44
    LICENSE_MAX_USERS = 0
    SYS auditing is disabled
    ksdpec: called for event 13740 prior to event group initialization
    Starting up ORACLE RDBMS Version: 10.2.0.3.0.
    System parameters with non-default values:
    tracefiles_public = TRUE
    processes = 200
    sessions = 400
    timed_statistics = TRUE
    shared_pool_size = 419430400
    shared_pool_reserved_size= 41943040
    nls_language = american
    nls_territory = america
    nls_sort = binary
    nls_date_format = DD-MON-RR
    nls_numeric_characters = .,
    nls_comp = binary
    nls_length_semantics = BYTE
    sga_target = 1073741824
    control_files = /d01/oracle/VIS/db/apps_st/data/cntrl01.dbf, /d01/oracle/VIS/db/apps_st/data/cntrl02.dbf, /d01/oracle/VIS/db/apps_st/data/cntrl03.dbf
    db_block_checksum = TRUE
    db_block_size = 8192
    compatible = 10.2.0
    log_buffer = 14251008
    log_checkpoint_interval = 100000
    log_checkpoint_timeout = 1200
    db_files = 512
    log_checkpoints_to_alert = TRUE
    dml_locks = 10000
    undo_management = AUTO
    undo_tablespace = APPS_UNDOTS1
    db_block_checking = FALSE
    O7_DICTIONARY_ACCESSIBILITY= FALSE
    session_cached_cursors = 500
    utl_file_dir = /usr/tmp, /usr/tmp, /d01/oracle/VIS/db/tech_st/10.2.0/appsutil/outbound/VIS_oracleebsr12, /usr/tmp
    plsql_native_library_dir = /d01/oracle/VIS/db/tech_st/10.2.0/plsql/nativelib
    plsql_native_library_subdir_count= 149
    plsql_code_type = native
    plsql_optimize_level = 2
    job_queue_processes = 2
    systemtrig_enabled = TRUE
    cursor_sharing = EXACT
    parallel_min_servers = 0
    parallel_max_servers = 8
    background_dump_dest = /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/bdump
    user_dump_dest = /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/udump
    max_dump_file_size = 20480
    core_dump_dest = /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/cdump
    db_name = VIS
    open_cursors = 600
    ifile = /d01/oracle/VIS/db/tech_st/10.2.0/dbs/VIS_oracleebsr12_ifile.ora
    sortelimination_cost_ratio= 5
    btree_bitmap_plans = FALSE
    fastfull_scan_enabled = FALSE
    sqlexecprogression_cost= 2147483647
    likewith_bind_as_equality= TRUE
    pga_aggregate_target = 1073741824
    workarea_size_policy = AUTO
    optimizer_secure_view_merging= FALSE
    aq_tm_processes = 1
    olap_page_pool_size = 4194304
    Mon Jun 15 04:42:05 2009
    WARNING:Oracle instance running on a system with low open file descriptor
    limit. Tune your system to increase this limit to avoid
    severe performance degradation.
    PSP0 started with pid=3, OS id=6824
    PMON started with pid=2, OS id=6822
    MMAN started with pid=4, OS id=6826
    DBW0 started with pid=5, OS id=6828
    CKPT started with pid=7, OS id=6832
    SMON started with pid=8, OS id=6834
    RECO started with pid=9, OS id=6836
    CJQ0 started with pid=10, OS id=6838
    LGWR started with pid=6, OS id=6830
    MMON started with pid=11, OS id=6840
    MMNL started with pid=12, OS id=6842
    Mon Jun 15 04:42:19 2009
    ALTER DATABASE MOUNT
    Mon Jun 15 04:42:25 2009
    Setting recovery target incarnation to 2
    Mon Jun 15 04:42:27 2009
    Successful mount of redo thread 1, with mount id 243370348
    Mon Jun 15 04:42:27 2009
    Database mounted in Exclusive Mode
    Completed: ALTER DATABASE MOUNT
    Mon Jun 15 04:42:28 2009
    ALTER DATABASE OPEN
    Mon Jun 15 04:42:48 2009
    Thread 1 opened at log sequence 16
    Current log# 3 seq# 16 mem# 0: /d01/oracle/VIS/db/apps_st/data/log3.dbf
    Successful open of redo thread 1
    Mon Jun 15 04:42:48 2009
    MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
    Mon Jun 15 04:42:48 2009
    SMON: enabling cache recovery
    Mon Jun 15 04:42:48 2009
    Incremental checkpoint up to RBA [0x10.a779.0], current log tail at RBA [0x10.a779.0]
    Mon Jun 15 04:43:01 2009
    Successfully onlined Undo Tablespace 18.
    Mon Jun 15 04:43:01 2009
    SMON: enabling tx recovery
    Mon Jun 15 04:43:04 2009
    Database Characterset is UTF8
    Mon Jun 15 04:43:18 2009
    replication_dependency_tracking turned off (no async multimaster replication found)
    Mon Jun 15 04:43:44 2009
    Starting background process QMNC
    QMNC started with pid=14, OS id=6884
    Mon Jun 15 04:46:48 2009
    Completed: ALTER DATABASE OPEN
    Mon Jun 15 05:03:23 2009
    Incremental checkpoint up to RBA [0x10.b1bd.0], current log tail at RBA [0x10.b1f3.0]
    Mon Jun 15 05:23:33 2009
    Incremental checkpoint up to RBA [0x10.b5b3.0], current log tail at RBA [0x10.b5c2.0]
    Mon Jun 15 05:45:12 2009
    Incremental checkpoint up to RBA [0x10.b7b0.0], current log tail at RBA [0x10.fbce.0]
    This is upto the point where all DB and application services has been started.
    Once trying to login to applications following content got appended to the log file
    Mon Jun 15 05:53:39 2009
    ORA-00060: Deadlock detected. More info in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/udump/vis_ora_8149.trc.
    Mon Jun 15 05:53:51 2009
    ORA-00060: Deadlock detected. More info in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/udump/vis_ora_8149.trc.
    Mon Jun 15 05:54:02 2009
    ORA-00060: Deadlock detected. More info in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/udump/vis_ora_8149.trc.
    Mon Jun 15 05:54:12 2009
    ORA-00060: Deadlock detected. More info in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/udump/vis_ora_8149.trc.
    Mon Jun 15 05:54:22 2009
    ORA-00060: Deadlock detected. More info in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/udump/vis_ora_8149.trc.
    Mon Jun 15 05:54:28 2009
    ORA-00060: Deadlock detected. More info in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/udump/vis_ora_8149.trc.
    Mon Jun 15 05:54:35 2009
    ORA-00060: Deadlock detected. More info in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/udump/vis_ora_8149.trc.
    Mon Jun 15 05:54:42 2009
    ORA-00060: Deadlock detected. More info in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/udump/vis_ora_8149.trc.
    Mon Jun 15 05:59:06 2009
    Process J000 died, see its trace file
    Mon Jun 15 05:59:11 2009
    kkjcre1p: unable to spawn jobq slave process
    Mon Jun 15 05:59:11 2009
    Errors in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/bdump/vis_cjq0_6838.trc:
    Mon Jun 15 05:59:23 2009
    Process J000 died, see its trace file
    Mon Jun 15 05:59:24 2009
    kkjcre1p: unable to spawn jobq slave process
    Mon Jun 15 05:59:24 2009
    Errors in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/bdump/vis_cjq0_6838.trc:
    Mon Jun 15 05:59:50 2009
    Process J000 died, see its trace file
    Mon Jun 15 05:59:50 2009
    kkjcre1p: unable to spawn jobq slave process
    Mon Jun 15 05:59:50 2009
    Errors in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/bdump/vis_cjq0_6838.trc:
    I did the TKPROF on .trc files but the tkprof file does not show any details as such except similar to :- (don't know if I am missing anything while issuing TKPROF as $ tkprof filename.trc
    filename.txt explain=apps/apps)
    TKPROF: Release 10.2.0.3.0 - Production on Mon Jun 15 06:07:14 2009
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Trace file: /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/bdump/vis_cjq0_6838.trc
    Sort options: default
    count = number of times OCI procedure was executed
    cpu = cpu time in seconds executing
    elapsed = elapsed time in seconds executing
    disk = number of physical reads of buffers from disk
    query = number of buffers gotten for consistent read
    current = number of buffers gotten in current mode (usually for update)
    rows = number of rows processed by the fetch or execute call
    0 statements EXPLAINed in this session.
    Trace file: /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/bdump/vis_cjq0_6838.trc
    Trace file compatibility: 10.01.00
    Sort options: default
    1 session in tracefile.
    0 user SQL statements in trace file.
    0 internal SQL statements in trace file.
    0 SQL statements in trace file.
    0 unique SQL statements in trace file.
    22 lines in trace file.
    0 elapsed seconds in trace file.
    Yesterday, I did login to applications after multiple attempts and tried submitting a concurrent request of a standard report (after resolving the data block corrupt issue) and got the same ORA-00060 Error.
    I have a fresh VISION R12 (12.0.4) installed without any customizations. My installation looks to be quite unstable, takes 2-3 attempts for successful login to apps.
    Can you please give any clues on this and how to overcome the problem?
    Thanks,
    Amit

    I have run cmclean.sql as per :- Re: R12 Vision install - Unable to submit concurrent request
    This is the only change made. No new patches etc. Before running cmclean.sql I believe the instance was working fine.
    Now everytime I start the application services, its causing ORA=00060: Deadlock error. There are no issues with just DB services up and running.
    And after apps services up, when trying to Login to apps it just hangs, get error as follows:
    Tue Jun 23 02:04:55 2009
    Process J001 died, see its trace file
    Tue Jun 23 02:04:55 2009
    kkjcre1p: unable to spawn jobq slave process
    Tue Jun 23 02:04:55 2009
    Errors in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/bdump/vis_cjq0_6747.trc:
    Tue Jun 23 02:05:04 2009
    Process q002 died, see its trace file
    Tue Jun 23 02:05:04 2009
    ksvcreate: Process(q002) creation failed
    Tue Jun 23 02:05:55 2009
    Process J000 died, see its trace file
    Tue Jun 23 02:05:55 2009
    kkjcre1p: unable to spawn jobq slave process
    Tue Jun 23 02:05:55 2009
    Errors in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/bdump/vis_cjq0_6747.trc:
    Tue Jun 23 02:06:11 2009
    Process J000 died, see its trace file
    Tue Jun 23 02:06:11 2009
    kkjcre1p: unable to spawn jobq slave process
    Tue Jun 23 02:06:11 2009
    Errors in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/bdump/vis_cjq0_6747.trc:
    Tue Jun 23 02:08:51 2009
    Process J000 died, see its trace file
    Tue Jun 23 02:08:52 2009
    kkjcre1p: unable to spawn jobq slave process
    Tue Jun 23 02:08:52 2009
    Errors in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/bdump/vis_cjq0_6747.trc:
    The OS also hangs (Linux) and I have to exit abnormally everytime which is frustrating.
    I am not sure the reason for the same. I have gone through the metalink notes pointed which says to install the health check engine.
    Do you have any clues based on above information as to what might be causing this problem.
    I have 4 GB RAM installed on my Windows and 2 GB has been allocated to Linux on VMware.
    Please let me know if I need to upgrade the memory.
    Any pointers would be really helpful.
    Thanks,
    Amit

  • Database error"ORA-00060: deadlock detected while waiting for resource"

    Hi All,
    I got dump as
    Database error text........: "ORA-00060: deadlock detected while waiting for
      resource"
    Internal call code.........: "[RSQL/RDUP/NRIV ]"
    Please check the entries in the system log (Transaction SM21).
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught
    in
    procedure "READ_NRIV" "(FORM)", nor was it propagated by a RAISING clause.
    Can u ppl tell me how to get correct this?
    Edited by: Bala Chandar on Jul 20, 2009 11:01 AM

    Hi Bala,
    Same type of dump we got when we trigger the DTP which in process chain to load data from DSO to Info cube. And the load had processed with 225 data package and at 164th data package we got this error and except 164th data package all data package processed successfully
    And the request was red. So we had done processed manually by clicking the icon. So all its been green and successfully loaded.
    So when you do process manual the particular data package which got failed will be process successfully  

  • ORA-00060 "deadlock detected while waiting for resource"

    Hello.
    I am having an oracle deadlock when calling a stored procedure (wich updates several records in several tables) from several threads: ORA-00060 error. The error does not happen very often but from time to time, normally the calls to this proceudre end ok.
    Each call starts and ends a transaction. (When the oracle error raises the transaction where it raises is rolled back) and the other transactions can go on.
    I don't how to avoid it. Should it be solved at the stored procedure level or could it be solved at java level by doing the call to the stored procedure to be synchronized?
    Thanks in advance.

    Fernando_Sanchez wrote:
    Hello.
    I am having an oracle deadlock when calling a stored procedure (wich updates several records in several tables) from several threads: ORA-00060 error. The error does not happen very often but from time to time, normally the calls to this proceudre end ok.Which doesn't really sound good.
    If you have a java thread then to do JDBC, regardless of what type, you get a new connection and new statements in each one.
    If you are not doing that then that is a problem.
    If you are doing that then the thread information is irrelevant at the java level.
    You can of course do all sorts of interesting things with locks and transactions in Oracle and via stored procs but other ways as well. And if you are not careful it will cause problems.

  • ORA-00060: deadlock detected while waiting for resource CLOSE cursor

    Hi,
    I am a new member of this forum. I am working with a problem we got a few weeks ago. It is from a Pro C batch executable running on 10 threads dealing with >800 data accessed from multiple tables. The error as reported came from a package.function call.
    This is the error I encountered:
    process_item~G****, D***~-60~ORA-00060: deadlock detected while waiting for resource~PACKAGE ERROR = CLOSE cursor C_***** in package R***.I*** 7641
    The cursor is a simple SELECT cursor without Table or Record locking.
    My questions are:
    *Upon the occurrence of this error, is the execution already at the CLOSE cursor line or did the error occurred between the OPEN cursor and the CLOSE cursor? There are several lines of code in between OPEN and CLOSE:
    - one that calls for a package.function that simply stores parameter values to a variable
    - another one which fetches the cursor. The group that holds the cursor values is only used by a single function in the package
    *Is it possible for this CLOSE cursor to cause a deadlock? What could have caused this?
    *From what I know, Oracle deals with deadlocks by aborting the deadlocking process while others continue, but this deadlock caused our program to hang. How is this possible? Could the root cause of the deadlock be from our threading program? This is a rare occurrence and happened only twice this year.
    Thanks,
    Raf

    Raf Serrano wrote:
    Hi,
    I am a new member of this forum. I am working with a problem we got a few weeks ago. It is from a Pro C batch executable running on 10 threads dealing with >800 data accessed from multiple tables. The error as reported came from a package.function call.
    This is the error I encountered:
    process_item~G****, D***~-60~ORA-00060: deadlock detected while waiting for resource~PACKAGE ERROR = CLOSE cursor C_***** in package R***.I*** 7641
    The cursor is a simple SELECT cursor without Table or Record locking.
    My questions are:
    *Upon the occurrence of this error, is the execution already at the CLOSE cursor line or did the error occurred between the OPEN cursor and the CLOSE cursor? There are several lines of code in between OPEN and CLOSE:
    - one that calls for a package.function that simply stores parameter values to a variable
    - another one which fetches the cursor. The group that holds the cursor values is only used by a single function in the package
    *Is it possible for this CLOSE cursor to cause a deadlock? What could have caused this?
    *From what I know, Oracle deals with deadlocks by aborting the deadlocking process while others continue, but this deadlock caused our program to hang. How is this possible? Could the root cause of the deadlock be from our threading program? This is a rare occurrence and happened only twice this year.
    Thanks,
    RafSELECT (without FOR UPDATE) statements are never involved in ORA-00060.
    only DML statements throw ORA-00060 error

  • Fix for ORA-00060: Deadlock detected errors

    Hello APEX community,
    in the last days we are hitting more and more frequent the ORA-00060: Deadlock detected error in one of our applications. Logged an SR with Oracle Support but so far not too much help, except pointing to some older bugs:
    Bug 6618662: APEX APPEARS TO BE CAUSING DEADLOCK - CASE COLLECTION or Bug 7587013: INSERTING AND DELETING WWV_FLOW_DATA CAUSES DEADLOCK, which do not look at all appealing as the first bug was logged in Nov 2007 and the resolution was delayed from version 3.1, to 4.0 and even to 4.1, while de second was logged in Nov 2008 and not much happened with it.
    I am curious how many other users are hitting the same issue and which workarounds found for the problem. For example yesterday I could see 12 such errors in my log, today already 3.
    Florin

    Hi John,
    here it is: http://www.moyersoen.be/auction/1442/ or http://www.moyersoen.be/pls/apex/f?p=2008:11:0::::P11_AUCTION_ID:1442. Normally the page response time is < 0.20, but from time to time it goes up to more than 20 seconds and at those times I can see also the ORA-00060: Deadlock detected errors.
    Looks like the users are clicking twice refresh for that page. I am trying now to build a testcase that reproduce the issue easily.
    Florin

  • ORA-00060 -  Deadlock detected Error

    Hello Gurus,
    In Our BW Production Server we are facing follwoing error sice few days
    BR0976W Database message alert - level: WARNING, line: 1572623, time: 2008-01-23 01.49.02, message:
    ORA-00060: Deadlock detected. More info in file /oracle/PBW/saptrace/usertrace/pbw_ora_590014.trc.
    BR0976W Database message alert - level: WARNING, line: 1572637, time: 2008-01-23 01.56.47, message:
    ORA-00060: Deadlock detected. More info in file /oracle/PBW/saptrace/usertrace/pbw_ora_598066.trc.
    Can anybody tell me the how to get rid of this error
    Vital Information - Server
    O/S - AIX
    SAP Version - 700
    Oracle - 10.2.0.2.0
    ABAP Support Pack - SAPKA70010
    Basis Support Pack  - SAPKB70010
    Patch - 95
    Thanks & Regards
    Shishir

    The trace file will be written to the directory indicated by the USER_DUMP_DEST init.ora parameter.
      The trace file will contain a deadlock graph and additional information  similar to that shown below. This is the trace output from the above example which signaled an ORA-60 to Ses#2:
    The following deadlock is not an ORACLE error. It is a deadlock due to user error in the design of an application or from issuing incorrect ad-hoc SQL. The following information may aid in determining the deadlock:
       Deadlock graph:
    Blocker(s)--  -Waiter(s)--
       Resource Name       process session holds waits  process session holds waits
       TX-00020012-0000025e     12      11     X             11      10           X
       TX-00050013-0000003b     11      10     X             12      11           X
       session 11: DID 0001-000C-00000001      session 10: DID 0001-000B-00000001
       session 10: DID 0001-000B-00000001      session 11: DID 0001-000C-00000001
       Rows waited on:
       Session 10: obj - rowid = 00000BF6 - AAAAv2AAEAAAAqKAAB
       Session 11: obj - rowid = 00000BF6 - AAAAv2AAEAAAAqKAAA

  • ORA-00060 DEADLOCK DETECTED - Need Help

    Hi Gurus,
    I have a question on how to determine the trace log. Where the deadlock happen.
    Please help. I have no other hint on how to resolve the error.
    *** ACTION NAME:() 2008-08-06 03:34:21.740
    *** MODULE NAME:(OEM.SystemPool) 2008-08-06 03:34:21.740
    *** SERVICE NAME:(celcomdb) 2008-08-06 03:34:21.740
    *** CLIENT ID:() 2008-08-06 03:34:21.740
    *** SESSION ID:(113.3188) 2008-08-06 03:34:21.740
    DEADLOCK DETECTED ( ORA-00060 )
    [Transaction Deadlock]
    The following deadlock is not an ORACLE error. It is a
    deadlock due to user error in the design of an application
    or from issuing incorrect ad-hoc SQL. The following
    information may aid in determining the deadlock:
    Deadlock graph:
    ---------Blocker(s)-------- ---------Waiter(s)---------
    Resource Name process session holds waits process session holds waits
    TM-0000c45a-00000000 119 113 X 27 60 SX
    TX-0004002c-000269bc 27 60 X 119 113 X
    session 113: DID 0001-0077-00000028     session 60: DID 0001-001B-00000278
    session 60: DID 0001-001B-00000278     session 113: DID 0001-0077-00000028
    Rows waited on:
    Session 60: no row
    Session 113: obj - rowid = 0000C384 - AAAMOEAADAAAF99AAA
    (dictionary objn - 50052, file - 3, block - 24445, slot - 0)
    Information on the OTHER waiting sessions:
    Session 60:
    pid=27 serial=1313 audsid=0 user: 51/SYSMAN
    O/S info: user: oracle10, term: UNKNOWN, ospid: 14610456, machine: S63KLJ01
    program: oracle@S63KLJ01 (J000)
    application name: EM_PING, hash value=2147830874
    action name: AGENT_STATUS_MARKER, hash value=2850782869
    Current SQL information unavailable
    End of information on OTHER waiting sessions.
    Current SQL statement for this session:
    UPDATE MGMT_OMS_PARAMETERS SET VALUE=TO_CHAR(SYSDATE, 'DD-Mon-YYYY HH24:MI:SS') WHERE HOST_URL=:B1 AND NAME='TIMESTAMP'
    ----- PL/SQL Call Stack -----
    object line object
    handle number name
    70000006e5ab778 39 package body SYSMAN.MGMT_FAILOVER
    70000002e8aaf98 1 anonymous block
    ===================================================
    PROCESS STATE
    Process global information:
    process: 70000006f4b1598, call: 70000006a9c9320, xact: 70000006dedcf98, curses: 70000006f5a5a50, usrses: 70000006f5a5a50
    SO: 70000006f4b1598, type: 2, owner: 0, flag: INIT/-/-/0x00
    (process) Oracle pid=119, calls cur/top: 70000006a9c9320/70000006abfcaf8, flag: (0) -
    int error: 0, call error: 0, sess error: 0, txn error 0
    (post info) last post received: 0 0 9
    last post received-location: ksqrcl
    last process to post me: 70000006f484118 141 0
    last post sent: 0 0 0
    last post sent-location: No post
    last process posted by me: none
    (latch info) wait_event=0 bits=0
    Process Group: DEFAULT, pseudo proc: 70000006f50bcd0
    O/S info: user: oracle10, term: UNKNOWN, ospid: 11538508
    OSD pid info: Unix process pid: 11538508, image: oraclecelcomdb@S63KLJ01
    Dump of memory from 0x070000006F45FCD0 to 0x070000006F45FED8
    70000006F45FCD0 00000004 00000000 07000000 6A9ABD00 [............j...]
    70000006F45FCE0 00000010 0003139D 07000000 6ABFCAF8 [............j...]
    70000006F45FCF0 00000003 0003139D 07000000 6F8FD600 [............o...]
    70000006F45FD00 0000000B 0003139D 07000000 6F5A5A50 [............oZZP]
    70000006F45FD10 00000004 00031291 00000000 00000000 [................]
    70000006F45FD20 00000000 00000000 00000000 00000000 [................]
    Repeat 26 times
    70000006F45FED0 00000000 00000000 [........]
    SO: 70000006f5a5a50, type: 4, owner: 70000006f4b1598, flag: INIT/-/-/0x00
    (session) sid: 113 trans: 70000006dedcf98, creator: 70000006f4b1598, flag: (41) USR/- BSY/-/-/-/-/-
    DID: 0001-0077-00000028, short-term DID: 0000-0000-00000000
    txn branch: 0
    oct: 6, prv: 0, sql: 70000006e5a9140, psql: 70000006e5a9410, user: 51/SYSMAN
    O/S info: user: oracle10, term: unknown, ospid: 1234, machine: S63KLJ01
    program: OMS
    client info: S63KLJ01_Management_Service
    application name: OEM.SystemPool, hash value=2960518376
    last wait for 'enq: TX - row lock contention' blocking sess=0x70000006f5611e0 seq=322 wait_time=2929700 seconds since wait started=4
    name|mode=54580006, usn<<16 | slot=4002c, sequence=269bc
    Dumping Session Wait History
    for 'enq: TX - row lock contention' count=1 wait_time=2929700
    name|mode=54580006, usn<<16 | slot=4002c, sequence=269bc
    for 'enq: TM - contention' count=1 wait_time=224489
    name|mode=544d0006, object #=c45a, table/partition=0
    for 'enq: TM - contention' count=1 wait_time=2929708
    name|mode=544d0006, object #=c45a, table/partition=0
    for 'SQL*Net message from client' count=1 wait_time=35033
    driver id=28444553, #bytes=1, =0
    for 'SQL*Net message to client' count=1 wait_time=1
    driver id=28444553, #bytes=1, =0
    for 'SQL*Net message from client' count=1 wait_time=227
    driver id=28444553, #bytes=1, =0
    for 'SQL*Net message to client' count=1 wait_time=1
    driver id=28444553, #bytes=1, =0
    for 'latch: library cache' count=1 wait_time=96826
    address=70000006cf2f298, number=d6, tries=0
    for 'latch: library cache' count=1 wait_time=36929
    address=70000006cf2f0b8, number=d6, tries=0
    for 'SQL*Net message from client' count=1 wait_time=131974
    driver id=28444553, #bytes=1, =0
    temporary object counter: 0
    Virtual Thread:
    kgskvt: 70000006e82cd98, sess: 70000006f5a5a50, vc: 0, proc: 70000006f4b1598
    consumer group cur: OTHER_GROUPS (upd? 0), mapped: DEFAULT_CONSUMER_GROUP, orig:
    vt_state: 0x200, vt_flags: 0x30, blkrun: 0
    is_assigned: 1, in_sched: 0 (0)
    vt_active: 0 (pending: 1)
    used quanta: 0 (cg: 0)
    cpu start time: 0, quantum status: 0x0
    quantum checks to skip: 0, check thresh: 0
    idle time: 0, active time: 0 (cg: 0)
    cpu yields: 0 (cg: 0), waits: 0 (cg: 0), wait time: 0 (cg: 0)
    queued time outs: 0, time: 0 (cur 0, cg 0)
    calls aborted: 0, num est exec limit hit: 0
    undo current: 0k max: 0k
    UOL used : 0 locks(used=2, free=0)
    KGX Atomic Operation Log 70000002eb54978
    Mutex 0(0, 0) idn 0 oper NONE
    Cursor Parent uid 113 efd 15 whr 22 slp 0
    oper=NONE pt1=0 pt2=0 pt3=0
    pt4=0 u41=0 stt=0
    KGX Atomic Operation Log 70000002eb549c0
    Mutex 0(0, 0) idn 0 oper NONE
    Library Cache uid 113 efd 0 whr 0 slp 0
    KGX Atomic Operation Log 70000002eb54a08
    Mutex 0(0, 0) idn 0 oper NONE
    Library Cache uid 113 efd 0 whr 0 slp 0
    SO: 70000006ae53108, type: 53, owner: 70000006f5a5a50, flag: INIT/-/-/0x00
    LIBRARY OBJECT LOCK: lock=70000006ae53108 handle=70000002e8e8150 mode=N
    call pin=0 session pin=0 hpc=0000 hlc=0000
    htl=70000006ae53188[70000006a753478,70000006abaf090] htb=70000006abaf090 ssga=70000006abae018
    user=70000006f5a5a50 session=70000006f5a5a50 count=1 flags=CBK[0020] savepoint=0x0
    LIBRARY OBJECT HANDLE: handle=70000002e8e8150 mtx=70000002e8e8280(0) cdp=0
    namespace=CRSR flags=RON/KGHP/PN0/EXP/[10010100]
    kkkk-dddd-llll=0000-0001-0001 lock=N pin=S latch#=4 hpc=0000 hlc=0000
    lwt=70000002e8e81f8[70000002e8e81f8,70000002e8e81f8] ltm=70000002e8e8208[70000002e8e8208,70000002e8e8208]
    pwt=70000002e8e81c0[70000002e8e81c0,70000002e8e81c0] ptm=70000002e8e81d0[70000002e8e81d0,70000002e8e81d0]
    ref=70000002e8e8228[70000004ad30028,70000004ad30028] lnd=70000002e8e8240[70000002e8e8240,70000002e8e8240]
    LIBRARY OBJECT: object=70000004ad2f990
    type=CRSR flags=EXS[0001] pflags=[0000] status=VALD load=0
    DEPENDENCIES: count=1 size=16
    AUTHORIZATIONS: count=1 size=16 minimum entrysize=16
    ACCESSES: count=1 size=16
    TRANSLATIONS: count=1 size=16
    DATA BLOCKS:
    data# heap pointer status pins change whr
    0 70000006eada130 70000004ad2faa8 I/P/A/-/- 0 NONE 00
    6 70000004ad2fec8 700000040f57a78 I/P/A/-/E 0 NONE 00
    ----------------------------------------

    Oracle handles dead lock by its own. but to resolve the issue u can try following things.
    1. take explain for UPDATE MGMT_OMS_PARAMETERS SET VALUE=TO_CHAR(SYSDATE, 'DD-Mon-YYYY HH24:MI:SS') WHERE HOST_URL=:B1 AND NAME='TIMESTAMP';
    2. analyze above explain plan and try to tune it.
    i think, its because of missing indexes.

Maybe you are looking for

  • How to create an application-specific policy file?

    Hi Everybody: I'm a .NET developer with C #. I have a few applications currently running on my computer using the ODP 10.1 Two weeks ago I installed on my computer the ODP 10.2 Release & now my previous applications have stopped working: when I try t

  • How to NOT retain formatting when copying and pasting text

    Captivate 7 keeps the formatting from my text sources when I paste into a Text Caption which is not what I need. Anything I could find in the forums where questions relating to "keeping" the source formatting. I don't want this, I want Captivate to k

  • Different versions of SQL Server 2005 Developer Edition

    Some of our business processes still use SQL Server 2005 and I need to install Developer Edition on my desktop. I have following downloads available in my MSDN subscription (other than Itanium): SQL Server 2005 Developer Edition - DVD (English) - 1 D

  • Lenovo T400 LCD Problem (shut off and bezel light abnormality )

    Hello !!! This is regarding a problem with the Thinkpad T400. The problem is -- When the lid is at ~65 degrees , everything works fine. Whereas , when the lid is raised to viewing angle of arounbd 90 degrees , it goes to sleep AND , I noticed that th

  • PSE 4.0 error message "DB API"

    When I try to save an image after editing, I get the following message: "Organizer DB API failed to execute correctly." And it doesn't let me save the edited photo. I tried the standard edit and quick fix, and both are doing this. I've been using thi