Latch: row cache objects

Hello everyone,
Note: Apologize for the bad formatting, tried but it seems I forgot how to use it
BANNER
Oracle Database 11g Release 11.2.0.2.0 - 64bit Production
I've seen  high "*latch: row cache objects*" in SP/ASH report for ~14 hours back, when the users were unable to connect to the database. There were,
WARNING: inbound connection timed out (ORA-3136)
  Time: 30-APR-2012 02:24:36
  Tracing not turned on.
  Tns error struct:
errors all over the alert log for the duration of 6 minutes of the problem.
I've put few records in bold due to which I concluded that the problem was with "dc_users" thing.
Can anybody tell me how/where I should proceed forward ?
SP report:Instance Efficiency Indicators
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Buffer Nowait %: 100.00 Redo NoWait %: 100.00
Buffer Hit %: 99.84 Optimal W/A Exec %: 100.00
Library Hit %: 97.43 Soft Parse %: 87.86
Execute to Parse %: 22.54 Latch Hit %: 99.95
Parse CPU to Parse Elapsd %: 0.30 % Non-Parse CPU: 87.83
Shared Pool Statistics Begin End
Memory Usage %: 45.09 46.98
% SQL with executions>1: 11.49 13.15
% Memory for SQL w/exec>1: 72.96 21.33
Top 5 Timed Events Avg %Total
~~~~~~~~~~~~~~~~~~ wait Call
Event Waits Time (s) (ms) Time
latch: row cache objects 6,655 634,260 95306 97.0
log file sync 289,923 6,469 22 1.0
CPU time 5,039 .8
db file sequential read 310,084 2,840 9 .4
log file parallel write 451,706 1,144 3 .2
ASH Report
Analysis Begin Time: 30-Apr-12 02:24:00
Analysis End Time: 30-Apr-12 02:30:00
Elapsed Time: 6.0 (mins)
Begin Data Source: DBA_HIST_ACTIVE_SESS_HISTORY
in AWR snapshot 12185
End Data Source: DBA_HIST_ACTIVE_SESS_HISTORY
in AWR snapshot 12185
Sample Count: 1,385
Average Active Sessions: 38.47
Avg. Active Session per CPU: 1.60
Report Target: None specified
Top User Events DB/Inst: NIKU/niku (Apr 30 02:24 to 02:30)
Avg Active
Event Event Class % Event Sessions
latch: row cache objects Concurrency 75.45 29.03
CPU + Wait for CPU CPU 9.75 3.75
log file sync Commit 3.83 1.47
db file sequential read User I/O 3.61 1.39
Top Event P1/P2/P3 Values DB/Inst: NIKU/niku (Apr 30 02:24 to 02:30)
Event % Event P1 Value, P2 Value, P3 Value % Activity
Parameter 1 Parameter 2 Parameter 3
latch: row cache objects         75.60       "42287858200","279","0"      75.60
address number tries
  1* select addr, latch#, child#, name, misses, gets from v$latch_children where name like '%row%cache%objec%'  order by gets , misses
niku> /
ADDR                 LATCH#     CHILD# NAME                                                   MISSES       GETS
0000000A16FF21C8        279         26 row cache objects                                           0          0
0000000A16FF14C8        279          2 row cache objects                                           0          0
00000009D88D7ED8        279          3 row cache objects                                           0          0
0000000A16FF1B48        279         14 row cache objects                                           0          0
00000009D88D8558        279         15 row cache objects                                           0          0
0000000A16FF1CE8        279         17 row cache objects                                           0          0
0000000A26265A28        279         19 row cache objects                                           0          0
0000000A16FF1E88        279         20 row cache objects                                           0          0
00000009D88D8898        279         21 row cache objects                                           0          0
0000000A26265BC8        279         22 row cache objects                                           0          0
0000000A16FF2028        279         23 row cache objects                                           0          0
00000009D88D8A38        279         24 row cache objects                                           0          0
0000000A26265D68        279         25 row cache objects                                           0          0
00000009D88D8BD8        279         27 row cache objects                                           0          0
0000000A26265F08        279         28 row cache objects                                           0          0
00000009D88D8D78        279         30 row cache objects                                           0          0
0000000A262660A8        279         31 row cache objects                                           0          0
0000000A16FF2508        279         32 row cache objects                                           0          0
0000000A16FF26A8        279         35 row cache objects                                           0          0
00000009D88D90B8        279         36 row cache objects                                           0          0
0000000A262663E8        279         37 row cache objects                                           0          0
0000000A262668C8        279         46 row cache objects                                           0          0
0000000A26266A68        279         49 row cache objects                                           0          0
0000000A16FF2368        279         29 row cache objects                                           0         11
0000000A16FF2848        279         38 row cache objects                                           0        116
0000000A16FF29E8        279         41 row cache objects                                           0        200
00000009D88D93F8        279         42 row cache objects                                           0        318
00000009D88D9258        279         39 row cache objects                                           0       1010
0000000A16FF2EC8        279         50 row cache objects                                           0       1406
00000009D88D9598        279         45 row cache objects                                           0       1472
0000000A26266588        279         40 row cache objects                                           0       1705
0000000A26266728        279         43 row cache objects                                           0       7383
0000000A16FF2B88        279         44 row cache objects                                           0      32346
00000009D88D98D8        279         51 row cache objects                                          19      63948
0000000A26265888        279         16 row cache objects                                           0      88045
0000000A26266248        279         34 row cache objects                                           0     141176
00000009D88D9738        279         48 row cache objects                                           0     326672
0000000A16FF19A8        279         11 row cache objects                                         867    1770385
00000009D88D8078        279          6 row cache objects                                           9    1979542
0000000A16FF2D28        279         47 row cache objects                                           2    3435018
00000009D88D86F8        279         18 row cache objects                                        2557   14956121
0000000A26265068        279          1 row cache objects                                         224   24335868
0000000A262653A8        279          7 row cache objects                                       29760  133991553
00000009D88D8F18        279         33 row cache objects                                       60612  677263122
00000009D88D83B8        279         12 row cache objects                                       23981  739014460
0000000A26265208        279          4 row cache objects                                    19973399  852043775
0000000A26265548        279         10 row cache objects                                      280137  856097342
00000009D88D8218        279          9 row cache objects                                   715879777 1219000976
0000000A262656E8        279         13 row cache objects                                     3856073 2397402780
0000000A16FF1668        279          5 row cache objects                                    12763217 2920278217
*0000000A16FF1808        279          8 row cache objects                                    67329804 4145389092*
51 rows selected.
niku> list
  1 select addr, latch#, child#, name, misses, gets from v$latch_children where name like '%row%cache%objec%'  order by gets , misses
niku> select distinct s.kqrstcln latch#,r.cache#,r.parameter name,r.type,r.subordinate#
from v$rowcache r,x$kqrst s
where r.cache#=s.kqrstcid
order by 1,4,5;  2    3    4
    LATCH#     CACHE# NAME                                               TYPE        SUBORDINATE#
         1          3 dc_rollback_segments                               PARENT
         2          1 dc_free_extents                                    PARENT
         3          4 dc_used_extents                                    PARENT
         4          2 dc_segments                                        PARENT
         5          0 dc_tablespaces                                     PARENT
         6          5 dc_tablespace_quotas                               PARENT
         7          6 dc_files                                           PARENT
         *8         10 dc_users                                           PARENT*
         *8          7 dc_users                                           SUBORDINATE            0*
         *8          7 dc_users                                           SUBORDINATE            1*
         *8          7 dc_users                                           SUBORDINATE            2*
         9          8 dc_objects                                         PARENT
         9          8 dc_object_grants                                   SUBORDINATE            0
        10         17 dc_global_oids                                     PARENT
        11         12 dc_constraints                                     PARENT
        12         13 dc_sequences                                       PARENT
        13         16 dc_histogram_defs                                  PARENT
        13         16 dc_histogram_data                                  SUBORDINATE            0
        13         16 dc_histogram_data                                  SUBORDINATE            1
        14         54 dc_sql_prs_errors                                  PARENT
        15         32 kqlsubheap_object                                  PARENT
        16         19 dc_table_scns                                      PARENT
        16         19 dc_partition_scns                                  SUBORDINATE            0
        17         18 dc_outlines                                        PARENT
        18         14 dc_profiles                                        PARENT
        19         47 realm cache                                        PARENT
        19         47 realm auth                                         SUBORDINATE            0
        20         48 Command rule cache                                 PARENT
        21         49 Realm Object cache                                 PARENT
        21         49 Realm Subordinate Cache                            SUBORDINATE            0
        22         46 Rule Set Cache                                     PARENT
        23         34 extensible security user and rol                   PARENT
        24         35 extensible security principal pa                   PARENT
        25         37 extensible security UID to princ                   PARENT
        26         36 extensible security principal na                   PARENT
        27         33 extensible security principal ne                   PARENT
        28         38 XS security class privilege                        PARENT
        29         39 extensible security midtier cach                   PARENT
        30         43 AV row cache 1                                     PARENT
        31         44 AV row cache 2                                     PARENT
        32         45 AV row cache 3                                     PARENT
        33         15 global database name                               PARENT
        34         20 rule_info                                          PARENT
        35         21 rule_or_piece                                      PARENT
        35         21 rule_fast_operators                                SUBORDINATE            0
        36         23 dc_qmc_ldap_cache_entries                          PARENT
        37         52 qmc_app_cache_entries                              PARENT
        38         53 qmc_app_cache_entries                              PARENT
        39         27 qmtmrcin_cache_entries                             PARENT
        40         28 qmtmrctn_cache_entries                             PARENT
        41         29 qmtmrcip_cache_entries                             PARENT
        42         30 qmtmrctp_cache_entries                             PARENT
        43         31 qmtmrciq_cache_entries                             PARENT
        44         26 qmtmrctq_cache_entries                             PARENT
        45          9 qmrc_cache_entries                                 PARENT
        46         50 qmemod_cache_entries                               PARENT
        47         24 outstanding_alerts                                 PARENT
        48         22 dc_awr_control                                     PARENT
        49         25 SMO rowcache                                       PARENT
        50         40 sch_lj_objs                                        PARENT
        51         41 sch_lj_oids                                        PARENT
