Parallel query worker thread was involved in a deadlock

Hi,
    We are getting deadlock issue in MSSQL 2012 enterprise edition. By enabling the trace we could find the MORE number messages as below: 
"parallel query worker thread was involved in a deadlock"
Along with this there are some other entries with dead lock information ( chain, graph) . 
Please suggest.
Thank you 

OP, I think that article posted by Saeid is exactly about your situation, although SQL2012 might have changed the message slightly.
What the article says is bad news - you have done nothing wrong, yet SQL Server is messed up.  The only "fix" recommended is eliminating parallelism by using a hint "option (maxdop 1)" at the end of your query.  This should do the trick, but may
run more slowly.
You can try to reduce the odds of it happening by adding indexes.  Actually, ANY change to your plan or data model may make just enough changes to come up with another plan that does NOT get these self-deadlocks.  Any query that is more efficient,
should reduce the odds of a deadlock.
You can also try to analyze the deadlock as you would any deadlock, it may suggest another way to write the query. 
Josh

Similar Messages

  • Partitioning For Optimal Parallel Query Execution

    Hi All,
    We are trying to design an architecture that benefits from partitioning and parallel query to obtain the best query response times for our system.
    Let me start by describing the main table which has five columns:
    Columns:
    1) DocId ------- Numeric Primary Key Constraint (Unique)
    2) Text ------- CLOB of XML Content
    3) SCode ------- Varchar 12 ( service code Can be one of 200 values)
    4) A_Date ------- Oracle Date ( The arrival date )
    5) A_Month ------- Numeric partition key, the month number (1-12)
    We insert 100,000 records daily so a month of data will contain 3,000,000 rows. The Text varies from 4k to 200k bytes and on average is around 30k bytes per document. A_Date is obtained when the C++ application receives a client connection. After document transmission is complete the DocId is obtained from an Oracle sequence. It is true that A_Date and DocId increase together. However because of varying document sizes and transmission rates, there is no guarantee that consistent order between the two columns exists.
    For Example: If time (t) increases and the connection times are: t1, t2, t3, t4 and the document at t2 took long to transmit, we can have:
    A_Date -------- DocId (From Oracle Sequence)
    t2 -------------- 1004
    t4 -------------- 1003
    t3 -------------- 1002
    t1 -------------- 1001
    A_Month is simply the month number (1-12) extracted from the transmission entry timestamp. It is also our Partition Key (see below). When the year wraps around from 2006 to 2007, data for January will simpy fall into the 1st partition bucket, and so on..
    QUERY NEEDS: Our queries are centered around a DateTime interval Where the left endpoint is current day/time. They can query the current day, current to 1 month back, current to 2 months back, .. current to 15 months back. We MUST RETURN a list of DocId's sorted in DESCENDING ORDER for screen display purposes.
    In General we need to return sub-second for the 1st month. As we query further back in time longer response times between 1 and 4 seconds are acceptable.
    PARTITIONING AND INDEXES:
    The table is partitioned by A_Month as shown below:
    Create Table IndexTable
    PARTITION BY RANGE (A_Month)
    ( PARTITION p1 VALUES LESS THAN 1.1 ...
    PARTITION p2 VALUES LESS THAN 2.1 ...
    PARTITION p3 vALUES LESS THAN 3.1 ...
    There are GLOBAL INDEXES on DocId, Text(Domain Index), and SCode.
    A_Date is a LOCAL INDEX.
    QUERY STRUCTURE:
    My Query structure looks like this (for a 2 month query):
    SELECT DocId from IndexTable WHERE
    Contains (Text, 'BUSH and EARNINGS') > 0 AND
    SCode in ('S1', 'S2', 'S3', 'S4') AND
    A_Date Between '2006-01-15 11:00:00' AND '2006-03-15 11:00:00'
    Order By DocId DESC;
    QUESTIONS (THERE ARE THREE)
    #### QUESTION 1 ####
    As I examine various explain plans, the PSTART and PSTOP do not reflect consistency with my A_Date range. It seems to always display:
    PStart PStop
    RowId RowId
    no matter what my A_Date range is.. I don't see it pruning my partitions. I cannot find documentation as to what RowId means or how it affects the optimizer's plan.
    #### QUESTION 2 ####
    I have tried parallelization hints on the table and indexes such as
    /*+ PARALLEL( IndexTable, 4) */ and on the A_Date index
    /*+ PARALLEL_INDEX( IndexTable, A_Date_Index, 4) */.
    I can't really tell if the parallel hints make a difference.
    However, the FIRST_ROWS hint makes a big difference if I nest the query inside a rownum clause as:
    SELECT * from
    ( Select /+* first_rows */ ... WHERE CONTAINS... > 0 AND... )
    Where ROWNUM <=20;
    #### QUESTION 3 ####
    I'm running close to the latest RedHat Linux and Oracle 10g2 and I have read about Parallel Slave Processes in Tom Kyte's Expert Oracle Architecture book in which he says you should see processes like:
    ora...p000..
    ora...p001..
    ora...pnnn..
    Which are the parallel slave processes. I have NEVER seen any oracle processes numbered as such running on my system when I run test queries. I have seen some q_ processes and others, but not the pnnn processes..
    Can I benefit from parallel query without ever seeing these processes??
    I Greatly Appreciate Any Advice To Any Of These Questions..
    Joe

    Well I can tell you this much. You will never get partition pruning if you don't have the partition key in the where clause.
    I'm not sure about the parallel query. There was a time that this wasn't supported with Text indexes, but not sure if that still applies today.
    In theory there are two levels of partitioning that can be defined that you may want to test out.
    1st, range partition the base table and create a partitioned text index based on that. This is what you are currently doing.
    2nd, in the storage preference for the $I table specify a range or hash partition (I've never tried this, but in theory it should work) on the token_text column. Try this out and see if it works.

  • Question about Parallel Query

    Currently running Oracle 8.1.7.3 on 32 CPU HP box. I'm doing some data analysis and ran in to some inconsistencies on what columns parallel query works on. For most columns it kicks off all the threads(ora_pxxx) but on a few of the columns, it will only run 1 thread. These queries run full table scans.
    Example SQL:
    Select /* parallel (column1, 10) */ column1
    from table1
    I can't seem to find much documentation on parallel queries.

    sorry. correction on the SQL format:
    Select /*+ parallel(tb1, 20)*/ column1
    from table1 tb1

  • Data Driven Subscriptions Error - the query processor could not start the necessary thread resources for parallel query execution

    Hi,
    We are getting the following error when certain data driven subscriptions are fired off: "the query processor could not start the necessary thread resources for parallel query execution".  I've read other posts that have the same error, and
    the solution usually involves adjusting MaxDOP to limit the number of queries that are fired off in parallel.  
    Unfortunately, we cannot change this setting on our server for performance reasons (outside of data driven subscriptions, it negatively impacts our ETL processing times).  We tried putting query hints like "OPTION (MAXDOP 2);" in the reports
    that are causing the error, but it did not resolve the problem.
    Are there any settings within Reporting Services that can be adjusted to limit the number of subscriptions that get fired off in parallel?
    Any help is appreciated - thanks!

    Yes, that is correct.  It's a painful problem, because you don't know which specific subscription failed. For example, we have a data driven subscription that sends out about 800 emails. Lately, we've been having a handful of them fail. You don't know
    which ones out of the 800 failed though, even from the RS log files - all it tells you is that "the
    query processor could not start the necessary thread resources for parallel query execution".
    Thanks, I'll try changing <MaxQueueThreads> and will let you know if it works.
    On a side note: I've noticed that it is only reports with cascading parameters (ex. where parameter 2 is dependent on the selection from parameter 1) that get this error message...

  • SUM on XMLTable Column Causes Parallel Query to Not Work

    I have the following query that creates an XMLTable out of an xml document and is then used to aggregate data from the document.
    My problem is that when I try to SUM the XMLTable return column I am unable to use Parallel processing, yet when I remove the SUM from the return column Parallel processing works as expected. Can anyone shed some light on what the problem may be?
    One note: I am applying a larger query than the following to hundreds of millions of records so parallel processing is definitely desired/needed.
    The Query:
    SELECT     /*+ full(n) parallel(n,8) */
         x451s30 as "XYZ"
         --SUM(x451s30) as "XYZ"
    FROM NADS n,
         metas met,
         XMLTable(XMLNAMESPACES('http://fbi.gov/cjis/N-DEx' as "p1"),
              '/*' PASSING n.DATA_INTERNAL
              COLUMNS
                   x451s30 NUMBER PATH 'count(/p1:DataItem/Person[Role = "Arrest Subject"]/Name/LastName)') T7
    WHERE STATUS_ID=1
    AND NAT_SOURCE_ID=0
    AND OWNING_ORI like 'ABC123'
    and n.id=met.nads_id and met.type_id=1 and met.val='Arrest Report';
    Explain Plan without SUM
    PLAN_TABLE_OUTPUT
    Plan hash value: 2296199318
    | Id | Operation               | Name               | Rows | Bytes | Cost (%CPU)| Time     | Pstart| Pstop | TQ |IN-OUT| PQ Distrib |
    | 0 | SELECT STATEMENT          |               | 1 | 130 | 3713 (0)| 00:00:45 |     |     |     |     |     |
    | 1 | SORT AGGREGATE           |               | 1 | 2 |     |      |     |     |     |     |     |
    | 2 | XPATH EVALUATION          |               |     |     |     |      |     |     |     |     |     |
    | 3 | PX COORDINATOR           |               |     |     |     |      |     |     |     |     |     |
    | 4 | PX SEND QC (RANDOM)          | :TQ10000          | 1 | 130 | 3713 (0)| 00:00:45 |     |     | Q1,00 | P->S | QC (RAND) |
    | 5 | NESTED LOOPS           |               | 1 | 130 | 3713 (0)| 00:00:45 |     |     | Q1,00 | PCWP |     |
    | 6 | NESTED LOOPS          |               | 1 | 128 | 3683 (0)| 00:00:45 |     |     | Q1,00 | PCWP |     |
    | 7 | PX BLOCK ITERATOR          |               | 1 | 108 | 3683 (0)| 00:00:45 | 1 | 63 | Q1,00 | PCWC |     |
    |* 8 | TABLE ACCESS FULL      | NADS               | 1 | 108 | 3683 (0)| 00:00:45 | 1 | 63 | Q1,00 | PCWP |     |
    |* 9 | TABLE ACCESS BY INDEX ROWID| METAS           | 1 | 20 | 2 (0)| 00:00:01 |     |     | Q1,00 | PCWP |     |
    |* 10 | INDEX UNIQUE SCAN      | MET_NADS_ID_TYPE_ID_UK | 1 |     | 1 (0)| 00:00:01 |     |     | Q1,00 | PCWP |     |
    | 11 | XPATH EVALUATION          |               |     |     |     |      |     |     | Q1,00 | PCWP |     |
    Predicate Information (identified by operation id):
    8 - filter("OWNING_ORI"='ABC123' AND "NAT_SOURCE_ID"=0 AND "STATUS_ID"=1)
    9 - filter("MET"."VAL"='Arrest Report')
    10 - access("N"."ID"="MET"."NADS_ID" AND "MET"."TYPE_ID"=1)
    Note
    - dynamic sampling used for this statement (level=4)
    29 rows selected.
    Expalin Plan with SUM
    PLAN_TABLE_OUTPUT
    Plan hash value: 1527372262
    | Id | Operation               | Name               | Rows | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    | 0 | SELECT STATEMENT          |               | 1 | 130 | 3713 (0)| 00:00:45 |     |     |
    | 1 | SORT AGGREGATE           |               | 1 | 2 |     |      |     |     |
    | 2 | XPATH EVALUATION          |               |     |     |     |      |     |     |
    | 3 | SORT AGGREGATE           |               | 1 | 130 |     |      |     |     |
    | 4 | SORT AGGREGATE          |               | 1 | 130 |     |      |     |     |
    | 5 | NESTED LOOPS           |               | 1 | 130 | 3713 (0)| 00:00:45 |     |     |
    | 6 | NESTED LOOPS          |               | 1 | 128 | 3683 (0)| 00:00:45 |     |     |
    | 7 | PARTITION LIST ALL      |               | 1 | 108 | 3683 (0)| 00:00:45 | 1 | 63 |
    |* 8 | TABLE ACCESS FULL      | NADS               | 1 | 108 | 3683 (0)| 00:00:45 | 1 | 63 |
    |* 9 | TABLE ACCESS BY INDEX ROWID| METAS           | 1 | 20 | 2 (0)| 00:00:01 |     |     |
    |* 10 | INDEX UNIQUE SCAN      | MET_NADS_ID_TYPE_ID_UK | 1 |     | 1 (0)| 00:00:01 |     |     |
    | 11 | XPATH EVALUATION          |               |     |     |     |      |     |     |
    Predicate Information (identified by operation id):
    8 - filter("OWNING_ORI"='ABC123' AND "NAT_SOURCE_ID"=0 AND "STATUS_ID"=1)
    9 - filter("MET"."VAL"='Arrest Report')
    10 - access("N"."ID"="MET"."NADS_ID" AND "MET"."TYPE_ID"=1)
    Note
    - dynamic sampling used for this statement (level=4)
    29 rows selected.
    Edited by: drad on May 9, 2012 3:31 AM

    After adding the no_xml_query_rewrite hint I get the PX Coordinator back and parallel processing is enabled; however, this comes at a significant performance impact (query takes 2-3 times longer). It currently appears that Parallel is not worth the cost of loosing the xml query rewrite unless a different indexing scheme can make up the difference.
    Apparently the issue was the optimizer rewriting the xml query in the XMLTable which was causing Parallel processing to not be used.
    For those interested, the full query is now as follows:
    SELECT /*+ full(n) parallel(n,8) no_xml_query_rewrite */
         COUNT(*) as TOTAL_RECORDS,
         SUM(T7.x422s1) AS ArrestsDateEX,
         SUM(T7.x423s2) AS ArrNarAccDesEX,
         SUM(T7.x424s3) AS WitNarAccDesEX,
         SUM(T7.x425s4) AS WitFirstNameEX,
         SUM(T7.x426s5) AS WitFullNameEX,
         SUM(T7.x427s6) AS WitLastNameEX,
         SUM(T7.x428s7) AS WitMiddleNameEX,
         SUM(T7.x429s8) AS WitSexCodeEX,
         SUM(T7.x430s9) AS OfficerORIEX,
         SUM(T7.x431s10) AS OfficerFirstNameEX,
         SUM(T7.x432s11) AS OfficerFullNameEX,
         SUM(T7.x433s12) AS OfficerLastNameEX,
         SUM(T7.x434s13) AS OfficerMiddleNameEX,
         SUM(T7.x435s14) AS AreJuvDisCodeEX,
         SUM(T7.x436s15) AS AreUCRArrOffCodeEX,
         SUM(T7.x437s16) AS ArrAdtIndicatorEX,
         SUM(T7.x438s17) AS AreBirthDateEX,
         SUM(T7.x439s18) AS AreEthCodeEX,
         SUM(T7.x440s19) AS AreEyeColorEX,
         SUM(T7.x441s20) AS AreHairColorEX,
         SUM(T7.x442s21) AS ArrHeightEX,
         SUM(T7.x443s22) AS AreDvrLicNumEX,
         SUM(T7.x444s23) AS AreFBINumEX,
         SUM(T7.x445s24) AS ArePassportIDEX,
         SUM(T7.x446s25) AS AreSSNEX,
         SUM(T7.x447s26) AS AreStateIDEX,
         SUM(T7.x448s27) AS AreUSMSIDEX,
         SUM(T7.x449s28) AS AreFirstNameEX,
         SUM(T7.x450s29) AS AreFullNameEX,
         SUM(T7.x451s30) AS AreLastNameEX,
         SUM(T7.x452s31) AS AreMiddleNameEX,
         SUM(T7.x453s32) AS AreSexCodeEX,
         SUM(T7.x454s33) AS AreWeightEX,
         SUM(T7.x455s34) AS ArrLocCityEX,
         SUM(T7.x456s35) AS ArrLocCountryEX,
         SUM(T7.x457s36) AS ArrLocFullAddressEX,
         SUM(T7.x458s37) AS ArrLocFullStreetEX,
         SUM(T7.x459s38) AS ArrLocStateEX,
         SUM(T7.x460s39) AS ArrLocStreetNameEX,
         SUM(T7.x461s40) AS ArrLocStreetNumberEX,
         SUM(T7.x462s41) AS ArrLocStreetPostdirectionEX,
         SUM(T7.x463s42) AS ArrLocSteetPredirectionEX,
         SUM(T7.x464s43) AS ArrLocZipEX,
         SUM(T7.x465s44) AS OffCmpIndicatorEX,
         SUM(T7.x466s45) AS OffDesTextEX,
         SUM(T7.x467s46) AS OffDomVioIndicatorEX,
         SUM(T7.x468s47) AS OffFrcUseCodeEX,
         SUM(T7.x469s48) AS OffGangInvCodeEX,
         SUM(T7.x470s49) AS OffHmeInvIndicatorEX,
         SUM(T7.x471s50) AS OffIdtTftIndicatorEX,
         SUM(T7.x472s51) AS OffMOCCodeEX,
         SUM(T7.x473s52) AS OffOffCodeEX,
         SUM(T7.x474s53) AS OffTrrIndicatorEX,
         SUM(T7.x475s54) AS WrrAgencyEX,
         SUM(T7.x476s55) AS WrrAgencyORIEX,
         SUM(T7.x477s56) AS WrrCplOrgEX,
         SUM(T7.x478s57) AS WrrCplOrgORIEX,
         SUM(T7.x479s58) AS WrrCplPersonEX,
         SUM(T7.x480s59) AS WrrDesEX,
         SUM(T7.x481s60) AS WrrIssAuthorityEX,
         SUM(T7.x482s61) AS WrrIssAuthorityORIEX,
         SUM(T7.x483s62) AS WrrWrrDateEX
    FROM NADS n, metas met, meta_types mtt,
         XMLTable(XMLNAMESPACES('http://fbi.gov/cjis/N-DEx' as "p1"),
         '/p1:DataItem' PASSING n.DATA_INTERNAL
         COLUMNS
              x451s30 NUMBER PATH 'count(Person[Role="Arrest Subject"]/Name/LastName)',
              x452s31 NUMBER PATH 'count(Person[Role="Arrest Subject"]/Name/MiddleName)',
              x453s32 NUMBER PATH 'count(Person[Role="Arrest Subject"]/Sex)',
              x454s33 NUMBER PATH 'count(Person[Role="Arrest Subject"]/Weight[PointValue or MaximumValue or MinimumValue])',
              x455s34 NUMBER PATH 'count(Location[AssociationReference/AssociationType=Arrest/AssociationReference/AssociationType and AssociationReference/AssociationGUID=Arrest/AssociationReference/AssociationGUID]/City)',
              x456s35 NUMBER PATH 'count(Location[Country])',
              x457s36 NUMBER PATH 'count(Location/FullAddress)',
              x458s37 NUMBER PATH 'count(Location/FullStreetAddress)',
              x459s38 NUMBER PATH 'count(Location/State)',
              x460s39 NUMBER PATH 'count(Location/StreetName)',
              x461s40 NUMBER PATH 'count(Location/StreetNumber)',
              x462s41 NUMBER PATH 'count(Location/StreetPostdirection)',
              x463s42 NUMBER PATH 'count(Location/StreetPredirection)',
              x464s43 NUMBER PATH 'count(Location/PostalCode)',
              x465s44 NUMBER PATH 'count(Offense/OtherContent[Info="offense was completed" or Info="offense was attempted"])',
              x466s45 NUMBER PATH 'count(Offense/OffenseDescriptionText)',
              x467s46 NUMBER PATH 'count(Offense/DomesticViolenceIndicator)',
              x468s47 NUMBER PATH 'count(Offense/ForceCategory)',
              x469s48 NUMBER PATH 'count(Offense/OtherContent[Info="gang"])',
              x470s49 NUMBER PATH 'count(Offense/OtherContent[Info="home invasion"])',
              x471s50 NUMBER PATH 'count(Offense/OtherContent[Info="identity theft"])',
              x472s51 NUMBER PATH 'count(Offense/MOCrimeAndMotive)',
              x473s52 NUMBER PATH 'count(Offense/Offense)',
              x474s53 NUMBER PATH 'count(Offense/OffenseTerrorismIndicator)',
              x475s54 NUMBER PATH 'count(Organization[AssociationReference/AssociationType="ActivityResponsibleOrganizationAssociation" and AssociationReference/AssociationGUID=Activity[OtherContent/Info="Warrant"]/AssociationReference/AssociationGUID]/Name)',
              x476s55 NUMBER PATH 'count(Organization[AssociationReference/AssociationType="ActivityResponsibleOrganizationAssociation" and AssociationReference/AssociationGUID=Activity[OtherContent/Info="Warrant"]/AssociationReference/AssociationGUID]/OrganizationID)',
              x477s56 NUMBER PATH 'count(Organization[AssociationReference/AssociationType="ActivityInvolvedOrganizationAssociation" and AssociationReference/AssociationGUID=Activity[OtherContent/Info="Warrant"]/AssociationReference/AssociationGUID]/Name)',
              x478s57 NUMBER PATH 'count(Organization[AssociationReference/AssociationType="ActivityInvolvedOrganizationAssociation" and AssociationReference/AssociationGUID=Activity[OtherContent/Info="Warrant"]/AssociationReference/AssociationGUID]/OrganizationID)',
              x424s3 NUMBER PATH 'count(Person[Role="Witness"]/WitnessNarrative)',
              x425s4 NUMBER PATH 'count(Person[Role="Witness" and string-length(Name/FirstName)>0])',
              x426s5 NUMBER PATH 'count(Person[Role="Witness" and string-length(Name/FullName)>0])',
              x427s6 NUMBER PATH 'count(Person[Role="Witness" and string-length(Name/LastName)>0])',
              x428s7 NUMBER PATH 'count(Person[Role="Witness" and string-length(Name/MiddleName)>0])',
              x429s8 NUMBER PATH 'count(Person[Role="Witness" and string-length(Sex)>0])',
              x422s1 NUMBER PATH 'count(Arrest/Date)',
              x423s2 NUMBER PATH 'count(Arrest/Narrative)',
              x430s9 NUMBER PATH 'count(Person[AssociationReference/AssociationType="PersonAssignedUnitAssociation" and AssociationReference/AssociationGUID=Organization[string-length(OrganizationID)>0]/AssociationReference[AssociationType="PersonAssignedUnitAssociation"]/AssociationGUID])',
              x431s10 NUMBER PATH 'count(Person[Role="Enforcement Official" and string-length(Name/FirstName)>0])',
              x432s11 NUMBER PATH 'count(Person[Role="Enforcement Official" and string-length(Name/FullName)>0])',
              x433s12 NUMBER PATH 'count(Person[Role="Enforcement Official" and string-length(Name/LastName)>0])',
              x434s13 NUMBER PATH 'count(Person[Role="Enforcement Official" and string-length(Name/MiddleName)>0])',
              x435s14 NUMBER PATH 'count(Person[Role="Arrest Subject"]/SubjectJuvenileSubmissionIndicator)',
              x436s15 NUMBER PATH 'count(Person[Role="Arrest Subject" and  ArrestSubjectUCROffenseCharge])',
              x437s16 NUMBER PATH 'count(Person[Role="Arrest Subject"]/TreatAsAdultIndicator)',
              x438s17 NUMBER PATH 'count(Person[Role="Arrest Subject"]/BirthDate)',
              x439s18 NUMBER PATH 'count(Person[Role="Arrest Subject"]/Ethnicity)',
              x440s19 NUMBER PATH 'count(Person[((Role="Arrest Subject") and (EyeColor or EyeColorText))])',
              x441s20 NUMBER PATH 'count(Person[((Role="Arrest Subject") and (HairColor or HairColorText))])',
              x442s21 NUMBER PATH 'count(Person[Role="Arrest Subject"]/Height[PointValue or MaximumValue or MinimumValue])',
              x443s22 NUMBER PATH 'count(Person[Role="Arrest Subject"]/DriverLicenseID/ID)',
              x444s23 NUMBER PATH 'count(Person[Role="Arrest Subject"]/FBINumber)',
              x445s24 NUMBER PATH 'count(Person[Role="Arrest Subject"]/PassportID/ID)',
              x446s25 NUMBER PATH 'count(Person[Role="Arrest Subject"]/SSN)',
              x447s26 NUMBER PATH 'count(Person[Role="Arrest Subject"]/StateFingerprintID)',
              x448s27 NUMBER PATH 'count(Person[Role="Arrest Subject"]/USMSFugitiveNumber)',
              x449s28 NUMBER PATH 'count(Person[Role="Arrest Subject"]/Name/FirstName)',
              x450s29 NUMBER PATH 'count(Person[Role="Arrest Subject"]/Name/FullName)',
              x479s58 NUMBER PATH 'count(Person[AssociationReference/AssociationType="ActivityInvolvedPersonAssociation" and AssociationReference/AssociationGUID=Activity[OtherContent/Info="Warrant"]/AssociationReference/AssociationGUID])',
              x480s59 NUMBER PATH 'count(Warrant/Description)',
              x481s60 NUMBER PATH 'count(Organization[AssociationReference/AssociationType="ActivityInformationClearerOrganizationAssociation" and AssociationReference/AssociationGUID=Activity[OtherContent/Info="Warrant"]/AssociationReference/AssociationGUID]/Name)',
              x482s61 NUMBER PATH 'count(Organization[AssociationReference/AssociationType="ActivityInformationClearerOrganizationAssociation" and AssociationReference/AssociationGUID=Activity[OtherContent/Info="Warrant"]/AssociationReference/AssociationGUID]/OrganizationID)',
              x483s62 NUMBER PATH 'count(Warrant/WarrantDate)') T7
          WHERE STATUS_ID=1
            AND NAT_SOURCE_ID=0
            AND OWNING_ORI like 'ABC123'
            and n.id=met.nads_id and met.type_id=mtt.id and mtt.name='ReportType' and met.val='Arrest Report';Edited by: drad on May 15, 2012 6:03 AM
    Edited by: drad on May 15, 2012 6:04 AM
    marking as answered as the above solution worked for me

  • Deafult search engine on a new tab-this thread was closed but I have a related question. Once you put the new url in, what then? Close? When tried, did not work

    "deafult search engine on a new tab" - this thread was closed but I have a related question. [the word “default” is spelled as it on the thread] Once you put the new url in, what then? Close it? When tried, it did not work. The closest answer is noted here. Instructing to go to about:fig. Specifically, I installed the accuweather add=on and it took over my tab home page - the one that comes up when you click for a new tab. I didn't like it so I clicked the button to remove it and the page went blank. I searched to see out to restore the tab page, tired the reply at this page :
    http://support.mozilla.org/en-US/questions/753256?s=install+search+box+on+new+tabs&r=3&as=s
    But it did not work. Can some on help me? Just want to know how to make google or some page open on a new tab.
    Many thanks

    Thanks so much for your support. As I said I am not a professional, so I by chance saw a friend who is and this is what he suggested and it worked.
    We googled for an answer and found this site: http://www.guidingtech.com/8004/have-new-tab-page-open-specific-website-firefox-chrome/
    It says to Download and install Download and install''' NewTabURL''' and gives instructions on how to. Now when I open the tab it goes to my preferred search page!

  • Problem with temp space allocation in parallel query

    Hello
    I've got a query which matches two large result sets (25m+ rows) against each other and does some basic filtering and aggregation. When I run this query in serial it takes about 30 mins and completes successfully. When I specify a parallel degree of 4 for each result set, it also completes successfully in about 20 minutes. However, when I specify that it should be run in parallel but don't specify a degree for each result set, it spawns 10 parallel servers and after a couple of minutes, bombs out from one of the parallel servers with:
    ORA-12801: error signaled in parallel query server P000
    ORA-01652: unable to extend temp segment by 64 in tablespace TEMPThis appears to be when it is about to perform a large hash join. The execution plan does not change whether the parallel degree is specified or not, and there is several GB of temp space available.
    I'm at a bit of a loss as to how to track down specifically what is causing this problem. I've looked at v$sesstat for all of the sessions involved and it hasn't really turned anything up. I've tried tracing the main session and that hasn't really turned up much either. From what I can tell, one of the sessions seems to try to allocate massive amounts of temp space that it just does not need, but I can figure out why.
    Any ideas of how to approach finding the cause of the problem?
    David

    Hello
    I've finally resolved this and the resolution was relatively simple - and was also the main thing that Mark Rittman said he did in his article: reduce the size of the hash join.
    After querying v$sql_workarea_active I could see what was happening which was that the sum of the temp space for all of the parallel slaves was exceeding the total amount of temp space available on the system. When run in serial, it was virtually at the limit. I guess the extra was just the overhead for each slave maintaining it's own hash table.
    I also made the mistake of misreading the exectuion plan - assuming that the data being pushed to the hash join was filtered to eliminate the data that was not of interest. Upon reflection, this was a rather stupid assumption on my part. Anyway, I used sub query factoring with the materialize hint to ensure that the hash join was only working on the data it should have been. This significantly reduced the size of the hash table and therefore the amount of temp space required.
    I did speak to oracle support and they suggested using pga_aggregate_target rather than the separate *area_size parameters.  I found that this had very little impact as the problem was related to the volume of data rather than whether it was being processed in memory or not.  That said, I did try upping the hash_area_size for the session with some initial success, but ultimately it didn't prove to be scalable.  We are however now using pga_aggregate_target in prod.
    So that's that. Problem sorted. And as the title of Mark Rittman's article suggests, I was trying to be too clever! :-)
    HTH
    David

  • Apply causes ORA-12805: parallel query server died unexpectedly

    Hi gurus,
    I created an apply with a user-defined message handler for a queue. When a message is enqueued, the apply tries to do its work, but then is aborted because a fatal error has occurred: ORA-12805: parallel query server died unexpectedly.
    Could anyone help me with this? I am desperate now.
    Here is what comes from the log:
    Dump file c:\oracle\product\10.2.0\admin\byzz10g\bdump\byzz10g_a002_640.trc
    Fri Sep 22 09:15:05 2006
    ORACLE V10.2.0.1.0 - Production vsnsta=0
    vsnsql=14 vsnxtr=3
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    Windows XP Version V5.1 Service Pack 2
    CPU : 1 - type 586
    Process Affinity : 0x00000000
    Memory (Avail/Total): Ph:405M/1014M, Ph+PgF:1795M/2442M, VA:1575M/2047M
    Instance name: byzz10g
    Redo thread mounted by this instance: 1
    Oracle process number: 32
    Windows thread id: 640, image: ORACLE.EXE (A002)
    *** 2006-09-22 09:15:05.366
    *** SERVICE NAME:(SYS$USERS) 2006-09-22 09:15:05.366
    *** SESSION ID:(141.21) 2006-09-22 09:15:05.366
    error 12805 in STREAMS process
    ORA-12805: parallel query server died unexpectedly
    OPIRIP: Uncaught error 447. Error stack:
    ORA-00447: fatal error in background process
    ORA-12805: parallel query server died unexpectedly
    Thank you very much!

    Hi myora9i,
    I saw similar report in MetaLink. (Bugid:3658975)
    It was 9.2.0.5 on Solaris.
    Unfortunately, this problem has left unsolved for 2 years due to luck of information to analyze the situation.
    I couldn't get a detail of problem, but the document says "Apply process abort".
    And error messages are same to yours. So I think your problem is related to the bug.
    Just FYI
    Regards,

  • Problem in running parallel query

    Hi All,
    We have an Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 installed on Microsoft Windows 2000 Advanced Server 5.0.2195 Service Pack 4 Build 2195.
    And we have a stored procedure which does lots of works.
    In this procedure, there is a select statement which joins a huge table with milions of records(lets call it table X) to some other almost huge tables. This table X
    is partitioned and parallel processing has been enabled on it. Every thing has been fine until a week ago. From then on, we are getting the following error in that procedure:
    ORA-12801: error signaled in parallel query server P014
    ORA-04030: out of process memory when trying to allocate 4194328 bytes (QERHJ hash-joi,QERHJ list array)
    We have made some changes in that select statement which are very common changes like adding some additional where clauses and selecting some additional columns. The From List of select statement has not been changed.
    I don't exactly know what is realy going on.
    The available memory is about 2 GB when the mentioned procedure crashes.
    Any Idea?
    My Best,
    Alireza Vali

    Is it a 32bit installation (32bit Windows, 32bit Oracle) ?
    What are your MEMORY_TARGET, SGA_TARGET, SGA_MAX_SIZE and PGA_AGGREGATE_TARGET parameters set to ? (If you have MEMORY_TARGET set, it is not necessary that the other parameters be set).
    ORA-4030 relates to PGA memory, not SGA memory. But Oracle on Windows is a single, multi-threaded process. Therefore, all Oracle "processes" (threads in the Windows process) share the same memory (address) space, even the SGA and PGA.
    Hemant K Chitale

  • Query working from sqldeveloper but not from aspx

    Hello,
    Well Im working on an application that has different queries that involve characters such as áéíóú // ÁÉÍÓÚ // ñÑ. Now the problem is that the query works just fine coming from sqldeveloper or toad but when it's called from an aspx file it returns no rows. Any idea why this might be? It only happens when the query has at least one of the above mentioned characters.
    Here you can see an example:
    SELECT DISTINCT N_DOCUMENTO FROM PROCESOS_METODOLOGIAS WHERE "LINEA DE NEGOCIO" = 'PRODUCCIÓN' AND N_DOCUMENTO IS NOT NULL ORDER BY N_DOCUMENTO ASC;I managed to "bypass" it by using LIKE for the time being
    SELECT DISTINCT N_DOCUMENTO FROM PROCESOS_METODOLOGIAS WHERE "LINEA DE NEGOCIO" LIKE '%PRODUCCI%' AND N_DOCUMENTO IS NOT NULL ORDER BY N_DOCUMENTO ASC;But I'm sure there's a solution for that. Any hints would be greatly appreciated.
    PS: Query from aspx is made with reference 10g to version 11g on server.

    Just as I finished osting this, I found out that the problem was ust that, working with the 10g reference on the 11g server version. in case anyone needs that...

  • Parallel Query Error - 1008 Not All Variables Bound

    Using DB 10g Enterprise Edition Release 10.2.0.1.0
    I am trying to query a table in SQL plus using a bind variable. When I run the query the first time it fails but if I run it again, it works! See the following :
    SQL> var b1 number;
    SQL> exec :b1 := 133348;
    PL/SQL procedure successfully completed.
    SQL> set autot on exp stat
    SQL> select 2 from pension_details where party_id = :b1;
    select 2 from pension_details where party_id = :b1
    ERROR at line 1:
    ORA-12801: error signaled in parallel query server P001
    ORA-01008: not all variables bound
    SQL> /
    2
    2
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=2 Card=1 Bytes=11)
    1 0 INDEX (RANGE SCAN) OF 'PENDTL_PK' (INDEX (UNIQUE)) (Cost=2
    Card=1 Bytes=11)
    If I add a hint suppressing the parallel index option, then it works first time :
    1* select /*+NOPARALLEL_INDEX (PENSION_DETAILS) */ 4 from pension_details where party_id = :b1
    SQL> /
    4
    4
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=2 Card=1 Bytes=11)
    1 0 INDEX (RANGE SCAN) OF 'PENDTL_PK' (INDEX (UNIQUE)) (Cost=2
    Card=1 Bytes=11)
    Can anyone shed any light on why this happens or what I need to check on the table and index? I have tried to replicate this on a different table (and a different db) with the parallel option on both the table and index but it works fine!

    Seeing as there have been no replies, I thought I would update my own thread!
    It turns out this is a bug that has been fixed in 11i. The fix has been back-ported to certain versions/os's.
    I will post the bug reference (it is on Metalink somewhere!) later. In the meantime, a workaround is to use the noparrallel_index hint.

  • Oracle11g RAC with partitioning and cross instance parallel query problem

    I have set up a 300gb TPC-H database using a 4 node RAC environment (8 cpu per node, 16 GB memory, 2 GHz processors) the system is served by 2.5 terabytes of SSD for its IO subsystem managed by a combination of ASM and OCFS2.
    When I run a large parallel query (number 9 in the TPCH query set) I get:
    ORA-00600: internal error code, arguments [kxfrGraDistNum3],[65535],[4]
    with all other arguments blank. There were some reports of this in version 9, but it was supposedly fixed. Has any one seen this behavior or have a work around?
    Mike

    Good Idea! Why didn't I think of that? Oh yea...I did. Unfortunately TMS CSI is an update only partner type CSI so I cannot submit a SR. The 600 lookup was how I found the old stuff, but it didn't have any 11g references. I hoped maybe someone in the community had encountered this and had a workaround. By the way, the querey looks like so:
    select
    nation,
    o_year,
    sum(amount) as sum_profit
    from
    select
    n_name as nation,
    extract(year from o_orderdate) as o_year,
    l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount
    from
    h_part,
    h_supplier,
    h_lineitem,
    h_partsupp,
    h_order,
    h_nation
    where
    s_suppkey = l_suppkey
    and ps_suppkey = l_suppkey
    and ps_partkey = l_partkey
    and p_partkey = l_partkey
    and o_orderkey = l_orderkey
    and s_nationkey = n_nationkey
    and p_name like '%spring%'
    ) as profit
    group by
    nation,
    o_year
    order by
    nation,
    o_year desc;
    the other 21 queries, all using the same tables and degrees of paralell and cross instance settings, executed ok.
    Mike

  • Parallel Query Error (Ora 12801 Ora-00904)

    when i run this particular query in a report or in SQL it wrks
    but some times it give the error .........
    any one who could help ........ASAP
    SELECT
    D.DISTRIBUTOR_CODE "DIST_CODE",
    D.DISTRIBUTOR_NAME "DIST_NAME",
    O.OPERATOR_CODE "OPER_CODE",
    O.OPERATOR_NAME "OPER_NAME",
    O.ACTIVE_STATUS "Act",
    r.receipt_no "receipt_no",
    r.ch_or_dd_no "cheque",
    r.receipt_date "receipt_date",
    '' "channel Code",
    '' "channel_name",
    b. SUBS_IRD "ird_subs",
    b.amount "amount"
    FROM
    dms_channel_dump z,
    DMS_OPERATOR_MASTER O,
    DMS_DISTRIBUTOR_MAIN D,
    dms_receipt_header r,
    DMS_BIFURCATION b
    WHERE
    b.channel_code = z.channel_code
    and r.OPERATOR_CODE = O.OPERATOR_CODE
    AND r.DISTRIBUTOR_CODE = D.DISTRIBUTOR_CODE
    AND r.receipt_no = b.receiopt_no
    union all
    SELECT
    D.DISTRIBUTOR_CODE "DIST_CODE",
    D.DISTRIBUTOR_NAME "DIST_NAME",
    '' "OPER_CODE",
    '' "OPER_NAME",
    'N' "Act",
    r.receipt_no "receipt_no",
    r.ch_or_dd_no "cheque",
    r.receipt_date "receipt_date",
    b.channel_code "channel Code",
    z.channel_name "channel_name",
    b. SUBS_IRD "ird_subs",
    b.amount "amount"
    FROM
    dms_channel_dump z,
    DMS_OPERATOR_MASTER O,
    DMS_DISTRIBUTOR_MAIN D,
    dms_receipt_header r,
    DMS_BIFURCATION b
    WHERE
    b.channel_code = z.channel_code
    and r.OPERATOR_CODE is null
    AND r.DISTRIBUTOR_CODE = D.DISTRIBUTOR_CODE
    AND r.receipt_no = b.receiopt_no
    order by 4,7
    ERROR:
    ORA-12801: error signaled in parallel query server P004
    ORA-00904: invalid column name
    no rows selecte
    REGARDS AND TIA
    ADOLPH

    If the data never changes, there would be no reason to gather statistics.
    If the data changes, there may or may not be a reason to gather statistics. There is some risk to gathering statistics because that can cause query plans to change and you could find that a query that was working fine yesterday is running very slowly today. Failing to gather statistics, though, can have the same effect-- if a histogram on a column indicates that the maximum value of a date field is December 1, 2006 because you haven't updated statistics in a few days, the CBO may conclude that a query this column with a value of December 4 would return very few row, rather than the many rows that are really there, causing Oracle to use a different query plan. Oracle tends to believe that the latter risk is more of a concern than the former and in 10g regularly and automatically gathers statistics unless you susped that job. Some DBAs disagree with Oracle and prefer less frequent, more controlled statistics gathering.
    If you GATHER AUTO, assuming your tables are set to MONITORING, Oracle gathers statistics on every table that has had more than some cutoff percentage of rows changed since statistics were last gathered. This cutoff is generally pretty reasonable, though ideally you'd probably want to gather statistics more frequently on smaller tables (adding 30 new rows to a 100 row table is probably more significant from a query plan perspective than adding 3 million rows to a 10 million row table) and less frequently on larger tables, more frequently on tables that have volatile data distributions (i.e. our DATE table) and less frequently on tables whose data distribution is relatively constant.
    Justin

  • Avoid Unnecessary Parallel Query

    I am using Oracle 10.2.0.3 RAC on 2 x Sun Solaris box with 32 CPUs. In general I wish to allow parallel execution, so parallel_server is set to TRUE.
    Our database is running, amongst other things, the Oracle Internet Directory schema. The application using this was experiencing a poor response time to a number of its queries. A quick investigation identified that a high percentage of time was spent on waits for events related to parallel execution.
    I ran a "select count(*)..." against one of the commonly used tables (ODS.CT_DN) to establish what volume of data was being queried, which took ~1s to count ~1,500 rows. This table has some indexes on it which have parallel enabled, and a trace of the query showed that parallel query was being used.
    If I disable parallel execution on the indexes in question, and re-run the query, as expected it completes far quicker (~10ms). It seems therefore that with parallel enabled on the indexes, with such a low number of rows, the query is spending most of its time spawning and coordinating slave processes.
    The table and all the indexes have statistics gathered (by GATHER_STATS_JOB ), so my question is, why doesn't the optimizer reach the same conclusion as me, that based on the low number of rows in the table it would be far quicker to execute the query in serial rather than in parallel?
    The table in question, and others experiencing a similar problem, belong to Oracle Internet Directory, hence I would prefer not to resolve the problem using schema changes, i.e. disabling parallel execution on the schema objects. Furthermore, though the tables may have few rows now, in the future they may reach a point where it makes sense to execute these queries in parallel, so I guess I would like the optimizer to do its job and adjust the plan accordingly as the statistics change.
    Any ideas?
    Thanks,
    Simon.

    comments embedded
    I am using Oracle 10.2.0.3 RAC on 2 x Sun Solaris box
    with 32 CPUs. In general I wish to allow parallel
    execution, so parallel_server is set to TRUE.
    That is an unwise decision. Apart from that the parallel_server parameter doesn't have anything to do with parallel execution. In fact, the default is TRUE in a RAC configuration.
    Parallel execution only makes sense when you've striped your tables against multiple drives. If you didn't do that, all your queries slaves will hit the same drive and cause an I/O bottleneck.
    Our database is running, amongst other things, the
    Oracle Internet Directory schema. The application
    using this was experiencing a poor response time to a
    number of its queries. A quick investigation
    identified that a high percentage of time was spent
    on waits for events related to parallel execution.
    As was to be expected.
    I ran a "select count(*)..." against one of the
    commonly used tables (ODS.CT_DN) to establish what
    volume of data was being queried, which took ~1s to
    count ~1,500 rows. This table has some indexes on it
    which have parallel enabled, and a trace of the query
    showed that parallel query was being used.
    If I disable parallel execution on the indexes in
    question, and re-run the query, as expected it
    completes far quicker (~10ms). It seems therefore
    that with parallel enabled on the indexes, with such
    a low number of rows, the query is spending most of
    its time spawning and coordinating slave processes.
    The table and all the indexes have statistics
    gathered (by GATHER_STATS_JOB ), so my question is,
    why doesn't the optimizer reach the same conclusion
    as me, that based on the low number of rows in the
    table it would be far quicker to execute the query in
    serial rather than in parallel?This is because the optimizer divides the cost of the access by the number of query slaves involved. The optimizer doesn't know the query slaves are going to hit one disk.
    >
    The table in question, and others experiencing a
    similar problem, belong to Oracle Internet Directory,
    hence I would prefer not to resolve the problem using
    schema changes, i.e. disabling parallel execution on
    the schema objects. Furthermore, though the tables
    may have few rows now, in the future they may reach a
    point where it makes sense to execute these queries
    in parallel, so I guess I would like the optimizer to
    do its job and adjust the plan accordingly as the
    statistics change.
    Any ideas?You should disable parallel execution.
    As Tom Kyte puts it 'Paralllel query is for queries which are essentially unscalable'. The queries in Oracle Internet Directory do not belong to that category.
    Please note it also makes little sense to post this, using various aliases, to all Oracle groups you can spell.
    Sybrand Bakker
    Senior Oracle DBA
    >
    Thanks,
    Simon.

  • Oracle Parallel query

    Hi,
    I want to know what happens if we dont specify degree of parallelism in the parallel hint? It caused issues in our production database when patch upgraded from 9.2.0.5.0 to 9.2.0.7.0. there is one parallel hint on the table without DOP which worked before patch upgrade and did not work after patch upgrade. when i give definite parallelism it worked fine.
    Any suggestions on this?
    Thanks
    Venkat.

    The rest of the page from the link you gave explains how the execution worksYeah, it does .. but there is nowhere defined what a "separate process" means... means it a new shadow process (as a child of the coordinator) or only threads?
    In the Data Warehousing Guide... it seems like both... look here...
    -- >"The query coordinator does the following:
    --> "Allocates one or two set of slaves (threads or processes)"
    hmmm but what now? a new shadow process or an additional thread by the coordinator...
    I hope you know, what my question is ;-)
    Regards
    Stefan

Maybe you are looking for