61 rows selected.
niku> select parameter, gets from v$rowcache order by gets desc;
PARAMETER                              GETS
dc_users                         2802019571
dc_tablespaces                   2405092307
dc_objects                       1815427326                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

jjk wrote:
I've already been thru the link that you've mentioned and unfortunately couldn't make much use of it.I didn't think it was really likely to be relevant, but there was always a long shot that it might have given you a clue.
Considering the "dc_users" had maximum gets, I thought (rather as per internet) that it might be the point of contention. However I did observe high misses on child# 9 which is "dc_objects". It's often the case that the misses is more important than the gets when you see lots of gets and misses on a few latches/caches - the bit that might have been most instructure was the dictionary cache bit from the AWR showing gets, misses, scans, scanmisses etc. It might have told us a little about what was going in and out of the dictionary cache and let us guess why.
In alert log:
Sun Apr 29 02:20:00 2012
29-APR-2012 02:20:00 -- xxxxxxx package - REGRANT_READONLY Begin re-grant read only roles
Sun Apr 29 02:24:34 2012
29-APR-2012 02:24:34 -- xxxxxxx package - REGRANT_READONLY End re-grant read only roles
Sun Apr 29 02:30:00 2012
29-APR-2012 02:30:00 -- xxxxxxx package - REGRANT_READWRITE Begin re-grant read write roles
Sun Apr 29 02:32:02 2012
29-APR-2012 02:32:02 -- xxxxxxx package - REGRANT_READWRITE End re-grant read write roles
Is this code that "regrants" roles to users who already have them ? That's what it sounds like, and that sounds like something that would impact on various parts of the dictionary cache, especially dc_users, and possibly dc_obejcts.
CPU per    Elap per     Old
Executions   Rows Processed   Rows per Exec    Exec (s)   Exec (s)  Hash Value
161,198           1,244              0.0       0.00        0.00   978935325
select /*+ rule */ c.name, u.name from con$ c, cdef$ cd, user$ u
where c.con# = cd.con# and cd.enabled = :1 and c.owner# = u.us
er#
159,955         159,952              1.0       0.00        0.00  2458412332
select o.name, u.name from obj$ o, user$ u  where o.obj# = :1 an
d o.owner# = u.user#
159,932               6              0.0       0.00        0.00  2636710067
insert into objauth$(option$,grantor#,obj#,privilege#,grantee#,c
ol#,sequence#) values(decode(:1,0,null,:1),:2,:3,:4,:5,decode(:6
,0,null,:6),object_grant.nextval)
147,168         147,168              1.0       0.00        0.00  3468666020
select text from view$ where rowid=:1
124,635         124,635              1.0       0.00        0.00   564166580
select count(*) from (                                 select u.
name                                        from registry$ r, us
er$ u                            where r.status in (1,3,5)
and r.namespace = 'SERVER'The first one looks like a response to a constraint being breached.
The third one looks like something that might happen when you grant a privilege on an object to a user - and maybe the first one happens if the user has already got it and the insert raises a "duplicate key" error. The fourth one commonly happens when you have to re-optimize a query containing a view - and when you execute DDL (such as changing privileges on an object) you invalidate SQL and have to re-optimize it eventually. I can't remember where I've seen the second one appearing.
If you have a process that tries to do a lot of grants on objects to users and roles in a very short time, it's quite likely to create havoc in the dictionary cache - check what that package was up to and why it runs.
What is the missing information ?When I looked at some of your posting, the output didn't match the query, some of the later columns had gone missing - this might have been my browser rather than your input though.
Regards
Jonathan Lewis

Similar Messages

  • "latch: row cache objects" and high "VERSION_COUNT"

    Hello,
    we are being faced with a situation where the database spends most of it's time waiting for latches in the shared pool (as seen in the AWR report).
    All statements issued by the application are using bind variables, but what we can see in V$SQL is that even though the statements are using bind variables some of them have a relatively high version_count (> 300) and many invaliadations (100 - 200) even though the tables involved are very small (some not more than 3 or 4 rows).
    Here is some (hopefully enough) information about the environment
    Version: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production (on RedHat EL 5)
    Parameters:
    cursor_bind_capture_destination       memory+disk
    cursor_sharing                        EXACT
    cursor_space_for_time                 FALSE
    filesystemio_options                  none
    hi_shared_memory_address              0
    memory_max_target                     12288M
    memory_target                         12288M
    object_cache_optimal_size             102400
    open_cursors                          300
    optimizer_capture_sql_plan_baselines  FALSE
    optimizer_dynamic_sampling            2
    optimizer_features_enable             11.2.0.2
    optimizer_index_caching               0
    optimizer_index_cost_adj              100
    optimizer_mode                        ALL_ROWS
    optimizer_secure_view_merging         TRUE
    optimizer_use_invisible_indexes       FALSE
    optimizer_use_pending_statistics      FALSE
    optimizer_use_sql_plan_baselines      TRUE
    plsql_optimize_level                  2
    session_cached_cursors                50
    shared_memory_address                 0The shared pool size (according to AWR) is 4,832M     
    The buffer cache is 3,008M     
    Now, my question: is a version_count of > 300 a problem (we have about 10-15 of those with a total of ~7000 statements in v$sqlarea). Those are also the statements listed in the AWR report at the top in the section "SQL ordered by Version Count" and "SQL ordered by Sharable Memory"
    Is it possible that those statements are causing the the latch contention in the shared pool?
    I went through https://blogs.oracle.com/optimizer/entry/why_are_there_more_cursors_in_11g_for_my_query_containing_bind_variables_1
    The tables involved are fairly small and all the execution plans for each cursor are identical.
    I can understand some of the invalidations that happen, because we have 7 schemas that have identical tables, but from my understanding that shouldn't cause such a high invalidation number. Or am I mistaken?
    I'm not that experienced with Oracle tuning at that level, so I would appreciate any pointer on how I can find out where exactly the latch problem occurs
    After flushing the shared pool, the problem seems to go away for a while. But apparently that is only fighting symptoms, not fixing the root cause of the problem.
    Some of the statements in question:
    SELECT * FROM QRTZ_SIMPLE_TRIGGERS WHERE TRIGGER_NAME = :1 AND TRIGGER_GROUP = :2
    UPDATE QRTZ_TRIGGERS SET TRIGGER_STATE = :1 WHERE TRIGGER_NAME = :2 AND TRIGGER_GROUP = :3 AND TRIGGER_STATE = :4
    UPDATE QRTZ_TRIGGERS SET TRIGGER_STATE = :1 WHERE JOB_NAME = :2 AND JOB_GROUP = :3 AND TRIGGER_STATE = :4
    SELECT TRIGGER_STATE FROM QRTZ_TRIGGERS WHERE TRIGGER_NAME = :1 AND TRIGGER_GROUP = :2
    UPDATE QRTZ_SIMPLE_TRIGGERS SET REPEAT_COUNT = :1, REPEAT_INTERVAL = :2, TIMES_TRIGGERED = :3 WHERE TRIGGER_NAME = :4 AND TRIGGER_GROUP = :5
    DELETE FROM QRTZ_TRIGGER_LISTENERS WHERE TRIGGER_NAME = :1 AND TRIGGER_GROUP = :2So all of them are using bind variables.
    I have seen that the columns used in the where clause all have histograms available. Would removing them reduce the number of invalidations?
    Unfortunately I did not save the information from v$sql_shared_cursor before the shared pool was flushed, but most of the invalidations occurred in the ROLL_INVALID_MISMATCH column if that is of any help. There are some invalidations reported for AUTH_CHECK_MISMATCH and TRANSLATION_MISMATCH but to my understanding they caused by executing the statement for different schemas if I'm not mistaken.
    Looking at v$latch_missed, most of the waits for parent = 'row cache objects' are for "kqrpre: find obj" and "kqreqd: reget"

    >
    In the AWR report, what does the Dictionary Cache Stats section say?
    >
    Here they are:
    Dictionary Cache Stats                                                                                                     
    Cache                 Get Requests      Pct Miss     Scan Reqs    Mod Reqs      Final Usage                                
    dc_awr_control        65                0.00         0            2             1                                          
    dc_constraints        729               33.33        0            729           1                                          
    dc_global_oids        60                23.33        0            0             31                                         
    dc_histogram_data     7,397             10.53        0            0             2,514                                      
    dc_histogram_defs     21,797            9.83         0            0             5,239                                      
    dc_object_grants      4                 25.00        0            0             12                                         
    dc_objects            27,683            2.29         0            223           2,581                                      
    dc_profiles           1,842             0.00         0            0             1                                          
    dc_rollback_segments  1,634             0.00         0            0             39                                         
    dc_segments           7,335             6.94         0            360           1,679                                      
    dc_sequences          139               5.76         0            139           19                                         
    dc_table_scns         53                100.00       0            0             0                                          
    dc_tablespace_quotas  1,956             0.10         0            0             4                                          
    dc_tablespaces        17,488            0.00         0            0             11                                         
    dc_users              58,013            0.03         0            0             164                                        
    global database name  4,261             0.00         0            0             1                                          
    outstanding_alerts    54                0.00         0            0             9                                          
    sch_lj_oids           4                 0.00         0            0             2                                          
    Library Cache Activity                                                                                                     
    Namespace             Get Requests     Pct Miss     Pin Requests          Pct Miss      Reloads   Invalidations            
    ACCOUNT_STATUS        3,664            0.03         0                                   0         0                        
    BODY                  560              2.14         2,343                 0.60          0         0                        
    CLUSTER               52               0.00         52                    0.00          0         0                        
    DBLINK                3,668            0.00         0                                   0         0                        
    EDITION               1,857            0.00         3,697                 0.00          0         0                        
    INDEX                 99               19.19        99                    19.19         0         0                        
    OBJECT ID             68               100.00       0                                   0         0                        
    SCHEMA                2,646            0.00         0                                   0         0                        
    SQL AREA              32,996           2.26         1,142,497             0.21          189       226                      
    SQL AREA BUILD        848              62.15        0                                   0         0                        
    SQL AREA STATS        860              82.09        860                   82.09         0         0                        
    TABLE/PROCEDURE       17,713           2.62         26,112                4.88          61        0                        
    TRIGGER               1,704            2.00         6,737                 0.52          1         0                        

  • Row cache lock aquired for more than 1 hour

    Hi could some please let me know what is ROW CACHE LOCK, and at what situations does this happen. And also what does dc_histogram_defs enqueue means, what happening internally??
    I am facing with a problem in our d/b(11g r1) with a code running more that 1 hr, but nothing is happening in our objects actually, only info i can see is ROW CACHE LOCK for more that 3000 seconds:
    select p1text,p1,p2text,p2,p3text,p3 from v$session where event = 'row cache lock' and sid=37
    P1TEXT     P1     P2TEXT     P2     P3TEXT     P3
    cache id     16     mode     0     request     3
    select type,parameter,count,usage,gets,getmisses,scans,scanmisses,flushes,dlm_requests from v$rowcache where cache#=16
    TYPE     PARAMETER     COUNT     USAGE     GETS     GETMISSES     SCANS     SCANMISSES     FLUSHES     DLM_REQUESTS
    PARENT     dc_histogram_defs     4,497     4,497     12,426,122     1,446,845     0     0     210,040     1,706,801
    SUBORDINATE     dc_histogram_data     1,965     1,965     8,995,128     500,660     0     0     91,463     0
    SUBORDINATE     dc_histogram_data     297     297     3,500,090     46,371     0     0     6,591     0

    hi,
    could you take a look at this topic
    row cache lock
    regards,

  • Error: WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK! pid=26

    Hi every one,
    Today, i met a problem: Application cannot connect to database because database hang ( I also cannot connect to database with sqlplus) . Check alert log, only one error:
    WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK! pid=26This error not only appear first time, but also happen every one month. I must reset server for database release all memory but I think It isn't a true solution!
    Could you give a recommend for this.
    Regards.

    The Row Cache is actually the Data Dictionary Cache. It is where definitions from the data dictionary (tablespaces, objects, users etc) are loaded into memory.
    There would be an associated trace file written with the occurrence of this warning.
    See Oracle Support Note 278316.1 for more information
    Hemant K Chitale

  • ROW CACHE ENQUEUE LOCK/ibrary cache load lock leads to database hung

    (lowercase, curly brackets, no spaces)
    We faced database hung on 3 node 11i erp 9i rac database.
    We saw the library cache load lock timed out events reported in alert log.
    Then few ora-600 and later ROW CACHE ENQUEUE LOCK timed out event. Eventually database was hung and we had to bounce the services .
    we created support sr 7845542.992 for RCA.
    The support says to increase shared pool size to avoid shared pool fragmentation and avoid reload ,additionaly to upgrade to 10g database.
    I am not covinced adding additional pool size would solve this or upgrade to 10 .furthermore even 10g has such issues reported.
    I saw couple of bugs mentioned such issue can happen due deadlock of session holding latches .
    kindly let me know your view on issue
    If required i can attach statspack for more information. (lowercase, curly brackets, no spaces)

    Many Thanks, i was keen to have your update .
    There are 8 cpus on each node . Reloads very high during time period ,but normally there are not high reloads.
    Statspack details for 3 nodes
    STATSPACK report for
    DB Name         DB Id    Instance     Inst Num Release     Cluster Host
    PROD            21184234 PROD1               1 9.2.0.8.0   YES     npi-or-db-p-
                                                                       11.npi.corp
                  Snap Id     Snap Time      Sessions Curs/Sess Comment
    Begin Snap:    149817 30-Oct-09 13:00:09      574 #########
      End Snap:    149837 30-Oct-09 14:00:17      602 #########
       Elapsed:               60.13 (mins)
    Cache Sizes (end)
    ~~~~~~~~~~~~~~~~~
                   Buffer Cache:     8,192M      Std Block Size:          8K
               Shared Pool Size:     1,024M          Log Buffer:     10,240K
    Load Profile
    ~~~~~~~~~~~~                            Per Second       Per Transaction
                      Redo size:            122,414.93             11,449.13
                  Logical reads:             69,550.76              6,504.89
                  Block changes:                928.41                 86.83
                 Physical reads:                196.24                 18.35
                Physical writes:                 28.65                  2.68
                     User calls:                343.97                 32.17
                         Parses:                558.61                 52.25
                    Hard parses:                 43.48                  4.07
                          Sorts:                467.24                 43.70
                         Logons:                  0.63                  0.06
                       Executes:              2,046.99                191.45
                   Transactions:                 10.69
      % Blocks changed per Read:    1.33    Recursive Call %:     97.59
    Rollback per transaction %:    5.07       Rows per Sort:     15.85
    Instance Efficiency Percentages (Target 100%)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                Buffer Nowait %:  100.00       Redo NoWait %:    100.00
                Buffer  Hit   %:   99.72    In-memory Sort %:    100.00
                Library Hit   %:   96.79        Soft Parse %:     92.22
             Execute to Parse %:   72.71         Latch Hit %:     99.77
    Parse CPU to Parse Elapsd %:   60.10     % Non-Parse CPU:     78.07
    -> s  - second
    -> cs - centisecond -     100th of a second
    -> ms - millisecond -    1000th of a second
    -> us - microsecond - 1000000th of a second
    -> ordered by wait time desc, waits desc (idle events last)
                                                                       Avg
                                                         Total Wait   wait    Waits
    Event                               Waits   Timeouts   Time (s)   (ms)     /txn
    db file sequential read           249,234          0      1,537      6      6.5
    db file scattered read             61,776          0        769     12      1.6
    row cache lock                    780,098         10        566      1     20.2
    library cache lock                697,849        157        432      1     18.1
    latch free                        127,926      4,715        387      3      3.3
    global cache cr request           370,770      3,091        309      1      9.6
    PL/SQL lock timer                      59         58        112   1903      0.0
    wait for scn from all nodes       303,572         18        103      0      7.9
    library cache pin                  26,231          2        100      4      0.7
    global cache null to x             17,717        716         92      5      0.5
    buffer busy waits                   5,388         18         74     14      0.1
    db file parallel read               5,245          0         69     13      0.1
    log file sync                      20,407         29         66      3      0.5
    enqueue                            52,200         70         60      1      1.4
    buffer busy global CR               4,845         33         55     11      0.1
    CGS wait for IPC msg              412,512    407,106         50      0     10.7
    ksxr poll remote instances      1,279,565    483,046         48      0     33.2
    log file parallel write           160,040          0         42      0      4.1
    library cache load lock             1,491          2         29     20      0.0
    global cache open x                19,507        344         28      1      0.5
    buffer busy global cache              957          0         22     23      0.0
    global cache s to x                16,516        180         20      1      0.4
    db file parallel write             11,120          0         12      1      0.3
    log file sequential read              618          0         11     18      0.0
    DFS lock handle                    23,768          0         10      0      0.6
    control file sequential read        8,563          0          4      0      0.2
    KJC: Wait for msg sends to c        1,549         57          4      3      0.0
    lock escalate retry                    76         76          4     52      0.0
    SQL*Net break/reset to clien       12,546          0          3      0      0.3
    SQL*Net more data to client        85,773          0          3      0      2.2
    control file parallel write         1,265          0          2      1      0.0
    global cache null to s                648         23          1      2      0.0
    global cache busy                     200          0          1      5      0.0
    global cache open s                 1,493         28          1      1      0.0
    log file switch completion             12          0          1     61      0.0
    PX Deq Credit: send blkd              161         70          1      4      0.0
    kksfbc child completion               119        118          1      5      0.0
    PX Deq: reap credit                 5,948      5,456          0      0      0.2
    PX Deq: Execute Reply                  83         29          0      3      0.0
    process startup                         8          0          0     25      0.0
    LGWR wait for redo copy               992         12          0      0      0.0
    IPC send completion sync              450        450          0      0      0.0
    PX Deq: Parse Reply                   100         28          0      1      0.0
    undo segment extension             10,380     10,372          0      0      0.3
    PX Deq: Join ACK                      146         65          0      1      0.0
    buffer deadlock                       222        221          0      0      0.0
    async disk IO                       1,179          0          0      0      0.0
    wait list latch free                    2          0          0     16      0.0
    PX Deq: Msg Fragment                  112         28          0      0      0.0
    Library Cache Activity for DB: PROD  Instance: PROD1  Snaps: 149817 -149837
    ->"Pct Misses"  should be very low
                             Get  Pct        Pin        Pct               Invali-
    Namespace           Requests  Miss     Requests     Miss     Reloads  dations
    BODY                 116,007    1.1        133,347   19.9     24,338        0
    CLUSTER                4,224    0.6          5,131    1.0          0        0
    INDEX                 15,048   24.1         13,798   26.4          2        0
    JAVA DATA                 82    0.0            692   39.6        136        0
    JAVA RESOURCE             66   39.4            206   25.2         12        0
    PIPE                   1,140    0.5          1,160    0.5          0        0
    SQL AREA           1,197,908   12.6     13,517,660    1.5    111,833       73
    TABLE/PROCEDURE    3,847,439    0.8      4,230,265    7.9    142,200        0
    TRIGGER                8,444    2.4          8,657   18.5      1,274        0
                        GES Lock      GES Pin      GES Pin   GES Inval GES Invali-
    Namespace           Requests     Requests     Releases    Requests     dations
    BODY                       1        1,234        1,258         985           0
    CLUSTER                3,222           25           25          25           0
    INDEX                 13,792        3,641        3,631       3,629           0
    JAVA DATA                  0            0            0           0           0
    JAVA RESOURCE              0           26           25           0           0
    PIPE                       0            0            0           0           0
    SQL AREA                   0            0            0           0           0
    TABLE/PROCEDURE      857,137       13,130       13,264      10,762           0
    TRIGGER                    0          200          202         200           0
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    STATSPACK report for
    DB Name         DB Id    Instance     Inst Num Release     Cluster Host
    PROD            21184234 PROD2               2 9.2.0.8.0   YES     npi-or-db-p-
                                                                       12.npi.corp
                  Snap Id     Snap Time      Sessions Curs/Sess Comment
    Begin Snap:    149847 30-Oct-09 14:00:05      493 #########
      End Snap:    149857 30-Oct-09 15:00:02      432 #########
       Elapsed:               59.95 (mins)
    Cache Sizes (end)
    ~~~~~~~~~~~~~~~~~
                   Buffer Cache:     8,192M      Std Block Size:          8K
               Shared Pool Size:     1,024M          Log Buffer:     10,240K
    Load Profile
    ~~~~~~~~~~~~                            Per Second       Per Transaction
                      Redo size:             71,853.44             32,058.65
                  Logical reads:            273,904.84            122,207.36
                  Block changes:                889.13                396.70
                 Physical reads:                 40.40                 18.03
                Physical writes:                 20.97                  9.35
                     User calls:                153.74                 68.60
                         Parses:                 66.19                 29.53
                    Hard parses:                  2.66                  1.19
                          Sorts:                 25.70                 11.47
                         Logons:                  0.16                  0.07
                       Executes:                726.41                324.10
                   Transactions:                  2.24
      % Blocks changed per Read:    0.32    Recursive Call %:     92.41
    Rollback per transaction %:    4.84       Rows per Sort:    193.55
    Instance Efficiency Percentages (Target 100%)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                Buffer Nowait %:  100.00       Redo NoWait %:     99.99
                Buffer  Hit   %:   99.99    In-memory Sort %:    100.00
                Library Hit   %:   99.35        Soft Parse %:     95.97
             Execute to Parse %:   90.89         Latch Hit %:     99.99
    Parse CPU to Parse Elapsd %:   36.55     % Non-Parse CPU:     98.28
    Wait Events for DB: PROD  Instance: PROD2  Snaps: 149847 -149857
    -> s  - second
    -> cs - centisecond -     100th of a second
    -> ms - millisecond -    1000th of a second
    -> us - microsecond - 1000000th of a second
    -> ordered by wait time desc, waits desc (idle events last)
                                                                       Avg
                                                         Total Wait   wait    Waits
    Event                               Waits   Timeouts   Time (s)   (ms)     /txn
    enqueue                            65,823     33,667     90,459   1374      8.2
    row cache lock                     38,996        560      1,795     46      4.8
    PX Deq Credit: send blkd              522        499      1,223   2344      0.1
    PX Deq: Parse Reply                   466        416        987   2117      0.1
    db file sequential read            50,130          0        421      8      6.2
    library cache lock                 78,842        172        210      3      9.8
    db file scattered read              6,904          0        152     22      0.9
    global cache cr request            84,801        575        113      1     10.5
    latch free                          8,096        736         65      8      1.0
    log file sync                       5,676         27         41      7      0.7
    wait for scn from all nodes        18,891         10         24      1      2.3
    CGS wait for IPC msg              394,678    392,142         21      0     49.0
    library cache pin                   1,339          0         17     13      0.2
    global cache null to x              2,145         48         16      8      0.3
    global cache s to x                 3,242         32         16      5      0.4
    buffer busy waits                     366         10         15     40      0.0
    ksxr poll remote instances         70,990     31,295         14      0      8.8
    db file parallel read                 359          0         11     31      0.0
    global cache open x                 2,708         55         10      4      0.3
    async disk IO                       3,474          0          8      2      0.4
    global cache open s                 3,470         10          6      2      0.4
    log file parallel write            13,076          0          5      0      1.6
    global cache busy                      58         40          5     90      0.0
    PL/SQL lock timer                       1          1          5   4877      0.0
    DFS lock handle                     3,362          0          5      1      0.4
    log file sequential read              412          0          4     10      0.1
    db file parallel write              2,774          0          3      1      0.3
    library cache load lock                59          0          3     58      0.0
    buffer busy global CR                 722          0          3      4      0.1
    control file sequential read        6,398          0          3      0      0.8
    SQL*Net break/reset to clien       16,078          0          2      0      2.0
    name-service call wait                 26          0          2     67      0.0
    control file parallel write         1,248          0          2      1      0.2
    process startup                        24          0          1     49      0.0
    KJC: Wait for msg sends to c        3,491          4          1      0      0.4
    SQL*Net more data to client        23,724          0          1      0      2.9
    buffer busy global cache               23          0          0     19      0.0
    global cache null to s                114          0          0      4      0.0
    PX Deq: reap credit                 5,646      5,509          0      0      0.7
    log file switch completion              4          0          0     58      0.0
    lock escalate retry                    54         54          0      1      0.0
    IPC send completion sync              119        118          0      0      0.0
    direct path read                    2,820          0          0      0      0.3
    direct path read (lob)              3,632          0          0      0      0.5
    PX Deq: Join ACK                       88         37          0      0      0.0
    direct path write                   2,470          0          0      0      0.3
    kksfbc child completion                 6          6          0      6      0.0
    buffer deadlock                         3          3          0     11      0.0
    global cache quiesce wait               4          4          0      8      0.0
    Library Cache Activity for DB: PROD  Instance: PROD2  Snaps: 149847 -149857
    ->"Pct Misses"  should be very low
                             Get  Pct        Pin        Pct               Invali-
    Namespace           Requests  Miss     Requests     Miss     Reloads  dations
    BODY                  27,353    0.5         28,091    6.5      1,643        0
    CLUSTER                  203    1.0            269    1.5          0        0
    INDEX                    526    9.9            271   19.9          0        0
    JAVA DATA                 18    0.0            120    6.7          4        0
    JAVA RESOURCE             20   45.0             56   26.8          3        0
    JAVA SOURCE                1  100.0              1  100.0          0        0
    PIPE                     999    0.4          1,043    0.4          0        0
    SQL AREA             131,793    7.6      3,406,577    0.4      7,012        0
    TABLE/PROCEDURE      926,987    0.2      1,907,993    1.0      8,845        0
    TRIGGER                1,519    0.1          1,532    4.9         69        0
                        GES Lock      GES Pin      GES Pin   GES Inval GES Invali-
    Namespace           Requests     Requests     Releases    Requests     dations
    BODY                       1          129          277         117           0
    CLUSTER                  168            2            2           2           0
    INDEX                    271           52           56          52           0
    JAVA DATA                  0            0            0           0           0
    JAVA RESOURCE              0            9            6           0           0
    JAVA SOURCE                0            1            1           1           0
    PIPE                       0            0            0           0           0
    SQL AREA                   0            0            0           0           0
    TABLE/PROCEDURE       89,523          764          868         460           0
    TRIGGER                    0            2           14           2           0
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    DB Name         DB Id    Instance     Inst Num Release     Cluster Host
    PROD            21184234 PROD3               3 9.2.0.8.0   YES     npi-or-db-p-
                                                                       13.npi.corp
                  Snap Id     Snap Time      Sessions Curs/Sess Comment
    Begin Snap:    149808 30-Oct-09 14:00:00       31 #########
      End Snap:    149809 30-Oct-09 15:00:02       34  11,831.4
       Elapsed:               60.03 (mins)
    Cache Sizes (end)
    ~~~~~~~~~~~~~~~~~
                   Buffer Cache:     8,192M      Std Block Size:          8K
               Shared Pool Size:     1,024M          Log Buffer:     10,240K
    Load Profile
    ~~~~~~~~~~~~                            Per Second       Per Transaction
                      Redo size:              1,518.14             36,700.35
                  Logical reads:              1,333.43             32,235.02
                  Block changes:                  5.09                123.01
                 Physical reads:                 54.31              1,312.88
                Physical writes:                  3.91                 94.44
                     User calls:                  1.46                 35.40
                         Parses:                  2.24                 54.21
                    Hard parses:                  0.04                  0.93
                          Sorts:                  0.84                 20.28
                         Logons:                  0.06                  1.45
                       Executes:                  3.11                 75.23
                   Transactions:                  0.04
      % Blocks changed per Read:    0.38    Recursive Call %:     94.31
    Rollback per transaction %:   45.64       Rows per Sort:    215.97
    Instance Efficiency Percentages (Target 100%)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                Buffer Nowait %:   99.99       Redo NoWait %:    100.00
                Buffer  Hit   %:   96.21    In-memory Sort %:    100.00
                Library Hit   %:   99.07        Soft Parse %:     98.29
             Execute to Parse %:   27.94         Latch Hit %:     99.98
    Parse CPU to Parse Elapsd %:   69.88     % Non-Parse CPU:     97.92
    Wait Events for DB: PROD  Instance: PROD3  Snaps: 149808 -149809
    -> s  - second
    -> cs - centisecond -     100th of a second
    -> ms - millisecond -    1000th of a second
    -> us - microsecond - 1000000th of a second
    -> ordered by wait time desc, waits desc (idle events last)
                                                                       Avg
                                                         Total Wait   wait    Waits
    Event                               Waits   Timeouts   Time (s)   (ms)     /txn
    enqueue                            19,510      7,472     15,509    795    130.9
    PX Deq: Parse Reply                 1,152      1,071      2,577   2237      7.7
    row cache lock                      2,202        518      1,579    717     14.8
    db file scattered read             31,556          0        354     11    211.8
    db file sequential read            17,272          0         67      4    115.9
    db file parallel read               1,722          0         34     20     11.6
    global cache cr request            53,754         91         32      1    360.8
    wait for scn from all nodes         1,897         13         10      5     12.7
    CGS wait for IPC msg              403,358    401,478         10      0  2,707.1
    DFS lock handle                     4,753          0          8      2     31.9
    direct path read                    1,248          0          6      5      8.4
    PX Deq: Execute Reply                 110         38          6     51      0.7
    global cache open s                   160         10          5     31      1.1
    control file sequential read        6,442          0          3      0     43.2
    name-service call wait                 26          0          2     78      0.2
    latch free                            129        109          2     13      0.9
    KJC: Wait for msg sends to c          153         24          1      9      1.0
    control file parallel write         1,245          0          1      1      8.4
    buffer busy waits                     199          0          1      6      1.3
    process startup                        20          0          1     44      0.1
    global cache null to x                 74          2          1      9      0.5
    global cache null to s                 19          0          1     29      0.1
    global cache open x                   268          1          1      2      1.8
    library cache lock                  1,150          0          0      0      7.7
    PX Deq: Join ACK                      129         48          0      3      0.9
    log file parallel write             1,157          0          0      0      7.8
    async disk IO                         219          0          0      1      1.5
    direct path write                   1,024          0          0      0      6.9
    ksxr poll remote instances          6,740      4,595          0      0     45.2
    PX Deq: reap credit                 6,580      6,511          0      0     44.2
    buffer busy global CR                  73          0          0      2      0.5
    log file sequential read               11          0          0     10      0.1
    log file sync                         100          0          0      1      0.7
    global cache s to x                   282          2          0      0      1.9
    db file parallel write                 95          0          0      1      0.6
    library cache pin                     142          0          0      0      1.0
    SQL*Net break/reset to clien           28          0          0      1      0.2
    IPC send completion sync               81         81          0      0      0.5
    PX Deq: Signal ACK                     32         14          0      1      0.2
    PX Deq Credit: send blkd                3          1          0      7      0.0
    SQL*Net more data to client           841          0          0      0      5.6
    PX Deq: Msg Fragment                   37         17          0      0      0.2
    log file single write                   4          0          0      1      0.0
    db file single write                    1          0          0      1      0.0
    SQL*Net message from client         4,213          0     13,673   3246     28.3
    gcs remote message                214,784     75,745      7,016     33  1,441.5
    wakeup time manager                   233        233      6,812  29237      1.6
    PX Idle Wait                        2,338      2,294      5,686   2432     15.7
    PX Deq: Execution Msg               2,151      1,979      4,796   2229     14.4
    Library Cache Activity for DB: PROD  Instance: PROD3  Snaps: 149808 -149809
    ->"Pct Misses"  should be very low
                             Get  Pct        Pin        Pct               Invali-
    Namespace           Requests  Miss     Requests     Miss     Reloads  dations
    BODY                   1,290    0.0          1,290    0.0          0        0
    CLUSTER                   18    0.0              8    0.0          0        0
    SQL AREA               4,893    2.0         36,371    0.5          2        0
    TABLE/PROCEDURE        1,555    3.9          3,834    4.9         71        0
    TRIGGER                  286    0.0            286    0.0          0        0
                        GES Lock      GES Pin      GES Pin   GES Inval GES Invali-
    Namespace           Requests     Requests     Releases    Requests     dations
    BODY                       1            0            0           0           0
    CLUSTER                    4            0            0           0           0
    SQL AREA                   0            0            0           0           0
    TABLE/PROCEDURE          863          224           42          42           0
    TRIGGER                    0            0            0           0           0
              -------------------------------------------------------------

  • After REFRESH the cached object is not consistent with the database table

    After REFRESH, the cached object is not consistent with the database table. Why?
    I created a JDBC connection with the Oracle database (HR schema) using JDeveloper(10.1.3) and then I created an offline database (HR schema)
    in JDeveloper from the existing database tables (HR schema). Then I made some updates to the JOBS database table using SQL*Plus.
    Then I returned to the JDeveloper tool and refreshed the HR connection. But I found no any changes made to the offline database table JOBS in
    JDeveloper.
    How to make the JDeveloper's offline tables to be synchronized with the underling database tables?

    qkc,
    Once you create an offline table, it's just a copy of a table definition as of the point in time you brought it in from the database. Refreshing the connection, as you describe it, just refreshes the database browser, and not any offline objects. If you want to syncrhnonize the offline table, right-click the offline table and choose "Generate or Reconcile Objects" to reconcile the object to the database. I just tried this in 10.1.3.3 (not the latest 10.1.3, I know), and it works properly.
    John

  • BizTalk 2006 Event Log Warnings - Cannot insert duplicate key row in object 'dta_MessageFieldValues' with unique index 'IX_MessageFieldValues'.

    We have been seeing the following 'warnings' in the event log of our BizTalk machine since upgrading to BTS 2006. They seem to occur randomly 6 or 8 times per day.
    Does anyone know what this means and what needs to be done to clear it up? we have only one BizTalk server which is running on only one machine.
    I am new to BizTalk, so I am unable to find how many tracking host instances running for BizTalk server. Also, can you please let me know that we can configure only one instance for one server/machine?
    Source: BAM EventBus Service
    Event: 5
    Warning Details: Execute batch error. Exception information: TDDS failed to batch execution of streams. SQLServer: bizprod, Database: BizTalkDTADb.Cannot insert duplicate key row in object 'dta_MessageFieldValues'
    with unique index 'IX_MessageFieldValues'. The statement has been terminated..

    Other than ensuring that there exists a separate and single tracking host instance, you're getting an error about duplicate keys.. which implies that you're trying to Create a BAM Activity twice with the same data.
    I suggest you have a in-depth examination of the BAM (TPE or API) associated with the orchestration. In TPE ensure that the first binding you select is the "Instance Id" or "Message Id" before going ahead to map the ports or others.
    Regards.

  • Re: Update Cache Objects in Delta Process Dosn't work

    Hi All,
    Re: Update Cache Objects in Delta Process doesn't work.
    BI 7 - SP 17
    This is the scenario I am working on, am running a bex query on a Cube(via a multi) with bunch aggregates.
    The daily extraction & Aggregate rollup is correct, but when I run a Bex Query it display incorrect keyfigure values as compared to what we see in LISTCUBE for the infocube.
    So when I ran the same query in RSRT with "Do not use Cache", it gave correct results and then when I ran the Bex Query again it fixed itself and it displayed correctly.
    InfoCube - standard & No compression for requests
    Query Properties are
    Read Mode - H
    Req Status  - 1
    Cache - Main Memory Cache Without swaping
    Update Cache Objects in Delta Process (Flag selected)
    SP grouping - 1
    This problem occurs once in couple of weeks and my question is there a permanant fix for it??
    OR should we turn the cache off??
    Can anyone please help.
    Thanking You.
    Rao

    Hi Kevin/Rao,
    We are currently experiencing problems with the 'Update Cache Objects in Delta' process.  Did either of you manage to resolve your issues, and if so, how?

  • TopLink cached object changed are not commited to the database

    Hello,
    I'm using TopLink 10 and I have a writing issue with a use case:
    1. I read an obect using TopLink that is in the IdentityMap
    2. Using JSF this object is edited throught a web form.
    3. I give the modified object to the data layer and try to modify inside a unit of work:
    UnitOfWork uow = session.acquireUnitOfWork();
    //laspEtapeDef comes from JSF and has been modfied previously
    LaspEtapeDef laspEtapeDefClone = uow.readObject( laspEtapeDef );
    //I update the clone field
    laspEtapeDefClone.setDescription(laspEtapeDef.getDescription());
    uow.commit();4. I use again the same object to display it once modified.
    The object is modified in the cache but the modified fields are never commited to the database. This code works only if I disable the cache.
    So, I've modified my JSF form to send the fields instead of modifying directly the object.
    My question: Is there a way to commit changes mades in an cached object?
    I've found the following section in the documentation, that explain the problem but doesn't gives the solution:
    http://docs.oracle.com/cd/E14571_01/web.1111/b32441/uowadv.htm#CACGDJJH
    Any idea?

    How are you reading in the object initially? The problem is likely that you are modifying an object from the session cache. When you then read in the object from the uow, it uses the object in the session cache as the back up. So there will not appear to be any changes to persist to the database.
    You will need to make a copy of the object for modification, or use the copy from the unitofwork to make the changes instead of working directly on the object in the session. Disabling the cache means there is no copy in the session cache to use as a back up, so the uow read has to build an object from the database.
    Best Regards,
    Chris

  • Cannot insert duplicate key row in object

    This is a JPA question. The tbHardware table has a PK identity column and a unique non-clustered index on CoxBarcode column.
    I have a SFSB in a Seam2.0.0.GA app running on JBoss 4.2.1.GA. I am using flushMode=FlushModeType.MANUAL (Seam specific when beginning a conversation) and that's why you see the flush() reference at the end of the following code snippet.
    Query query = entityManager.createNativeQuery("INSERT INTO tbHardware "+
                                                 "VALUES (:coxBarCode, :serialNo, :currentStatus, :currentLocationNo, "+
                                                 ":desc, :hardwareModelId, :ownerTypeCode, :firstEnteredDate, :enteredByUser, :lastAuditDate, :hardwarePrice, null)")
                                              .setParameter("coxBarCode", coxBarcode)
                                              .setParameter("serialNo", serialNo)
                                              .setParameter("currentStatus", curstatus)
                                              .setParameter("currentLocationNo", curloc)
                                              .setParameter("desc", desc)
                                              .setParameter("hardwareModelId", selmodid)
                                              .setParameter("ownerTypeCode", selectedOwner)
                                              .setParameter("firstEnteredDate", firstEnteredDate)
                                              .setParameter("enteredByUser", enteredByUser)
                                              .setParameter("lastAuditDate", lastAuditedDate)
                                              .setParameter("hardwarePrice", unitPrice);
                             query.executeUpdate();
                             query = entityManager.createNativeQuery("INSERT INTO TbHardwareHistory "+
                                            "VALUES (:hardwareId, :currentStatus, :currentLocationNo, :firstEnteredDate, null, :enteredByUser, :ownerTypeCode)")
                                             .setParameter("hardwareId", findHardwareId(coxBarcode))                                        
                                             .setParameter("currentStatus", curstatus)
                                             .setParameter("currentLocationNo", curloc)          
                                             .setParameter("firstEnteredDate", firstEnteredDate)
                                             .setParameter("enteredByUser", enteredByUser)
                                             .setParameter("ownerTypeCode", selectedOwner);
                             query.executeUpdate();
                             //TO DO: following query should return only one entity, need to refactor and remove the for loop below
                             TbHardware hw = (TbHardware)entityManager.createNativeQuery("SELECT t FROM tbHardware t WHERE t.coxBarCode = :coxBarCode AND t.serialNo = :serialNo", TbHardware.class)
                                                                                    .setParameter("coxBarCode", coxBarcode)
                                                                                    .setParameter("serialNo", serialNo)
                                                                                    .getSingleResult();
                             Integer hardwareId = hw.getHardwareId();
                             query = entityManager.createNativeQuery("INSERT INTO tbHardwareNote VALUES (:hardwareId, :hardwareNote)")
                                                   .setParameter("hardwareId", hardwareId).setParameter("hardwareNote", hardwareNote);
                             query.executeUpdate();
                             entityManager.flush();I am getting the following in the server.log:
    10:10:57,552 ERROR [STDERR] Caused by: org.hibernate.exception.SQLGrammarException: could not execute native bulk manipulation query
    10:10:57,552 ERROR [STDERR]      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
    10:10:57,552 ERROR [STDERR]      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
    10:10:57,552 ERROR [STDERR]      at org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:174)
    10:10:57,552 ERROR [STDERR]      at org.hibernate.impl.SessionImpl.executeNativeUpdate(SessionImpl.java:1163)
    10:10:57,552 ERROR [STDERR]      at org.hibernate.impl.SQLQueryImpl.executeUpdate(SQLQueryImpl.java:334)
    10:10:57,552 ERROR [STDERR]      at org.hibernate.ejb.QueryImpl.executeUpdate(QueryImpl.java:48)
    10:10:57,552 ERROR [STDERR]      ... 138 more
    10:10:57,552 ERROR [STDERR] Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert duplicate key row in object 'dbo.tbHardware' with unique index 'IX_tbHardwar_coxBarCode_UNIQUE'.
    10:10:57,552 ERROR [STDERR]      at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
    10:10:57,552 ERROR [STDERR]      at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
    10:10:57,552 ERROR [STDERR]      at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source)
    10:10:57,552 ERROR [STDERR]      at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(Unknown Source)
    10:10:57,552 ERROR [STDERR]      at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
    10:10:57,552 ERROR [STDERR]      at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
    10:10:57,552 ERROR [STDERR]      at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source)
    10:10:57,552 ERROR [STDERR]      at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)
    10:10:57,552 ERROR [STDERR]      at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(Unknown Source)
    10:10:57,552 ERROR [STDERR]      at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:251)
    10:10:57,552 ERROR [STDERR]      at org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:165)
    10:10:57,552 ERROR [STDERR]      ... 141 moreHow should I handle this SQLServerException? What is the best practice regarding this from a JPA perspective? I thought about executing a select query prior to the insert in tbHardware to check to see if a record with that particular coxBarCode exists or not. Would the exception be handled differently if I used the persist() method instead of the createNativeQuery() and executeUpdate() combination? thx.
    Edited by: asookazian on May 7, 2008 11:07 AM

    kajbj wrote:
    What do you mean by control? Yes, you can find duplicates and remove them (by e.g. implementing a Comparator and adding them to a Set)
    KajI mean to say replace the duplication with just a single value for insert!
    Any psuedo for the comparactor suggested?

  • Performance issues; waited too long for a row cache enqueue lock!

    hi Experts,
    OS: Oracle Solaris on SPARC (64-bit)
    DB version:
    SQL> select * from V$VERSION;
    BANNER
    Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for Solaris: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL>We have seen 100% CPU usage and high database load, so I checked the instance and have seen there were many blocking sessions and more than 71 sessions running the same select ;
    elect tablespace_name as tbsname from        (select tablespace_name,sum(bytes)/1024/1024 free_mb,0 total_mb,0 max_mb         from dba_free_space         group by tablespace_name         union         select tablespace_name, 0 current_mb,sum(bytes)/1024/1024 total_mb,                sum(decode(maxbytes, 0, bytes, maxbytes))/1024/1024 max_mb         from dba_data_files         group by tablespace_name) group by tablespace_name having round((sum(total_mb)-sum(free_mb))/sum(max_mb)*100) > 95  Blocking sessions are running queries like this;
    SELECT * from MYTABLE WHERE MYCOL=:1 FOR UPDATE;This select queries are coming from a cron job running every 10 minutes to check the tablespaces; so I first killed (kill -9 pid) those select statements so the load and CPU decreased to 13% of CPU usage. Blocking sessions still there and I didn't killed them waiting for app guys confirmation... after few hours and the CPU usage never went down the 13%; I have seen many errors;
    WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK! pid=...System State dumped to trace file .....trcAfter that , we decided to restart the DB to release the locks!
    I would like to understand why during loads we were no able to run those select statements, statspack schedule snapshot reports were not able to finish, also automatic
    database statistics... why 5 for update statements locked the whole DB?

    user12035575 wrote:
    SELECT FOR UPDATE will only lock the table row until the transaction is completed.
    "WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK" happens when it needs to acquire a lock on data dictionary. Did you check the trace file associated with the statement?The trace file is too long, which information I need to focus more?

  • Sybase Error 2601 Attempt to insert duplicate key row in object with unique

    RE: Sybase Error 2601 Attempt to insert duplicate key row in object with unique index.
    Hi Folks,
    I'm getting the following error whilst executing a stored procedure in Sybase.
    ERROR: Sybase Error 2601 Attempt to insert duplicate key row in object with unique index.
    I understand that duplicate values have been inserted into a column that has a unique constraint.
    I just can't figure out how to rectify the problem.
    Your help will be greatly appreciated!
    Many thanks in advance.

    If the value I'm trying to insert (using update)
    already exists in the unique-value field then the DB
    refuses to update the field.
    If the value is different it will update.Are you trying to insert or update in SQL (identified by the keyword INSERT or UPDATE respectively)?
    Even in case of an UPDATE query, if you are going to update the values of some columns to violate the unique constraints, the update will not succeed and you will get the error message.
    or is it?
    it tries to create a new row, but can't because there
    is another row with the same unique-values.
    If this is the case, I am only trying to update and
    not create a new item.To put it in simpler words, if you have a set of values defining the uniqueness of a record, you cannot insert another record with the same set of unique values. Similarly, you cannot update an existing record by modifying the set to conflict with another set of unique values which already exist in the database.
    Suppose there are two columns A and B defining the uniqueness of the record and you have only two records at the moment like -
    A B
    ========
    1 1
    2 1
    If you try to insert a record with A = 1 and B = 1, it will fail because a record already exists. You cannot violate uniqueness because the database has already been told that there will be only one record for any given combination of A and B.
    Similarly, if you try to update the second record from A = 2 to A = 1, the end result would be A =1 and B = 1. There is already a record with that set of values and this will result in a violation of the uniqueness. So, this update will also be disallowed. On the other hand, if you try to update B to some value, say 3, there is no problem in doing so.
    For convenience, you can imagine an UPDATE operation to be equivalent to DELETE + INSERT operation, though it doesn't necessarily work the same way internally.
    I hope I was clear enough.

  • Losing Cached Objects

    I'm having a problem with losing Cached references to JNDI Objects(Home Interfaces,
    JMS Connection Factories, Data Sources, etc.).
    I have singleton(Let's call it Cache) that stores the cached objects.
    A client calls Cache.lookup passing in the JNDI name.
    If the object isn't cached then the Cache looks it up via the JNDI context, otherwise
    it returns the cached reference.
    My problem is that once it returns the cached version, the client receives a null
    object.
    Can anyone help?
    - Anuj

    It sounds to me as if your cache isn't working and its not really related to
    JNDI?
    After the first call, the cahce should be storing the object and not using
    JNDI any more, right?
    Have you tried stepping through your cache code with a debugger?
    "Anuj Mehta" <[email protected]> wrote in message
    news:[email protected]..
    >
    I'm having a problem with losing Cached references to JNDI Objects(HomeInterfaces,
    JMS Connection Factories, Data Sources, etc.).
    I have singleton(Let's call it Cache) that stores the cached objects.
    A client calls Cache.lookup passing in the JNDI name.
    If the object isn't cached then the Cache looks it up via the JNDIcontext, otherwise
    it returns the cached reference.
    My problem is that once it returns the cached version, the client receivesa null
    object.
    Can anyone help?
    - Anuj

  • Error writing data to client-side row cache.  URGENT!!!

    Hi everyone
    I had had this error for 3 weeks and I don't know what am I doing wrong?
    I have an Oracle Database. and when I Run my project from JSC I get this error:.
    Description: An unhandled exception occurred during the execution of the web application. Please review the following stack trace for more information regarding the error.
    Exception Details: javax.faces.FacesException
    java.sql.SQLException: [sunm][Oracle JDBC Driver]Error writing data to client-side row cache.
    Possible Source of Error:
    Class Name: com.sun.jsfcl.data.RowSetDataModel
    File Name: RowSetDataModel.java
    Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.
    I uninstalled and installed the JSC and the first time that I run my project worked fine, but just that time, because then the error appeared again.
    What can I do????
    Thanks!!!
    Wendy,
    Costa Rica

    Duplicate thread of
    http://swforum.sun.com/jive/thread.jspa?threadID=53424&tstart=0

  • Cannot insert duplicate key row in object 'dbo.NavNodes' with unique index 'NavNodes_PK' when trying to update quick launch menu sharepoint 2013

    When we try to deploy a wsp to sharepoint containing code to generate quick launch menu we get the following error messages when running the last enable-spfeature command in powershell. The same code is working in the development environment, but when we
    deploy to a test server the following error occurs:
    Add-SPSolution "C:\temp\ImpactSharePoint.wsp"
    Install-SPSolution -Identity impactsharepoint.wsp  -GACDeployment
    Enable-SPFeature impactsharepoint_branding -url http://im-sp1/sites/impact/
    Enable-SPFeature impactsharepoint_pages -url http://im-sp1/sites/impact/
    From UlsViewer.exe:
    03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
    0x11F4 SharePoint Foundation
    Database 880i
    High System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.NavNodes' with unique index 'NavNodes_PK'. The duplicate key value is (6323df8a-5c57-4d3e-a477-09aa8b66100a, 7ae114df-9d52-4b08-affa-8c544cbc27b6,
    1000).  The statement has been terminated.     at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)     at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
    stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)     at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj,
    Boolean& dataReady)     at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()     at System.Data.SqlClient.SqlDataReader.get_MetaData()     at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior
    runBehavior, String resetOptionsString)     at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)  
      at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)     at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
    cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)     at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)     at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
    behavior)     at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock)  ClientConnectionId:2bb4004c-aa75-470e-b11e-dbf1c476aaed
    5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
    03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
    0x11F4 SharePoint Foundation
    Database 880k
    High at Microsoft.SharePoint.SPSqlClient.ExecuteQueryInternal(Boolean retryfordeadlock)     at Microsoft.SharePoint.SPSqlClient.ExecuteQuery(Boolean retryfordeadlock)     at Microsoft.SharePoint.Library.SPRequestInternalClass.AddNavigationNode(String
    bstrUrl, String bstrName, String bstrNameResource, String bstrNodeUrl, Int32 lType, Int32 lParentId, Int32 lPreviousSiblingId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav, String& pbstrDateModified)     at Microsoft.SharePoint.Library.SPRequestInternalClass.AddNavigationNode(String
    bstrUrl, String bstrName, String bstrNameResource, String bstrNodeUrl, Int32 lType, Int32 lParentId, Int32 lPreviousSiblingId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav, String& pbstrDateModified)     at Microsoft.SharePoint.Library.SPRequest.AddNavigationNode(String
    bstrUrl, String bstrName, String bstrNameResource, String bstrNodeUrl, Int32 lType, Int32 lParentId, Int32 lPreviousSiblingId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav, String& pbstrDateModified)     at Microsoft.SharePoint.Navigation.SPNavigationNode.AddInternal(Int32
    iPreviousNodeId, Int32 iParentId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav)     at Microsoft.SharePoint.Navigation.SPNavigationNodeCollection.AddInternal(SPNavigationNode node, Int32 iPreviousNodeId)     at ImpactSharePoint.ConfigureSharePointInstance.NavigationConfig.<ConfigureQuickLaunchBar>b__0()
        at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass5.<RunWithElevatedPrivileges>b__3()     at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)     at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback
    secureCode, Object param)     at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)     at ImpactSharePoint.ConfigureSharePointInstance.NavigationConfig.ConfigureQuickLaunchBar()     at ImpactSharePoint.Features.Pages.PagesEventReceiver.FeatureActivated(SPFeatureReceiverProperties
    properties)     at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce)     at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, SPFeatureActivateFlags
    activateFlags, Boolean fForce)     at Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly)
        at Microsoft.SharePoint.SPFeature.ActivateDeactivateFeatureAtWeb(Boolean fActivate, Boolean fEnsure, Guid featid, SPFeatureDefinition featdef, String urlScope, String sProperties, Boolean fForce)     at Microsoft.SharePoint.SPFeature.ActivateDeactivateFeatureAtScope(Boolean
    fActivate, Guid featid, SPFeatureDefinition featdef, String urlScope, Boolean fForce)     at Microsoft.SharePoint.PowerShell.SPCmdletEnableFeature.UpdateDataObject()     at Microsoft.SharePoint.PowerShell.SPCmdlet.ProcessRecord()  
      at System.Management.Automation.CommandProcessor.ProcessRecord()     at System.Management.Automation.CommandProcessorBase.DoExecute()     at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object
    input, Hashtable errorResults, Boolean enumerate)     at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][]
    commandRedirections, FunctionContext funcContext)     at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)     at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
    frame)     at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)     at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)     at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0
    arg0)     at System.Management.Automation.DlrScriptCommandProcessor.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)     at System.Management.Automation.CommandProcessorBase.DoComplete()     at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(CommandProcessorBase
    commandRequestingUpstreamCommandsToStop)     at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)     at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()
        at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc()     at System.Management.Automation.Runspaces.PipelineThread.WorkerProc()     at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,
    ContextCallback callback, Object state, Boolean preserveSyncCtx)     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)     at System.Threading.ExecutionContext.Run(ExecutionContext
    executionContext, ContextCallback callback, Object state)     at System.Threading.ThreadHelper.ThreadStart()
    5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
    03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
    0x11F4 SharePoint Foundation
    Database 880j
    High SqlError: 'Cannot insert duplicate key row in object 'dbo.NavNodes' with unique index 'NavNodes_PK'. The duplicate key value is (6323df8a-5c57-4d3e-a477-09aa8b66100a, 7ae114df-9d52-4b08-affa-8c544cbc27b6, 1000).'
       Source: '.Net SqlClient Data Provider' Number: 2601 State: 1 Class: 14 Procedure: 'proc_NavStructAddNewNode' LineNumber: 92 Server: 'IMPACTCLUSTER\IMPACTDB'
    5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
    03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
    0x11F4 SharePoint Foundation
    Database 880j
    High SqlError: 'The statement has been terminated.'    Source: '.Net SqlClient Data Provider' Number: 3621 State: 0 Class: 0 Procedure: 'proc_NavStructAddNewNode' LineNumber: 92 Server: 'IMPACTCLUSTER\IMPACTDB'
    5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
    03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
    0x11F4 SharePoint Foundation
    Database tzku
    High ConnectionString: 'Data Source=IMPACTCLUSTER\IMPACTDB;Initial Catalog=WSS_Content;Integrated Security=True;Enlist=False;Pooling=True;Min Pool Size=0;Max Pool Size=100;Connect Timeout=15;Application Name=SharePoint[powershell][1][WSS_Content]'
       Partition: 6323df8a-5c57-4d3e-a477-09aa8b66100a ConnectionState: Closed ConnectionTimeout: 15
    5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
    03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
    0x11F4 SharePoint Foundation
    Database tzkv
    High SqlCommand: 'BEGIN TRAN DECLARE @abort int SET @abort = 0 DECLARE @EidBase int,@EidHome int SET @EidBase = 0 SET @EidHome = NULL IF @abort = 0 BEGIN EXEC @abort = proc_NavStructAllocateEidBlockWebId @wssp0, @wssp1,
    @wssp2, @wssp3, @EidBase OUTPUT SELECT @wssp4 = @EidBase, @wssp5 = @abort END IF @abort = 0 BEGIN EXEC @abort = proc_NavStructAddNewNodeByUrl '6323DF8A-5C57-4D3E-A477-09AA8B66100A','7AE114DF-9D52-4B08-AFFA-8C544CBC27B6',1,2072,-1,0,N'sites/impact/default.aspx',N'PersonSøk',N'PersonSøk',NULL,0,0,0,NULL,@EidBase,@EidHome
    OUTPUT SELECT @wssp6 = @abort END IF @abort = 0 BEGIN EXEC proc_NavStructLogChangesAndUpdateSiteChangedTime @wssp7, @wssp8, NULL END IF @abort <> 0 BEGIN ROLLBACK TRAN END ELSE BEGIN COMMIT TRAN END IF @abort = 0  BEGIN EXEC proc_UpdateDiskUsed
    '6323DF8A-5C57-4D3E-A477-09AA8B66100A' END '     CommandType: Text CommandTimeout: 0     Parameter: '@wssp0' Type: UniqueIdentifier Size: 0 Direction: Input Value: '6323df8a-5c57-4d3e-a477-09aa8b66100a'     Parameter: '@wssp1'
    Type: UniqueIdentifier Size: 0 Direction: Input Value: '7ae114df-9d52-4b08-affa-8c544cbc27b6'     Parameter: '@wssp2' Type: Int Size: 0 Direction: Input Value: '1'     Parameter: '@wssp3' Type: Int Size: 0 Direction: Input Value: '2072'
        Parameter: '@wssp4' Type: Int Size: 0 Direction: Output Value: '2072'     Parameter: '@wssp5' Type: Int Size: 0 Direction: Output Value: '0'     Parameter: '@wssp6' Type: Int Size: 0 Direction: Output Value: '10006'  
      Parameter: '@wssp7' Type: UniqueIdentifier Size: 0 Direction: Input Value: '6323df8a-5c57-4d3e-a477-09aa8b66100a'     Parameter: '@wssp8' Type: UniqueIdentifier Size: 0 Direction: Input Value: '7ae114df-9d52-4b08-affa-8c544cbc27b6'
    5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
    03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
    0x11F4 SharePoint Foundation
    Database aek90
    High SecurityOnOperationCheck = True
    5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
    03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
    0x11F4 SharePoint Foundation
    Database d0d6
    High System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.NavNodes' with unique index 'NavNodes_PK'. The duplicate key value is (6323df8a-5c57-4d3e-a477-09aa8b66100a, 7ae114df-9d52-4b08-affa-8c544cbc27b6,
    1000).  The statement has been terminated.     at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)     at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
    stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)     at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj,
    Boolean& dataReady)     at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()     at System.Data.SqlClient.SqlDataReader.get_MetaData()     at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior
    runBehavior, String resetOptionsString)     at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)  
      at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)     at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
    cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)     at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)     at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
    behavior)     at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock)     at Microsoft.SharePoint.SPSqlClient.ExecuteQueryInternal(Boolean
    retryfordeadlock)     at Microsoft.SharePoint.SPSqlClient.ExecuteQuery(Boolean retryfordeadlock)  ClientConnectionId:2bb4004c-aa75-470e-b11e-dbf1c476aaed
    5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
    03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
    0x11F4 SharePoint Foundation
    Database ad194
    High ExecuteQuery failed with original error 0x80131904
    5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
    03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
    0x11F4 SharePoint Foundation
    Database 8z23
    Unexpected Unexpected query execution failure in navigation query, HResult -2146232060. Query text (if available): "BEGIN TRAN DECLARE @abort int SET @abort = 0 DECLARE @EidBase int,@EidHome int SET @EidBase
    = 0 SET @EidHome = NULL IF @abort = 0 BEGIN EXEC @abort = proc_NavStructAllocateEidBlockWebId @wssp0, @wssp1, @wssp2, @wssp3, @EidBase OUTPUT SELECT @wssp4 = @EidBase, @wssp5 = @abort END IF @abort = 0 BEGIN EXEC @abort = proc_NavStructAddNewNodeByUrl '6323DF8A-5C57-4D3E-A477-09AA8B66100A','7AE114DF-9D52-4B08-AFFA-8C544CBC27B6',1,2072,-1,0,N'sites/impact/default.aspx',N'PersonSøk',N'PersonSøk',NULL,0,0,0,NULL,@EidBase,@EidHome
    OUTPUT SELECT @wssp6 = @abort END IF @abort = 0 BEGIN EXEC proc_NavStructLogChangesAndUpdateSiteChangedTime @wssp7, @wssp8, NULL END IF @abort <> 0 BEGIN ROLLBACK TRAN END ELSE BEGIN COMMIT TRAN END IF @abort = 0  BEGIN EXEC proc_UpdateDiskUsed
    '6323DF8A-5C57-4D3E-A477-09AA8B66100A' END "
    5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
    03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
    0x11F4 SharePoint Foundation
    General 8kh7
    High <nativehr>0x8107140d</nativehr><nativestack></nativestack>An unexpected error occurred while manipulating the navigational structure of this Web.
    5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
    03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
    0x11F4 SharePoint Foundation
    General aix9j
    High SPRequest.AddNavigationNode: UserPrincipalName=i:0).w|s-1-5-21-2030300366-1823906440-2562684930-2106, AppPrincipalName= ,bstrUrl=http://im-sp1/sites/impact ,bstrName=PersonSøk ,bstrNameResource=<null> ,bstrNodeUrl=/sites/impact/default.aspx
    ,lType=0 ,lParentId=2072 ,lPreviousSiblingId=-1 ,bAddToQuickLaunch=False ,bAddToSearchNav=False
    5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
    03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
    0x11F4 SharePoint Foundation
    General ai1wu
    Medium System.Runtime.InteropServices.COMException: <nativehr>0x8107140d</nativehr><nativestack></nativestack>An unexpected error occurred while manipulating the navigational structure of this
    Web., StackTrace:    at Microsoft.SharePoint.Navigation.SPNavigationNode.AddInternal(Int32 iPreviousNodeId, Int32 iParentId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav)     at Microsoft.SharePoint.Navigation.SPNavigationNodeCollection.AddInternal(SPNavigationNode
    node, Int32 iPreviousNodeId)     at ImpactSharePoint.ConfigureSharePointInstance.NavigationConfig.<ConfigureQuickLaunchBar>b__0()     at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass5.<RunWithElevatedPrivileges>b__3()
        at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)     at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)     at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated
    secureCode)     at ImpactSharePoint.ConfigureSharePointInstance.NavigationConfig.ConfigureQuickLaunchBar()     at ImpactSharePoint.Features.Pages.PagesEventReceiver.FeatureActivated(SPFeatureReceiverProperties properties)    
    at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce)     at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, SPFeatureActivateFlags activateFlags, Boolean
    fForce)     at Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly)     at Microsoft.SharePoint.SPFeature.ActivateDeactivateFeatureAtWeb(Boolean
    fActivate, Boolean fEnsure, Guid featid, SPFeatureDefinition featdef, String urlScope, String sProperties, Boolean fForce)     at Microsoft.SharePoint.SPFeature.ActivateDeactivateFeatureAtScope(Boolean fActivate, Guid featid, SPFeatureDefinition
    featdef, String urlScope, Boolean fForce)     at Microsoft.SharePoint.PowerShell.SPCmdletEnableFeature.UpdateDataObject()     at Microsoft.SharePoint.PowerShell.SPCmdlet.ProcessRecord()     at System.Management.Automation.CommandProcessor.ProcessRecord()
        at System.Management.Automation.CommandProcessorBase.DoExecute()     at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)     at System.Management.Automation.PipelineOps.InvokePipeline(Object
    input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)     at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame
    frame)     at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)     at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)    
    at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)     at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)     at System.Management.Automation.DlrScriptCommandProcessor.RunClause(Action`1
    clause, Object dollarUnderbar, Object inputToProcess)     at System.Management.Automation.CommandProcessorBase.DoComplete()     at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(CommandProcessorBase commandRequestingUpstreamCommandsToStop)
        at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)     at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()    
    at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc()     at System.Management.Automation.Runspaces.PipelineThread.WorkerProc()     at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,
    ContextCallback callback, Object state, Boolean preserveSyncCtx)     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)     at System.Threading.ExecutionContext.Run(ExecutionContext
    executionContext, ContextCallback callback, Object state)     at System.Threading.ThreadHelper.ThreadStart()
    5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
    03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
    0x11F4 SharePoint Foundation
    Feature Infrastructure 88jm
    High Feature receiver assembly 'ImpactSharePoint, Version=1.1.0.0, Culture=neutral, PublicKeyToken=3f4d824fecc0071e', class 'ImpactSharePoint.Features.Pages.PagesEventReceiver', method 'FeatureActivated' for feature
    'd8aabd95-076a-4650-a8a6-0aa5bd8ac8d1' threw an exception: Microsoft.SharePoint.SPException: An unexpected error occurred while manipulating the navigational structure of this Web. ---> System.Runtime.InteropServices.COMException: <nativehr>0x8107140d</nativehr><nativestack></nativestack>An
    unexpected error occurred while manipulating the navigational structure of this Web.     at Microsoft.SharePoint.Library.SPRequestInternalClass.AddNavigationNode(String bstrUrl, String bstrName, String bstrNameResource, String bstrNodeUrl, Int32
    lType, Int32 lParentId, Int32 lPreviousSiblingId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav, String& pbstrDateModified)     at Microsoft.SharePoint.Library.SPRequest.AddNavigationNode(String bstrUrl, String bstrName, String bstrNameResource,
    String bstrNodeUrl, Int32 lType, Int32 lParentId, Int32 lPreviousSiblingId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav, String& pbstrDateModified)     --- End of inner exception stack trace ---     at Microsoft.SharePoint.SPGlobal.HandleComException(COMException
    comEx)     at Microsoft.SharePoint.Library.SPRequest.AddNavigationNode(String bstrUrl, String bstrName, String bstrNameResource, String bstrNodeUrl, Int32 lType, Int32 lParentId, Int32 lPreviousSiblingId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav,
    String& pbstrDateModified)     at Microsoft.SharePoint.Navigation.SPNavigationNode.AddInternal(Int32 iPreviousNodeId, Int32 iParentId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav)     at Microsoft.SharePoint.Navigation.SPNavigationNodeCollection.AddInternal(SPNavigationNode
    node, Int32 iPreviousNodeId)     at ImpactSharePoint.ConfigureSharePointInstance.NavigationConfig.<ConfigureQuickLaunchBar>b__0()     at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass5.<RunWithElevatedPrivileges>b__3()
        at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)     at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)     at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated
    secureCode)     at ImpactSharePoint.ConfigureSharePointInstance.NavigationConfig.ConfigureQuickLaunchBar()     at ImpactSharePoint.Features.Pages.PagesEventReceiver.FeatureActivated(SPFeatureReceiverProperties properties)    
    at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce)
    5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
    The code:
    using System.Diagnostics;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Navigation;
    namespace ImpactSharePoint.ConfigureSharePointInstance
        public class NavigationConfig
            public void ConfigureQuickLaunchBar(SPWeb web)
                SPSecurity.RunWithElevatedPrivileges(delegate
                    //Delete All Links
                    web.AllowUnsafeUpdates = true;
                    for (int i = web.Navigation.QuickLaunch.Count - 1; i > -1; i--)
                        web.Navigation.QuickLaunch[i].Delete(); // -> Deleting all the links in quick launch
                    web.QuickLaunchEnabled = true;
                    EventLog.WriteEntry("Sharepointfeature","Starter");
                    //Adding Links
                    SPNavigationNodeCollection nodes = web.Navigation.QuickLaunch;
                    var sokNode = new SPNavigationNode("Søk", null, false);
                    nodes.AddAsFirst(sokNode);
                    sokNode.Update();
                    EventLog.WriteEntry("Sharepointfeature", "Lagt til søk");
                    // Personsøk
                    var personSokNode = new SPNavigationNode("Deltakere", "/sites/impact/default.aspx", false); //TODO: fix hardkoding
                    sokNode.Children.AddAsFirst(personSokNode);
                    personSokNode.Update();
                    EventLog.WriteEntry("Sharepointfeature", "Lagt til node personsøk");
                    // Udb-søk
                    var udbSokNode = new SPNavigationNode("UDB-Søk", "/sites/impact/udbsok.aspx", false); //TODO: fix hardkoding
                    sokNode.Children.AddAsLast(udbSokNode);
                    udbSokNode.Update();
                    EventLog.WriteEntry("Sharepointfeature", "Lagt til node udbsøk");
                    // Kommuner
                    var kommuneNode = new SPNavigationNode("Kommuner", "/sites/impact/kommunesearch.aspx", false); //TODO: fix hardkoding
                    sokNode.Children.AddAsFirst(kommuneNode);
                    kommuneNode.Update();
                    EventLog.WriteEntry("Sharepointfeature", "Lagt til node kommunesøk");   
                    // Organisasjoner
                    var virksomhetNode = new SPNavigationNode("Organisasjoner", "/sites/impact/virksomhetsearch.aspx", false); //TODO: fix hardkoding
                    sokNode.Children.AddAsFirst(virksomhetNode);
                    virksomhetNode.Update();
                    EventLog.WriteEntry("Sharepointfeature", "Lagt til node kommunesøk");
                    // NIR
                    var nirNode = new SPNavigationNode("Nir", null, false); //TODO: fix hardkoding
                    nodes.AddAsLast(nirNode);
                    nirNode.Update();
                    EventLog.WriteEntry("Sharepointfeature", "Lagt til node Nir");
                    // Tilskudd
                    var tilskuddNode = new SPNavigationNode("Tilskudd", "/sites/impact/", false);
                    nodes.AddAsLast(tilskuddNode);
                    tilskuddNode.Update();
                    EventLog.WriteEntry("Sharepointfeature", "Lagt til node Tilskudd");
                    // Kjøringsoversikt
                    var showkjoringerNode = new SPNavigationNode("Kjøringsoversikt", "/sites/dev/kjoringoversikt.aspx", false); //TODO: fix hardkoding
                    tilskuddNode.Children.AddAsFirst(showkjoringerNode);
                    showkjoringerNode.Update();
                    EventLog.WriteEntry("Sharepointfeature", "Lagt til node showkjoringerNode");
                    web.Update();
                    EventLog.WriteEntry("Sharepointfeature", "Etter update");
                    //Setting homepage
                    SPFolder folder = web.RootFolder;
                    folder.WelcomePage = "default.aspx";
                    folder.Update();
                    EventLog.WriteEntry("Sharepointfeature", "Etter homepage");
                    web.AllowUnsafeUpdates = false;

    i think you need to debug your code, lookalike the values you trying insert already exist in the database.
    these two IDs (6323df8a-5c57-4d3e-a477-09aa8b66100a, 7ae114df-9d52-4b08-affa-8c544cbc27b6).
    i would try to run the select command against the content db.
    SELECT TOP *  FROM [DB Name].[dbo].[NavNodes] where id = '6323df8a-5c57-4d3e-a477-09aa8b66100a'
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

Maybe you are looking for