Query Hang
When I run the below query, it is not giving any result, the session is hung
V$session_wait says : PX Deq: Execute Reply
Anyhelp would be hightly appreciated
CREATE TABLE HOLD_TRIM
TABLESPACE HP_TS
AS
SELECT a.*, 0 AS CLAIM_LIM_THRESH,
SE_DETAIL detail,
B.SE_CODE as SA_CODE,
SE_SHORT_DESC AS SA_DESC,
SE_REQ_ACTION AS REFER_TO,
SA_FLAG_CD
FROM
(SELECT A.*,
'AHAC' AS SE_MAJOR_GROUP_ABBR ,
'AHAC'||DECODE(DSP_DIV_NO, 8, '08',TO_CHAR(DSP_DIV_NO))
AS SE_MINOR_GROUP_ABBR
FROM ahac_all_expir_pol A) a,
se_ahac_comb_ibm b,
dbg_consol_rept_srce_desc c
WHERE (a.se_major_group_abbr = b.se_major_group_abbr
OR b.se_major_group_abbr = 'ALL')
AND (a.se_minor_group_abbr = b.se_minor_group_abbr
OR b.se_minor_group_abbr = 'ALL')
AND (a.product_aggregate_abbr = b.product_aggregate_abbr
OR b.product_aggregate_abbr = 'ALL')
AND b.se_code = c.se_code
AND (a.se_major_group_abbr = c.se_major_group_abbr
OR c.se_major_group_abbr = 'ALL')
AND (a.se_minor_group_abbr = c.se_minor_group_abbr
OR c.se_minor_group_abbr = 'ALL')
AND (a.product_aggregate_abbr = c.product_aggregate_abbr
OR c.product_aggregate_abbr = 'ALL')
AND (
(a.duns_no = b.duns_no AND c.match_level = 0)
OR
(a.ULT_duns_no = b.duns_no AND c.match_level IN (1, 2))
OR
(b.duns_no=0 and a.PRIM_SIC_CODE =b.SIC_OR_SOURCE AND c.match_level = 99));
Execution Plan:
Execution Plan
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=7419 Card=317 Byte
s=119826)
1 0 PX COORDINATOR
2 1 PX SEND* (QC (RANDOM)) OF ':TQ10008' :Q1008
3 2 BUFFER* (SORT) :Q1008
4 3 CONCATENATION* :Q1008
5 4 HASH JOIN* (Cost=252 Card=1 Bytes=378) :Q1008
6 5 PX RECEIVE* (Cost=126 Card=1 Bytes=174) :Q1008
7 6 PX SEND* (BROADCAST) OF ':TQ10002' (Cost=126 C :Q1002
ard=1 Bytes=174)
8 7 BUFFER* (SORT) :Q1002
9 8 NESTED LOOPS* (Cost=126 Card=1 Bytes=174) :Q1002
10 9 PX BLOCK* (ITERATOR) :Q1002
11 10 TABLE ACCESS* (FULL) OF 'DBG_CONSOL_RE :Q1002
PT_SRCE_DESC' (TABLE) (Cost=125 Card=1 Bytes=47)
12 9 TABLE ACCESS* (BY INDEX ROWID) OF 'SE_AH :Q1002
AC_COMB_IBM' (TABLE) (Cost=3 Card=1 Bytes=127)
13 12 INDEX* (RANGE SCAN) OF 'ISAAHACCOMBIBM :Q1002
_X2' (INDEX) (Cost=2 Card=1)
14 5 PX BLOCK* (ITERATOR) (Cost=126 Card=21756 Bytes= :Q1008
4438224)
15 14 TABLE ACCESS* (FULL) OF 'AHAC_ALL_EXPIR_POL' ( :Q1008
TABLE) (Cost=126 Card=21756 Bytes=4438224)
16 4 HASH JOIN* (Cost=2214 Card=82 Bytes=30996) :Q1008
17 16 PX RECEIVE* (Cost=125 Card=1 Bytes=47) :Q1008
18 17 PX SEND* (BROADCAST) OF ':TQ10003' (Cost=125 C :Q1003
ard=1 Bytes=47)
19 18 BUFFER* (SORT) :Q1003
20 19 PX BLOCK* (ITERATOR) (Cost=125 Card=1 Byte :Q1003
s=47)
21 20 TABLE ACCESS* (FULL) OF 'DBG_CONSOL_REPT :Q1003
SRCEDESC' (TABLE) (Cost=125 Card=1 Bytes=47)
22 16 HASH JOIN* (Cost=2088 Card=5932 Bytes=1963492) :Q1008
23 22 PX RECEIVE* (Cost=126 Card=32299 Bytes=6588996 :Q1008
24 23 PX SEND* (BROADCAST) OF ':TQ10004' (Cost=126 :Q1004
Card=32299 Bytes=6588996)
25 24 BUFFER* (SORT) :Q1004
26 25 PX BLOCK* (ITERATOR) (Cost=126 Card=3229 :Q1004
9 Bytes=6588996)
27 26 TABLE ACCESS* (FULL) OF 'AHAC_ALL_EXPI :Q1004
R_POL' (TABLE) (Cost=126 Card=32299 Bytes=6588996)
28 22 PX BLOCK* (ITERATOR) (Cost=1955 Card=1776529 B :Q1008
ytes=225619183)
29 28 TABLE ACCESS* (FULL) OF 'SE_AHAC_COMB_IBM' ( :Q1008
TABLE) (Cost=1955 Card=1776529 Bytes=225619183)
30 4 HASH JOIN* (Cost=2214 Card=227 Bytes=85806) :Q1008
31 30 PX JOIN FILTER* (CREATE) OF ':BF0000' (Cost=2087 :Q1008
Card=12344 Bytes=2147856)
32 31 PX RECEIVE* (Cost=2087 Card=12344 Bytes=214785 :Q1008
6)
33 32 PX SEND* (HASH) OF ':TQ10005' (Cost=2087 Car :Q1005
d=12344 Bytes=2147856)
34 33 BUFFER* (SORT) :Q1005
35 34 HASH JOIN* (Cost=2087 Card=12344 Bytes=2 :Q1005
147856)
36 35 PX RECEIVE* (Cost=125 Card=1 Bytes=47) :Q1005
37 36 PX SEND* (BROADCAST) OF ':TQ10000' ( :Q1000
Cost=125 Card=1 Bytes=47)
38 37 BUFFER* (SORT) :Q1000
39 38 PX BLOCK* (ITERATOR) (Cost=125 C :Q1000
ard=1 Bytes=47)
40 39 TABLE ACCESS* (FULL) OF 'DBG_C :Q1000
ONSOL_REPT_SRCE_DESC' (TABLE) (Cost=125 Card=1 Bytes=47)
41 35 PX BLOCK* (ITERATOR) (Cost=1955 Card=1 :Q1005
776529 Bytes=225619183)
42 41 TABLE ACCESS* (FULL) OF 'SE_AHAC_COM :Q1005
B_IBM' (TABLE) (Cost=1955 Card=1776529 Bytes=225619183)
43 30 PX RECEIVE* (Cost=126 Card=32299 Bytes=6588996) :Q1008
44 43 PX SEND* (HASH) OF ':TQ10006' (Cost=126 Card=3 :Q1006
2299 Bytes=6588996)
45 44 PX JOIN FILTER* (USE) OF ':BF0000' :Q1006
46 45 BUFFER* (SORT) :Q1006
47 46 PX BLOCK* (ITERATOR) (Cost=126 Card=3229 :Q1006
9 Bytes=6588996)
48 47 TABLE ACCESS* (FULL) OF 'AHAC_ALL_EXPI :Q1006
R_POL' (TABLE) (Cost=126 Card=32299 Bytes=6588996)
49 4 HASH JOIN* (Cost=2739 Card=7 Bytes=2646) :Q1008
50 49 PX RECEIVE* (Cost=251 Card=4340 Bytes=1089340) :Q1008
51 50 PX SEND* (BROADCAST) OF ':TQ10007' (Cost=251 C :Q1007
ard=4340 Bytes=1089340)
52 51 BUFFER* (SORT) :Q1007
53 52 HASH JOIN* (Cost=251 Card=4340 Bytes=10893 :Q1007
40)
54 53 PX RECEIVE* (Cost=125 Card=153 Bytes=719 :Q1007
1)
55 54 PX SEND* (BROADCAST) OF ':TQ10001' (Co :Q1001
st=125 Card=153 Bytes=7191)
56 55 BUFFER* (SORT) :Q1001
57 56 PX BLOCK* (ITERATOR) (Cost=125 Car :Q1001
d=153 Bytes=7191)
58 57 TABLE ACCESS* (FULL) OF 'DBG_CON :Q1001
SOL_REPT_SRCE_DESC' (TABLE) (Cost=125 Card=153 Bytes=7191)
59 53 PX BLOCK* (ITERATOR) (Cost=126 Card=3229 :Q1007
9 Bytes=6588996)
60 59 TABLE ACCESS* (FULL) OF 'AHAC_ALL_EXPI :Q1007
R_POL' (TABLE) (Cost=126 Card=32299 Bytes=6588996)
61 49 PX BLOCK* (ITERATOR) (Cost=1955 Card=1776529 Byt :Q1008
es=225619183)
62 61 TABLE ACCESS* (FULL) OF 'SE_AHAC_COMB_IBM' (TA :Q1008
BLE) (Cost=1955 Card=1776529 Bytes=225619183)
2 PARALLEL_TO_SERIAL
3 PARALLEL_COMBINED_WITH_PARENT
4 PARALLEL_COMBINED_WITH_PARENT
5 PARALLEL_COMBINED_WITH_PARENT
6 PARALLEL_COMBINED_WITH_PARENT
7 PARALLEL_TO_PARALLEL
8 PARALLEL_COMBINED_WITH_PARENT
9 PARALLEL_COMBINED_WITH_PARENT
10 PARALLEL_COMBINED_WITH_CHILD
11 PARALLEL_COMBINED_WITH_PARENT
12 PARALLEL_COMBINED_WITH_PARENT
13 PARALLEL_COMBINED_WITH_PARENT
14 PARALLEL_COMBINED_WITH_CHILD
15 PARALLEL_COMBINED_WITH_PARENT
16 PARALLEL_COMBINED_WITH_PARENT
17 PARALLEL_COMBINED_WITH_PARENT
18 PARALLEL_TO_PARALLEL
19 PARALLEL_COMBINED_WITH_PARENT
20 PARALLEL_COMBINED_WITH_CHILD
21 PARALLEL_COMBINED_WITH_PARENT
22 PARALLEL_COMBINED_WITH_PARENT
23 PARALLEL_COMBINED_WITH_PARENT
24 PARALLEL_TO_PARALLEL
25 PARALLEL_COMBINED_WITH_PARENT
26 PARALLEL_COMBINED_WITH_CHILD
27 PARALLEL_COMBINED_WITH_PARENT
28 PARALLEL_COMBINED_WITH_CHILD
29 PARALLEL_COMBINED_WITH_PARENT
30 PARALLEL_COMBINED_WITH_PARENT
31 PARALLEL_COMBINED_WITH_PARENT
32 PARALLEL_COMBINED_WITH_PARENT
33 PARALLEL_TO_PARALLEL
34 PARALLEL_COMBINED_WITH_PARENT
35 PARALLEL_COMBINED_WITH_PARENT
36 PARALLEL_COMBINED_WITH_PARENT
37 PARALLEL_TO_PARALLEL
38 PARALLEL_COMBINED_WITH_PARENT
39 PARALLEL_COMBINED_WITH_CHILD
40 PARALLEL_COMBINED_WITH_PARENT
41 PARALLEL_COMBINED_WITH_CHILD
42 PARALLEL_COMBINED_WITH_PARENT
43 PARALLEL_COMBINED_WITH_PARENT
44 PARALLEL_TO_PARALLEL
45 PARALLEL_COMBINED_WITH_PARENT
46 PARALLEL_COMBINED_WITH_PARENT
47 PARALLEL_COMBINED_WITH_CHILD
48 PARALLEL_COMBINED_WITH_PARENT
49 PARALLEL_COMBINED_WITH_PARENT
50 PARALLEL_COMBINED_WITH_PARENT
51 PARALLEL_TO_PARALLEL
52 PARALLEL_COMBINED_WITH_PARENT
53 PARALLEL_COMBINED_WITH_PARENT
54 PARALLEL_COMBINED_WITH_PARENT
55 PARALLEL_TO_PARALLEL
56 PARALLEL_COMBINED_WITH_PARENT
57 PARALLEL_COMBINED_WITH_CHILD
58 PARALLEL_COMBINED_WITH_PARENT
59 PARALLEL_COMBINED_WITH_CHILD
60 PARALLEL_COMBINED_WITH_PARENT
61 PARALLEL_COMBINED_WITH_CHILD
62 PARALLEL_COMBINED_WITH_PARENT
SQL>
Similar Messages
-
Oracle 9.2.0.6; query hangs if partition doesn't exist
Hallo all,
this is the first time I post on this forum.
I work in a group of PL\SQL developers in Italy. Few day ago we had a problem with a query and like to find out what the problem is.
We have an Oracle DB version 9.2.0.6 (old I know) in a production environment. Linux OS.
The query was made to extract data from a partitined table, on a partioned field, in our casa one Year. By mistake we have serced for the wrong year, 2013. There where no data for that year and therefor no partition.
So, happened that the query hangs and after 24 hours was terminated.
What we expected indeed was a zero records retirned in, at the most, few minutes, see that the table, in severa partition contains about 16 million records.
The we tested the same query but in a different enviroment, Oracle 11gr2, same table structure, same partitioning, without partition 2013, and the query completed in less tha 1 minute with zero records in output.
At this point we thought of a bug, but can't find any reference.
Has anyone had a similar experience or can give some indication of possible bug report.
Thanks for any help.Hi Rob,
thank you for your answer.
Sorry if this is not the best forum. I am not very practical.
I try to answer to your questions.
At a first time we thought the query did a full scan on the table. Yes. But even to full scan 16.000.000 records split in no more than 8 partition (at this time) shouldn't take up to 24 hours and never stop running. I think.
We don't have a DBA role so we do not have full control over what is running. And take too long time to open a ticket and ask the DBA to check.
What we did is testing the same query in a pre-prod environment, which is an Oracle 11gr2.
I understand that it is not very usual to have a pre-production environment with a latest version of oracle but this is the way we have to work.
Anyway, the test in pre-production worked very well. Without 2013 partition the return was very fast and we had zero records as expected.
Then we found a workaround for production, ora 9. Call it work around maybe is too much ........
We created the 2013 partition and run the query. The respons was then succesfull in about the same time than in pre-prod. Less than one minute and zero records.
And this is fine for us.
What we don't understand is why this different behavior with two different version of DB. Thats why we think it is due to a bug. We only want to find out whether it is this or if there is a different reason.
Some other response or help would help.
Thank you. -
Sql query hangs close to the end
Hi:
I am on 10.2.0.3.
My rather simple query hangs for a few minutes close to the end. It's supposed to return 288 rows and it immediately returns 285, then hangs for 4-5 min, than returns the remaining 3 rows. Kind of similar behavior to using "First_rows" hint - which I'm not using...
The table has about 100,000 rows.
Some relevant info is below.
Any ides appreciated.
TIA
PLAN_TABLE_OUTPUT
Plan hash value: 2481764356
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 30 | 3 (0)| 00:00:01 |
|* 1 | INDEX RANGE SCAN| PSACOMBO_DATA_TBL | 1 | 30 | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - access("SETID"='GLOBL' AND "PROCESS_GROUP"='100ACDTPRJ' AND
"COMBINATION"='100ACDTPRJ' AND "VALID_CODE"='V')
optimizer_dynamic_sampling integer 6
optimizer_features_enable string 10.2.0.3
optimizer_index_caching integer 25
optimizer_index_cost_adj integer 75
optimizer_mode string ALL_ROWS
optimizer_secure_view_merging boolean TRUE
unnestsubquery boolean FALSEYou said the query is supposed to return 288 rows, but from the explain plan, Oracle "see" only 1 row to be returned. Are the stats up-to-date ? What's the actual query ?
Please, on the forum side, use tags before and after your code to keep it readable (preserve blanks and tabs).
Nicolas. -
Hi,
We have created a query in which we are using quantity conversion ( defined in RSUOM ) , the target quantity is to be taken from a variable. The quantity conversions is running fine but when we do a value help for the target quantity variable in Portal, the query hangs. We are not facing any such issue in Bex Analyzer.
Please share your ideas on what could be the possible reason for this.
Thanks and Regards,
Manish SharmaHello Manish,
This is clearly a Portal issue.
Probably an issue with BI Java.
I recommend you to update your BI Java components to latest patch recommended by Java SP_Patch Matrix.
If you are using Netweaver 7.0, please check the link below:
http://www.sdn.sap.com/irj/sdn/index?rid=/webcontent/uuid/6010addf-e096-2b10-8893-e98586d005f9 [original link is broken]
If you are using Netweaver 7.0 EHP 1 (7.01), please the this link:
http://www.sdn.sap.com/irj/sdn/index?rid=/webcontent/uuid/c098b21c-e56f-2d10-2aad-b13915b396a4 [original link is broken]
Applying the patches recommended should solve the issue.
Also, as a recommendation, run the BI Diagnostics - note 937697 - and correct the red alerts.
Best Regards,
Edward John -
I have some code (VB Script) that is collecting CPU performance metrics from WMI. The code works well on all of the servers (identical servers) but after a period of time (8 hours, 30 hours, other random times) on some of the servers the query hangs.
After several hours (e.g. 8 hours) the query will work again on the server. I have used WBEMTEST to query the CIMv2 namespace to perform the same query on the server where WMI is having a problem and it also hangs.
The query eventually times out and does not return a value.
I have asked the team to rebuild WMI and after they completed the rebuild, the problem still occurs.
Since the code is only performing a read operation on WMI, I do not see how the query can cause the hang of WMI.
Any ideas on what I should do next?
ThanksHi,
Before going further, would you please let me know whether install all
necessary Windows Updates on those servers?
à
but after a period of time (8 hours, 30 hours, other random times) on some of the servers the query hangs.
When the
hang issue occurred, please check if consume high RAM or CPU. Just a confirmation, thanks for your understanding.
In addition, please use the WMI Diagnosis Utility and check if can help you to analyze this issue. for more
details, please refer to following articles.
WMI Diagnosis Utility
WMIDiag 2.1 is here!
If any update, please feel free to let me know.
Hope this helps.
Best regards,
Justin Gu -
Query hangs on 2.4 release
I was migrating the code from 2.3 to 2.4 and tested the query with a fairly large expression, the query hangs:
my test query is this:
"collection('people.dbxml')/people/person[name=$name and (@id!=655 and @id!=660 and @id!=659 and @id!=664 and @id!=663 and @id!=655 and @id!=660 and @id!=663 and @id!=661 and @id!=662 and @id!=657 and @id!=691 and @id!=689 and @id!=692 and @id!=658 and @id!=689 and @id!=654 and @id!=688)]";
that worked on 2.3, anyone has a solution??
0x00d3be86 in DbXml::Buffer::reserve (this=0xbfdba0a8, offset=@0xbfdba02c, n=1)
at Buffer.cpp:157
157 if (static_cast<char*>(pCursor_) + n >
(gdb) bt
#0 0x00d3be86 in DbXml::Buffer::reserve (this=0xbfdba0a8, offset=@0xbfdba02c,
n=1) at Buffer.cpp:157
#1 0x00d3c017 in DbXml::Buffer::write (this=0xbfdba0a8, p=0xbfdba06b, n=1)
at Buffer.cpp:146
#2 0x00d62c58 in DbXml::Key::marshal (this=0xbfdba228, buffer=@0xbfdba0a8,
value=0x0, length=0) at Key.cpp:142
#3 0x00d63394 in DbXml::Key::setDbtFromThis (this=0xbfdba228, dbt=@0xbfdba14c)
at Key.cpp:345
#4 0x00d486c9 in DbXml::Container::getKeyStatistics (this=0x8bc0390, txn=0x0,
key=@0xbfdba228) at Container.cpp:582
#5 0x00d48c69 in DbXml::Container::getIndexCost (this=0x8bc0390,
oc=@0x8bf590c, op1=DbXml::DbWrapper::PREFIX, key1=@0xbfdba228,
op2=DbXml::DbWrapper::NONE, key2=@0xbfdba240) at Container.cpp:2018
#6 0x00d4600e in DbXml::Container::getDocumentSSCost (this=0x8bc0390,
oc=@0x8bf590c, cache=@0x8bf58f4) at Container.cpp:1940
#7 0x00e8a737 in DbXml::SequentialScanQP::cost (this=0x8c5045c,
context=@0x8bf590c, qec=@0xbfdbb23c) at SequentialScanQP.cpp:169
#8 0x00e68532 in DbXml::StructuralJoinQP::cost (this=0x8c50a24,
context=@0x8bf590c, qec=@0xbfdbb23c) at StructuralJoinQP.cpp:60The query optimizer in DB XML 2.4 has had a big overhaul, and it's now performing a lot more optimizations than the previous version used to. I've found and fixed your bug now, and it should be being released as a patch soon.
Please detail any suspected bugs in a thread on the forums - one of the DB XML developers will work with you to find and resolve your problems.
Jhon, your problems seem to be quite different to the one in this thread.
John -
In one of our databases, one of the Select query hangs at the parsing stage. The query was working fine few days back. How and what can be traced to see the cause of this hang. Database is in 10.2.0.3 and statistics has been gathered for all the affected tables.
Thanks for the info. The SEQ# is not changing in the v$session_waits. I have found a workaround for this problem. If I delete the statistics for CS_MEASUREMENT table, the query gets executed in .35 secs! If i collect stats again and runs, it hangs.
The session trace below.
TKPROF: Release 10.2.0.3.0 - Production on Fri May 30 11:43:02 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Trace file: css1cldr_ora_10134.trc
Sort options: default
count = number of times OCI procedure was executed
cpu = cpu time in seconds executing
elapsed = elapsed time in seconds executing
disk = number of physical reads of buffers from disk
query = number of buffers gotten for consistent read
current = number of buffers gotten in current mode (usually for update)
rows = number of rows processed by the fetch or execute call
select i.obj#,i.ts#,i.file#,i.block#,i.intcols,i.type#,i.flags,i.property,
i.pctfree$,i.initrans,i.maxtrans,i.blevel,i.leafcnt,i.distkey,i.lblkkey,
i.dblkkey,i.clufac,i.cols,i.analyzetime,i.samplesize,i.dataobj#,
nvl(i.degree,1),nvl(i.instances,1),i.rowcnt,mod(i.pctthres$,256),
i.indmethod#,i.trunccnt,nvl(c.unicols,0),nvl(c.deferrable#+c.valid#,0),
nvl(i.spare1,i.intcols),i.spare4,i.spare2,i.spare6,decode(i.pctthres$,null,
null,mod(trunc(i.pctthres$/256),256)),ist.cachedblk,ist.cachehit,
ist.logicalread
from
ind$ i, ind_stats$ ist, (select enabled, min(cols) unicols,
min(to_number(bitand(defer,1))) deferrable#,min(to_number(bitand(defer,4)))
valid# from cdef$ where obj#=:1 and enabled > 1 group by enabled) c where
i.obj#=c.enabled(+) and i.obj# = ist.obj#(+) and i.bo#=:1 order by i.obj#
call count cpu elapsed disk query current rows
Parse 1 0.01 0.00 0 0 0 0
Execute 3 0.01 0.01 0 0 0 0
Fetch 10 0.00 0.00 0 33 0 7
total 14 0.02 0.02 0 33 0 7
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
2 SORT ORDER BY (cr=10 pr=0 pw=0 time=2852 us)
2 HASH JOIN OUTER (cr=10 pr=0 pw=0 time=2741 us)
2 NESTED LOOPS OUTER (cr=7 pr=0 pw=0 time=102 us)
2 TABLE ACCESS CLUSTER IND$ (cr=5 pr=0 pw=0 time=73 us)
1 INDEX UNIQUE SCAN I_OBJ# (cr=2 pr=0 pw=0 time=29 us)(object id 3)
0 TABLE ACCESS BY INDEX ROWID IND_STATS$ (cr=2 pr=0 pw=0 time=22 us)
0 INDEX UNIQUE SCAN I_IND_STATS$_OBJ# (cr=2 pr=0 pw=0 time=18 us)(object id 711)
2 VIEW (cr=3 pr=0 pw=0 time=361 us)
2 SORT GROUP BY (cr=3 pr=0 pw=0 time=356 us)
2 TABLE ACCESS CLUSTER CDEF$ (cr=3 pr=0 pw=0 time=58 us)
1 INDEX UNIQUE SCAN I_COBJ# (cr=2 pr=0 pw=0 time=25 us)(object id 30)
select /*+ rule */ bucket_cnt, row_cnt, cache_cnt, null_cnt, timestamp#,
sample_size, minimum, maximum, distcnt, lowval, hival, density, col#,
spare1, spare2, avgcln
from
hist_head$ where obj#=:1 and intcol#=:2
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 50 0.01 0.00 0 0 0 0
Fetch 50 0.00 0.00 0 150 0 50
total 101 0.01 0.01 0 150 0 50
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: RULE
Parsing user id: SYS (recursive depth: 2)
Rows Row Source Operation
1 TABLE ACCESS BY INDEX ROWID HIST_HEAD$ (cr=3 pr=0 pw=0 time=81 us)
1 INDEX RANGE SCAN I_HH_OBJ#_INTCOL# (cr=2 pr=0 pw=0 time=57 us)(object id 257)
select /*+ rule */ bucket, endpoint, col#, epvalue
from
histgrm$ where obj#=:1 and intcol#=:2 and row#=:3 order by bucket
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 60 0.03 0.01 0 0 0 0
Fetch 60 0.01 0.00 0 206 0 973
total 121 0.04 0.02 0 206 0 973
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: RULE
Parsing user id: SYS (recursive depth: 2)
Rows Row Source Operation
3 SORT ORDER BY (cr=3 pr=0 pw=0 time=130 us)
3 TABLE ACCESS CLUSTER HISTGRM$ (cr=3 pr=0 pw=0 time=66 us)
1 INDEX UNIQUE SCAN I_OBJ#_INTCOL# (cr=2 pr=0 pw=0 time=27 us)(object id 252)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 1 0.00 0.00
SQL*Net message from client 1 10.13 10.13
select pos#,intcol#,col#,spare1,bo#,spare2
from
icol$ where obj#=:1
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 7 0.01 0.00 0 0 0 0
Fetch 25 0.00 0.00 0 50 0 18
total 33 0.01 0.00 0 50 0 18
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
2 TABLE ACCESS BY INDEX ROWID ICOL$ (cr=6 pr=0 pw=0 time=36 us)
2 INDEX RANGE SCAN I_ICOL1 (cr=4 pr=0 pw=0 time=38 us)(object id 40)
select name,intcol#,segcol#,type#,length,nvl(precision#,0),decode(type#,2,
nvl(scale,-127/*MAXSB1MINAL*/),178,scale,179,scale,180,scale,181,scale,182,
scale,183,scale,231,scale,0),null$,fixedstorage,nvl(deflength,0),default$,
rowid,col#,property, nvl(charsetid,0),nvl(charsetform,0),spare1,spare2,
nvl(spare3,0)
from
col$ where obj#=:1 order by intcol#
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 3 0.00 0.01 0 0 0 0
Fetch 87 0.00 0.00 0 11 0 84
total 91 0.00 0.01 0 11 0 84
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
12 SORT ORDER BY (cr=3 pr=0 pw=0 time=157 us)
12 TABLE ACCESS CLUSTER COL$ (cr=3 pr=0 pw=0 time=79 us)
1 INDEX UNIQUE SCAN I_OBJ# (cr=2 pr=0 pw=0 time=24 us)(object id 3)
select col#, grantee#, privilege#,max(mod(nvl(option$,0),2))
from
objauth$ where obj#=:1 and col# is not null group by privilege#, col#,
grantee# order by col#, grantee#
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 3 0.00 0.00 0 0 0 0
Fetch 3 0.00 0.00 0 6 0 0
total 7 0.00 0.00 0 6 0 0
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
0 SORT GROUP BY (cr=2 pr=0 pw=0 time=57 us)
0 TABLE ACCESS BY INDEX ROWID OBJAUTH$ (cr=2 pr=0 pw=0 time=34 us)
0 INDEX RANGE SCAN I_OBJAUTH1 (cr=2 pr=0 pw=0 time=31 us)(object id 103)
select grantee#,privilege#,nvl(col#,0),max(mod(nvl(option$,0),2))
from
objauth$ where obj#=:1 group by grantee#,privilege#,nvl(col#,0) order by
grantee#
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 3 0.00 0.00 0 0 0 0
Fetch 18 0.00 0.00 0 12 0 15
total 22 0.00 0.00 0 12 0 15
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
5 SORT GROUP BY (cr=4 pr=0 pw=0 time=107 us)
5 TABLE ACCESS BY INDEX ROWID OBJAUTH$ (cr=4 pr=0 pw=0 time=43 us)
5 INDEX RANGE SCAN I_OBJAUTH1 (cr=2 pr=0 pw=0 time=16 us)(object id 103)
select con#,obj#,rcon#,enabled,nvl(defer,0)
from
cdef$ where robj#=:1
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 3 0.01 0.00 0 0 0 0
Fetch 3 0.00 0.00 0 3 0 0
total 7 0.01 0.00 0 3 0 0
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
0 TABLE ACCESS BY INDEX ROWID CDEF$ (cr=1 pr=0 pw=0 time=22 us)
0 INDEX RANGE SCAN I_CDEF3 (cr=1 pr=0 pw=0 time=20 us)(object id 52)
select con#,type#,condlength,intcols,robj#,rcon#,match#,refact,nvl(enabled,0),
rowid,cols,nvl(defer,0),mtime,nvl(spare1,0)
from
cdef$ where obj#=:1
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 3 0.00 0.00 0 0 0 0
Fetch 34 0.00 0.00 0 42 0 31
total 38 0.00 0.00 0 42 0 31
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
5 TABLE ACCESS CLUSTER CDEF$ (cr=9 pr=0 pw=0 time=17 us)
1 INDEX UNIQUE SCAN I_COBJ# (cr=2 pr=0 pw=0 time=10 us)(object id 30)
select intcol#,nvl(pos#,0),col#,nvl(spare1,0)
from
ccol$ where con#=:1
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 31 0.01 0.00 0 0 0 0
Fetch 70 0.00 0.00 0 140 0 39
total 102 0.01 0.00 0 140 0 39
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
2 TABLE ACCESS BY INDEX ROWID CCOL$ (cr=6 pr=0 pw=0 time=49 us)
2 INDEX RANGE SCAN I_CCOL1 (cr=4 pr=0 pw=0 time=45 us)(object id 54)
select condition
from
cdef$ where rowid=:1
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.00 0 2 0 1
total 3 0.00 0.00 0 2 0 1
Misses in library cache during parse: 0
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
1 TABLE ACCESS BY USER ROWID CDEF$ (cr=1 pr=0 pw=0 time=18 us)
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 0 0.00 0.00 0 0 0 0
Execute 0 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
total 0 0.00 0.00 0 0 0 0
Misses in library cache during parse: 0
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 1 0.00 0.00
SQL*Net message from client 1 10.13 10.13
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 11 0.01 0.01 0 0 0 0
Execute 167 0.08 0.07 0 0 0 0
Fetch 361 0.01 0.01 0 655 0 1218
total 539 0.10 0.10 0 655 0 1218
Misses in library cache during parse: 10
Misses in library cache during execute: 10
0 user SQL statements in session.
167 internal SQL statements in session.
167 SQL statements in session.
Trace file: css1cldr_ora_10134.trc
Trace file compatibility: 10.01.00
Sort options: default
1 session in tracefile.
0 user SQL statements in trace file.
167 internal SQL statements in trace file.
167 SQL statements in trace file.
11 unique SQL statements in trace file.
3548 lines in trace file.
0 elapsed seconds in trace file. -
hi experts,
please help on this, we have migrated database from 10g to 11.2.0.3 , Everything went sccessful but one of the simple join query hanging occasionally in new upgraded database. is there any known issue or anything need to add after migration for sqls?,also before migration its was executed without any issues. that query is joining and fetching from two more tables . is there any generic reason please provide that would be helpful to analyze, Thanks in Advance.why wasn't this discovered during testing prior to the upgrade?
does new DB have current statistics?
How do I ask a question on the forums?
https://forums.oracle.com/forums/thread.jspa?threadID=2174552#9360002 -
Hi,
OS: SPARC 64 bit
Oracle Version: 10.2.0.3.0 64 bit
My query hangs when I include the outer query. When I execute without outer query It comes out in a fraction of second but when I includes outer query it starts hang
Below is my original query which hangs
select * from (select raw_sql_.**, rownum raw_rnum_ from (SELECT /*+ FIRST_ROWS */ NETWORK_ID||'","'||CALLER_NUMBER||'","'||CALLED_NUMBER FROM CDR FROM CDR WHERE 1 = 1
AND day_of_year = 99 AND INTERFACE = 'TRAFIC' AND TIME_STAMP BETWEEN to_date('2009/04/08 00:00:00','yyyy/mm/dd hh24:mi:ss') AND to_date
('2009/04/09 00:00:00','yyyy/mm/dd hh24:mi:ss') AND NETWORK_ID IN (1025,1026) order by id desc) raw_sql_ WHERE rownum <= 10000) WHERE raw_rnum_ > 0;
when I execute this it will come out immediately
select raw_sql_.**, rownum raw_rnum_ from (SELECT /*+ FIRST_ROWS */ NETWORK_ID||'","'||CALLER_NUMBER||'","'||CALLED_NUMBER FROM CDR FROM CDR WHERE 1 = 1
AND day_of_year = 99 AND INTERFACE = 'TRAFIC' AND TIME_STAMP BETWEEN to_date('2009/04/08 00:00:00','yyyy/mm/dd hh24:mi:ss') AND to_date
('2009/04/09 00:00:00','yyyy/mm/dd hh24:mi:ss') AND NETWORK_ID IN (1025,1026) order by id desc) raw_sql_ WHERE rownum <= 10000
select * from (select raw_sql_.**, rownum raw_rnum_ from (SELECT /*+ FIRST_ROWS */ NETWORK_ID||'","'||CALLER_NUMBER||'","'||CALLED_NUMBER FROM CDR FROM CDR WHERE 1 = 1
AND day_of_year = 99 AND INTERFACE = 'TRAFIC' AND TIME_STAMP BETWEEN to_date('2009/04/08 00:00:00','yyyy/mm/dd hh24:mi:ss') AND to_date
('2009/04/09 00:00:00','yyyy/mm/dd hh24:mi:ss') AND NETWORK_ID IN (1025,1026) order by id desc) raw_sql_ WHERE rownum <= 10000) WHERE raw_rnum_ > 0;
but when I includes outer query I hangs it is really very weird for me?
Here is the explain plan for that query
Execution Plan
Plan hash value: 3493649369
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
| 0 | SELECT STATEMENT | | 1 | 2015 | 1 (0)| 00:00:01 | | |
|* 1 | VIEW | | 1 | 2015 | 1 (0)| 00:00:01 | | |
|* 2 | COUNT STOPKEY | | | | | | | |
| 3 | PARTITION RANGE SINGLE | | 1 | 5894 | 1 (0)| 00:00:01 | 99 | 99 |
| 4 | PARTITION LIST ALL | | 1 | 5894 | 1 (0)| 00:00:01 | 1 | 48 |
|* 5 | TABLE ACCESS BY LOCAL INDEX ROWID| CDR | 1 | 5894 | 1 (0)| 00:00:01 | 4705 | 4752 |
| 6 | BITMAP CONVERSION TO ROWIDS | | | | | | | |
|* 7 | BITMAP INDEX SINGLE VALUE | IX_CDR_INTERFACE | | | | | 4705 | 4752 |
Predicate Information (identified by operation id):
1 - filter("RAW_RNUM_">0)
2 - filter(ROWNUM<=10000)
5 - filter("DAY_OF_YEAR"=99 AND "TIME_STAMP">=TO_DATE('2009-04-08 00:00:00', 'yyyy-mm-dd hh24:mi:ss') AND
"TIME_STAMP"<=TO_DATE('2009-04-09 00:00:00', 'yyyy-mm-dd hh24:mi:ss') AND ("NETWORK_ID"=1025 OR
"NETWORK_ID"=1026))
7 - access("INTERFACE"='TRAFIC')
can one explain why it happen? what could be the reason? Is it a bug or something? what should I do now? Issue is critical in the production enviromentent
Waiting for your Valuable Reply
Thanks In Advance
With Regards
Boouser454189 wrote:
I suspect the issue with the where clause (raw_rnum_ > 0)
Actually I using bitmap index on ' INTERFACE' column. Does it causing a prob or raw_rnum_ causing a problem?Boo,
a couple of comments:
1. Why do you use the deprecated FIRST_ROWS hint? From 9i on the FIRST_ROWS_n mode should be used instead, and since you're using a top-N query format the hint should be superfluous anyway since the optimizer should switch to FIRST_ROWS_n mode automatically.
2. Why do you use a BITMAP index and not a conventional b*tree index? Let me hazard a guess: Because the INTERFACE column has a small number of distinct values? That would be in most cases a bad idea.
3. What seems to be odd that you're accessing the data via the BITMAP index on INTERFACE, but request an ORDER BY ID DESC. But there is no order by in the execution plan posted. I wonder where the order should come from? Can you show us the DDL of the bitmap index?
4. What does the plan look like if you run only the inner query without the outer query?
You can always gain more information by tracing the statement execution or using the GATHER_PLAN_STATISTICS hint together with the DBMS_XPLAN.DISPLAY_CURSOR function.
Please read this HOW TO: Post a SQL statement tuning request - template posting that explains what you should provide if you have SQL statement tuning question and how to format it here so that the posted information is readable by others.
This accompanying blog post shows step-by-step instructions how to obtain that information.
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/ -
Select query hangs on Oracle 9i but works fine in Oracle 8i
Hi Guys,
For a recap of what happened:
Migrated from Oracle 8i to 9i for a customer, all queries and statements are working fine, except for this particular query. If i run the same query on 8i it works like a charm.
In 9i, if i remove even one field from the query, it works else it just hangs.
Any idea, any one???
**Added 2:09PM: When i removed some ltrim and rtrim that i believe not necessary, the query works fine, is there any field length limitation in Oracle 9i???
Below is the query:
set pagesize 100;
set linesize 1024;
set heading off;
set echo off;
spool scb_xfer_hdr_npsx;
select ltrim(rtrim(to_char(hdr_srl_no,'99'))) || ';' ||
'P' || ';' || rtrim(ltrim(payment_type))|| ';'|| ';' ||
ltrim(rtrim(our_ref_no))|| ';'|| 'MY;KUL;' ||
rtrim(ltrim(debit_account_no))||';'||
rtrim(ltrim(to_char(scb_batch_date,'YYYY/MM/DD'))) || ';'|| ';' ||
rtrim(ltrim(payee_name_1))|| ';'|| ';' ||
rtrim(ltrim(address_1))|| ';'||
rtrim(ltrim(address_2))|| ';'||
rtrim(ltrim(address_3))|| ';'|| ';' ||
rtrim(ltrim(payee_name_11))|| ';' ||
rtrim(ltrim(address_11))|| ';'||
rtrim(ltrim(address_21))|| ';'||
rtrim(ltrim(address_31))|| ';'|| ';' ||
rtrim(ltrim(payee_bank_code)) || ';' || ';' ||
rtrim(ltrim(payee_account_no)) || ';' ||
rtrim(ltrim(our_ref_no2)) || ';' || ';' ||
rtrim(ltrim(our_ref_no2)) || ';' || ';' || ';' || ';' ||
rtrim(ltrim(payment_currency))|| ';'||
rtrim(ltrim(to_char(payment_amount,'9999999999.99')))|| ';'||
'C;P;;' || rtrim(ltrim(payee_bank_name))|| ';' ||
'KL;;' ||
rtrim(ltrim(delivery_method)) || ';' ||
rtrim(ltrim(delivery_by)) || ';' ||
rtrim(ltrim(counter_pickup_location))
from scb_xfer_hdr_npsx
order by hdr_srl_no;
select distinct 'T;' || ltrim(rtrim(to_char(total_payments))) || ';' ||
ltrim(rtrim(to_char(total_pay_amount,'9999999999.99')))
from scb_xfer_hdr_npsx;
spool off;
spool scb_xfer_dtl_npsx;
select ltrim(rtrim(to_char(srl_no,'99'))) || ';' || 'I' || ';' ||
ltrim(rtrim(doc_no)) || ';' || ltrim(rtrim(to_char(doc_date,'yyyy/mm/dd'))) || ';' ||
ltrim(rtrim(doc_description)) || ';' ||
ltrim(rtrim(to_char(doc_amount,'9999999999.99')))
from scb_xfer_dtl_npsx
order by srl_no;
spool off;
set echo on;
exit;
Message was edited by:
LogeshHi,
are you still on a 32bit kernel on AIX?
How are the Form4.5 connected, are they on the same box, or are they using the forms GUI?
What about the statistics, how do you collect them? Is the database set to the COST based optimizer?
Do you use dbms_utility.analyze_schema, or this:
exec dbms_stats.gather_schema_stats( -
ownname => '$OWNER', -
estimate_percent => 10, -
granularity => 'ALL', -
method_opt => 'FOR ALL COLUMNS SIZE 75', -
degree => NULL , -
options => 'GATHER $GATH', -
cascade => TRUE -
What does it mean the SQL hangs? Can you cancel the query? Do you have to kill the session? Do you use any diagnostic tools like TOAD to trace the session, see what it is doing? Usually if this is a performance/tuning issue, you will see the session is not dead, but you will see advancing reads.
Regards,
Richard. -
Query Hangs after adding new Indexes
Hi Gurus,
In order to fix some performance issues in the integration and UI, in our implementation we have added some new indexes like FST_NAME,LAST_NAME for S_CONTACT table.
We did not make any new configurations or SRF compilations. No new data is loaded into database.
But since today morning when we query in the application (Contact List Applet) the application simply hangs. We tried it with many sessions from different machines.
We thought of, this could be because of some broken earlier data source connections within the task/session. But the query in other entities is working totally fine.We tried Accounts and Assets, they are working fine.
We did a spool of SQL and executed the same statement in TOAD.It is strange, the statement is executed in just few milli seconds, as it was earlier.
We could not find root cause.
Could somebody give some ideas.
RegardsHi Robert,
In the Object Manager session log file I found the following trace after the SQL statement.
T2.PR_EMP_ID = T11.PAR_ROW_ID (+) AND
T25.PR_DEPT_OU_ID = T3.ROW_ID (+) AND
T25.PR_DEPT_OU_ID = T21.PAR_ROW_ID (+) AND
T25.PR_DEPT_OU_ID = T24.PAR_ROW_ID (+) AND
T25.PR_SYNC_USER_ID = T10.ROW_ID (+) AND
T25.PR_SYNC_USER_ID = T15.PAR_ROW_ID (+) AND
(T25.EMP_FLG = 'N') AND
(T25.PERSON_UID LIKE :3)
ObjMgrSqlLog Detail 4 0003f7324a41481b:0 2009-07-27 15:03:09 Bind variable 1: 0-5220
ObjMgrSqlLog Detail 4 0003f7324a41481b:0 2009-07-27 15:03:09 Bind variable 2: 0-5220
ObjMgrSqlLog Detail 4 0003f7324a41481b:0 2009-07-27 15:03:09 Bind variable 3: S1028056768*
ObjMgrSqlLog Debug 5 0003f7324a41481b:0 2009-07-27 15:03:09 User search spec: S1028056768*
ObjMgrSqlLog Debug 5 0003f7324a41481b:0 2009-07-27 15:03:09 Named search [Applet Search Spec Named Search]: [Employee Flag]='N'
ObjMgrSqlLog Debug 5 0003f7324a41481b:0 2009-07-27 15:03:09 User sort spec:
ObjMgrSqlLog Debug 5 0003f7324a41481b:0 2009-07-27 15:03:09 System sort spec:
ObjMgrSqlLog Debug 5 0003f7324a41481b:0 2009-07-27 15:03:09 0xf1fcf0f8: /siebel/siebsrvr/lib/libsscaswbc.so!unsigned CSSSWEFrame::ExecuteQuery()() +0xf8
0xf1fcb62c: /siebel/siebsrvr/lib/libsscaswbc.so!unsigned CSSSWEFrame::DoInvokeMethod(const unsigned short*,CSSStringArray&,SSstring&)() +0x1ec
0xf20b6c80: /siebel/siebsrvr/lib/libsscaswbc.so!unsigned CSSSWEFrameList::DoInvokeMethod(const unsigned short*,CSSStringArray&,SSstring&)() +0x280
0xebcf0fbc: /siebel/siebsrvr/lib/libswcacmfr.so!unsigned CSSSWEFrameListBase::DoInvokeMethod(const unsigned short*,CSSStringArray&,SSstring&)() +0x77c
0xe67e17e4: /siebel/siebsrvr/lib/libswfafcfr.so!unsigned CSSSWEFrameListFINGenericButton::DoInvokeMethod(const unsigned short*,CSSStringArray&,SSstring&)() +0x164
0xf1fcb158: /siebel/siebsrvr/lib/libsscaswbc.so!unsigned CSSSWEFrame::InvokeMethod(const unsigned short*,CSSStringArray&,SSstring&)() +0x118
0xf20e7750: /siebel/siebsrvr/lib/libsscaswbc.so!unsigned CSSSWEFrameMgrInternal::InvokeAppletMethod(CSSSWEHtmlStream*,CSSSWEArgs*,WWEReqModInfo*,WWECbInfo*&,CSSStringArray&)() +0xd90
0xf20ca6cc: /siebel/siebsrvr/lib/libsscaswbc.so!unsigned CSSSWECmdProcessor::InvokeMethod(CSSSWEHtmlStream*,CSSSWEArgs*,WWEReqModInfo*,WWECbInfo*&)() +0x88c
0xf20c8c7c: /siebel/siebsrvr/lib/libsscaswbc.so!unsigned CSSSWECmdProcessor::_ProcessCommand(CSSSWEHtmlStream*,WWEReqModInfo*,WWECbInfo*&)() +0x87c
0xf20cea1c: /siebel/siebsrvr/lib/libsscaswbc.so!unsigned CSSSWECmdProcessor::ProcessCommand(CSSSWEGenericRequest*,CSSSWEGenericResponse*,WWEReqModInfo*&,WWECbInfo*&)() +0x9bc
0xf20cddb8: /siebel/siebsrvr/lib/libsscaswbc.so!unsigned CSSSWECmdProcessor::ProcessCommand(CSSSWEHttpRequest*,CSSSWEHttpResponse*,WWECbInfo*&)() +0xd8
0xf2321724: /siebel/siebsrvr/lib/libsscaswbc.so!unsigned CSSServiceSWEIface::Request(CSSSWEReqRec*,CSSSWEResponseRec*)() +0x404
0xf231e3e0: /siebel/siebsrvr/lib/libsscaswbc.so!unsigned CSSServiceSWEIface::DoInvokeMethod(const unsigned short*,const CCFPropertySet&,CCFPropertySet&)() +0xa80
0xf969b1a4: /siebel/siebsrvr/lib/libsscfom.so!unsigned CSSService::InvokeMethod(const unsigned short*,const CCFPropertySet&,CCFPropertySet&)() +0x244
0xf9b616e4: /siebel/siebsrvr/lib/libsstcsiom.so!int CSSSIOMSession::ModInvokeSrvcMethod(const unsigned short*,const unsigned short*,const unsigned short*,SSstring&)() +0x124
0xf9b6881c: /siebel/siebsrvr/lib/libsstcsiom.so!int CSSSIOMSession::RPCMiscModel(SISOMRPCCode,SISOMArgType,unsigned long,CSSSISOMRPCArgList*,CSSSISOMRPCArgList*,int&,void*)() +0x5bc
0xf9b5efb8: /siebel/siebsrvr/lib/libsstcsiom.so!int CSSSIOMSession::HandleRPC(SISOMRPCCode,SISOMArgType,unsigned long,CSSSISOMRPCArgList*,CSSSISOMRPCArgList*,int&,void*)() +0xb98
0xfa5144f8: /siebel/siebsrvr/lib/libsssasos.so!unsigned CSSClient::HandleOMRPC(CSSClientReq*)() +0x78
0xfa511698: /siebel/siebsrvr/lib/libsssasos.so!unsigned CSSClient::HandleRequest(CSSClientReq*)() +0x2f8
0xfa50c3e4: /siebel/siebsrvr/lib/libsssasos.so!unsigned _IsThreadPoolEnabled(const bool,const void*,bool&)() +0x8c4
0xfa50d45c: /siebel/siebsrvr/lib/libsssasos.so!int SOMMTServer::SessionHandleMsg(smiSisReq*)() +0x1bc
0x1ff7ac: /siebel/siebsrvr/bin/siebmtshmw!int smiMainThread::CompSessionHandleMsg(smiSisReq*)() +0x16c
0x2237fc: /siebel/siebsrvr/bin/siebmtshmw!int smiMessageQ::ProcessMessage(smiMsgQItem*,long,int)() +0x93c
0x2220c4: /siebel/siebsrvr/bin/siebmtshmw!int _smiMessageQ::ProcessRequest(void*,void*,void*&)() +0x244
0x216774: /siebel/siebsrvr/bin/siebmtshmw!int _smiWorkQueue::ProcessWorkItem(void*,void*,void*&)() +0xd4
0x2161e0: /siebel/siebsrvr/bin/siebmtshmw!int _smiWorkQueue::WorkerTask(void*)() +0x300
0x20428c: /siebel/siebsrvr/bin/siebmtshmw!int
It is stopped at the above line since a long time.
And one more observation I made is.
In the same applet for a normal other query, the working trace is as follows.
0x2161e0: /siebel/siebsrvr/bin/siebmtshmw!int _smiWorkQueue::WorkerTask(void*)() +0x300
0x20428c: /siebel/siebsrvr/bin/siebmtshmw!int SmiThrdEntryFunc(void*)() +0x46c
0xfe75be88: /siebel/siebsrvr/lib/libsslcosd.so!void*OSDInstallHook(OSDHK,void*)() +0x2a8
0xfe195730: /siebel/siebsrvr/mw/lib/libmfc400su.so!unsigned _AfxThreadEntry(void*)() +0x100
0xfcdf1288: /siebel/siebsrvr/mw/lib/libkernel32.so!void MwThread(void*)() +0x23c
0xfc8c4990: /lib/libc.so.1!_thr_slot_offset() +0x468
ObjMgrSqlCursorLog Prepare 5 00045fbb4a414cc9:0 2009-07-27 15:03:01 Begin: PrepareStmt for Sql Cursor at 9c30618
ObjMgrSqlCursorLog Prepare 5 00045fbb4a414cc9:0 2009-07-27 15:03:01 End: PrepareStatement for Sql Cursor at 9c30618
ObjMgrSqlLog Detail 4 00045fbb4a414cc9:0 2009-07-27 15:03:01
***** SQL Statement Prepare Time for SQL Cursor with ID 9C30618: 0.002 seconds *****
This statement is executed in within a second from UI applet.
Please look into this.
Edited by: user4619223 on Jul 27, 2009 3:05 PM -
Select Query Hangs / No DB Locks / Query Plan is good
I have below query in application which hangs ( Only sometimes ) and there are some session which also try to insert data into this tables also starts getting hanged.
SELECT DISTINCT F2 || ' - ' || F3 || ' - ' || F4
FROM Table1
WHERE F4 = 6160
AND F1|| F2|| F3 NOT IN (
SELECT F2|| F3 || F4
FROM Table2
WHERE F1 = 181)
F2 - varchar(4)
F3- varchar(100)
F4- varchar(20)
F1,F1 are NUMBER
Table1 has one unique index comprising all fields in ORDER F1,F2, X,F3, F4,Y - X,Y are some different field.
Table2 has one unique index comprising all fields in ORDER F1,F3, F4,F2 are some different field.
Below are facts from DBA ----
1- Session Query Plan was excellent -
2 - No tables were locked in DB
3 - Statistics on this table Table1 was calculated on Feb, 2008 and shows 8 millions rows but actual current row count is 13 million. DBA says sometime analyzing statistics again may cause poor query performance.
4- There were 8 session in DB, 1 was for above select statement and other 7 were trying to insert data into above table.
Can you please advise what could else be verified to root cause issue as it has been hanging many times - hence causing other session to hang ?
Many ThanksCan you clarify exactly what the DBA meant by "No tables were locked in DB"? What was the exact query that was used to determine this? Was it hitting V$LOCK (GV$LOCK in a RAC system)? Or the DBA_BLOCKERS and DBA_WAITERS tables? Or something else? The specific query here is important because there is a world of difference between a row-level lock and a table-level lock. Of course, locks would never prevent a SELECT statement from running, but it could cause problems for the INSERT statements.
I strongly concur with Old DBA's suggestion about refactoring the query to not do the concatenation in the NOT IN clause.
Are the F4 = 6160 and F1 = 181 conditions really using hard-coded numeric literals? Or are these bind variables? Is the data in F1 or F4 skewed-- that is, are there certain values that are more likely than other values?
How many rows would you expect to be in Table1 with an F4 value of 6160? How many rows in Table2 with a F1 value of 181?
Justin -
Query hanging when queries in the resultset of UNION returned no rows
Hi all,
I have a query like this.
Select * from table a
UNION
select * from table b
UNION
select * from table c
UNION
select * from table d
table a, table b, table c has some rows of data.
table d does'nt have any data.
so,
when i do union
of results of table a,table b and table c, I will get the results.
But when I include the UNION of table d(which is not having rows), Then the query is hanging.
Please help me in this regard.
Thanks in advance,
Sreekeshava SPlease find the query below.
select nn.node_name as nn_node_name,
t.template_name as t_template_name,
decode(status_flag, 0, 'NO', 'YES')
from opc_node_names nn, opc_source_templ t,
opc_node_config c, opc_change_status s
where nn.node_id = c.node_id
and c.node_id = s.object_id
and c.template_id = t.template_id
and s.object_type = 1
and s.status_type = 1
and s.value != 4
and s.value != 5
and nn.node_id not in (select node_id from opc_nodes where is_virtual=1)
union
select nn.node_name as nn_node_name,
t.template_name as t_template_name,
'Yes (Force)'
from opc_node_names nn, opc_source_templ t,
opc_node_config c, opc_change_status s
where nn.node_id = c.node_id
and s.object_id = c.node_id
and c.template_id = t.template_id
and s.object_type = 1
and s.status_type = 1
and s.value in (4, 5)
and nn.node_id not in (select node_id from opc_nodes where is_virtual=1)
union
select nn.node_name as nn_node_name,
t.template_name as t_template_name,
'(Virtual Node)'
from opc_node_names nn, opc_source_templ t,
opc_node_config c, opc_change_status s
where nn.node_id = c.node_id
and s.object_id = c.node_id
and c.template_id = t.template_id
and s.object_type = 1
and s.status_type = 1
and nn.node_id in (select node_id from opc_nodes where is_virtual=1)
union
select 'Management Server' as nn_node_name,
t.template_name as t_template_name,
decode(status_flag, 0, 'NO', 'YES')
from opc_source_templ t, opc_node_config c, opc_change_status s
where c.node_id is null
and c.template_id = t.template_id
and s.object_type = 1
and s.status_type = 1
and s.object_id = '000000000000000000000000000000000000'
and s.value != 4
and s.value != 5
union
select 'Management Server' as nn_node_name,
t.template_name as t_template_name,
'Yes (Force)'
from opc_source_templ t, opc_node_config c, opc_change_status s
where c.node_id is null
and c.template_id = t.template_id
and s.object_type = 1
and s.status_type = 1
and s.object_id = '000000000000000000000000000000000000'
and s.value in (4, 5)
In the above query,
only first 2 select select statements is having some data.
Next select statements does'nt return any data.
If we execute the select queries from the above query independently, It will execute within no time.
as i told only first 2 queries are having the data.
other sql queries does'nt have any data.
But if i union all the queries, query is hanging.
I am executing the query through SQL developer connecting to the database located in the Remote location. -
Query hangs using db link and nested table collection
Hi,
I have a stored procedure which takes, as input, a string of values that can vary in length. The input is used as an IN operator within the queries that exist within the proc:
Code:
PROCEDURE get_contacts (i_customerids IN VARCHAR2)
an example of the input would be: '987451',412897' or '7541256','75412','95412589'
In order to process the dynamic "In-List", I created a custom collection type to convert the string to a table:
Code:
CREATE OR REPLACE
TYPE stringtotable AS TABLE OF VARCHAR2(3900)
(I've also tried the solutions on http://tkyte.blogspot.com/2006/06/varying-in-lists.html and http://fdegrelle.over-blog.com/article-1694534-6.html for handling dynamic in-lists and they also hang)
The proc contains 2 queries, the first returns records from a table within the current database:
Code:
SELECT *
FROM contacts
WHERE customer_id IN (
SELECT *
FROM TABLE (stringtotable (i_customerids
The second query returns records from a database that is defined via a db link:
Code:
SELECT b.customer_id, a.row_id, a.fst_name, a.last_name
FROM userlist.customers@uldblink a, userlist.firms@ulbdlink b
WHERE a.parent_id = b.row_id
AND b.customer_id IN (
SELECT *
FROM TABLE (stringtotable (i_customerids
The first query is executing without issue. The second query, however, is hanging indefinitely. Additionally, If I hard code the string in the IN operator, the second query executes without issue.
I am not the DBA for the database, so I don't currently have access to the trace logs. I've requested access to the trace logs to see if I can figure out what is hanging.
In the meantime, I was hoping someone would be able to tell me if
a: there is a better way to handle "dynamic in- lists".
or
b: if there is something obvious that I'm not considering.
Thanks for your help,
Fielding
Message was edited by:
fwilsonHi Todd,
Thanks for the suggestion. I was not aware of the cardinality hint.
I tried adding it to my query but unfortunately the query still appeared to hang. It did get me thinking though... that maybe the stringtotable collection type is creating the table in memory, and therefore its records aren't accessible to the dblink
so I inserted the values that were being returned via the stringtotable collection type into a physical table named TestTable. I then modified my query to select the values from TestTable.
Code:
...in (select /*+ cardinality(t 3) */ t.*
from testtable t)
This worked.
So that poses the questions-
a: is my assumption about the in-memory table correct
and
b: if so is there a way around it?
Thanks for your help -
Query Hangs in Apex but runs quickly in SQL
Hi,
I'm using Apex version 4.1.
I have an interactive report that just hangs when I run it, but the query runs in about 19 seconds in AquaData when I hard-code my bind variables. The bind variables are a start and end date, and they are used twice to pull a date range from two different fields. I'm wondering if the bad performance has something to do with that? I have to call the start and end date twice in my query. Even when I try Debug or SQL Commands in Apex it just hangs.
Any ideas on how to improve this?
Thanks for your help.Greg,
You wrote: but the query runs in about 19 seconds in AquaData when I hard-code my bind variables.Do those same hard-coded bind variables not execute in SQL Commands ?
Here is your code formatted so others may see something that I am not seeing: Then again; where does the alias qce come from?
SELECT f.fac_id AS "Office ID",
f.fac_name AS "Office Name",
SUM(CASE
WHEN ADD_MONTHS ( pt.date_posted, - ( 12 * 18 ) ) >=
p.date_of_birth
THEN
1
ELSE
0
END)
AS "Adult Pat Count",
ROUND (
NVL (
SUM(CASE
WHEN ADD_MONTHS ( pt.date_posted,
- ( 12 * 18 ) ) >=
p.date_of_birth
THEN
1
ELSE
0
END)
/ COUNT ( * ),
0
2
* 100
AS "Adult Pat %",
SUM(CASE
WHEN ADD_MONTHS ( pt.date_posted, - ( 12 * 18 ) ) <=
p.date_of_birth
THEN
1
ELSE
0
END)
AS "Pedo Pat Count",
ROUND (
SUM(CASE
WHEN ADD_MONTHS ( pt.date_posted, - ( 12 * 18 ) ) <=
p.date_of_birth
THEN
1
ELSE
0
END)
/ COUNT ( * ),
2
* 100
AS "Pedo Pat %",
SUM(CASE
WHEN ADD_MONTHS ( pt.date_posted, - ( 12 * 18 ) ) >=
p.date_of_birth
THEN
pt.amount_tot
ELSE
0
END)
AS "Adult Rev",
DECODE (
SUM ( pt.amount_tot ),
0,
0,
ROUND (
NVL (
SUM(CASE
WHEN ADD_MONTHS ( pt.date_posted,
- ( 12 * 18 ) ) >=
p.date_of_birth
THEN
pt.amount_tot
ELSE
0
END)
/ SUM ( pt.amount_tot ),
0
2
* 100
AS "Adult Rev %",
SUM(CASE
WHEN ADD_MONTHS ( pt.date_posted, - ( 12 * 18 ) ) <=
p.date_of_birth
THEN
pt.amount_tot
ELSE
0
END)
AS "Pedo Rev",
DECODE (
SUM ( pt.amount_tot ),
0,
0,
ROUND (
NVL (
SUM(CASE
WHEN ADD_MONTHS ( pt.date_posted,
- ( 12 * 18 ) ) <=
p.date_of_birth
THEN
pt.amount_tot
ELSE
0
END)
/ SUM ( pt.amount_tot ),
0
2
* 100
AS "Pedo Rev %"
FROM pats p
JOIN
clinic_ext ce
ON p.clinic_id = ce.clinic_id AND p.loc_id = ce.loc_id
JOIN
pat_trans_rep pt
ON p.clinic_id = pt.clinic_id
AND p.unique_id = pt.unique_id
AND pt.charge_yn = 'Y'
JOIN
fac_hier_links fk
ON qce.fac_id = fk.fac_id
JOIN
fac f
ON qce.fac_id = f.fac_id
WHERE p.date_of_first_visit BETWEEN TO_DATE ( :p5_start_date,
'MM/DD/YYYY' )
AND TO_DATE ( :p5_end_date,
'MM/DD/YYYY' )
AND pt.date_posted BETWEEN TO_DATE ( :p5_start_date, 'MM/DD/YYYY' )
AND TO_DATE ( :p5_end_date, 'MM/DD/YYYY' )
GROUP BY f.fac_id, f.fac_nameJeff
Edited by: jwellsnh on Sep 15, 2011 1:49 PM -
Dear Gurus,
I am using a cube, and do reporting, let say cube contain:
Posting Date
Sales Organization
Distribution Chanel
Division
In Query i used only Posting as variable, and in Cube we have 12 milion records, query run very fast with only Posting Date as variable in selection.
But from the day i put Sales Org, Distribution Chanel, Divsion into selection screen of query as well. so If user enter posting date only it execute very fast, but when user specify Sales Org, then system run very long time.
I check ABAP job, i saw that CL_SQL_RESULT_SET=============CP take a lot of time, of course under that function is ABAP query with many join....
Would you tell me what happen, i have created index for infocube and "Refresh DB Statistic". But seems it still low.
IS there any missing in any setting, why just only Sales Org (4 Char) included in selection then make system hange on.
Thanks and Regards,
KIMC.Dear Yang,
I copied here to share in forum.
<<<<<<<<<<_Case Good Once_>>>>>>>>>>>>>
CREATE OR REPLACE VIEW "/BI0/0300000004" AS
SELECT
/*+ NO_QUERY_TRANSFORMATION */
"DU"."SID_0DOC_CURRCY" AS "S____085"
,"DU"."SID_0SALES_UNIT" AS "S____106"
,"D3"."SID_0BILL_DATE" AS "S____076"
,"D3"."SID_YMAT_TYPE" AS "S____114"
, SUM ( "F"."COST" ) AS "Z____339"
, SUM ( "F"."INV_QTY" ) AS "Z____137"
, SUM ( "F"."NETVAL_INV" ) AS "Z____138"
, SUM ( "F"."TAX_AMOUNT" ) AS "Z____139"
, COUNT( * ) AS "Z____051"
, SUM ( "F"."/BIC/YSALES_UP" ) AS "Z____424"
FROM
"/BIC/FYSD_CO3D" "F" JOIN "/BIC/DYSD_CO3DU" "DU" ON
"F" . "KEY_YSD_CO3DU" = "DU" . "DIMID"
JOIN "/BIC/DYSD_CO3D3" "D3" ON
"F" . "KEY_YSD_CO3D3" = "D3" . "DIMID"
JOIN "/BIC/DYSD_CO3DP" "DP" ON
"F" . "KEY_YSD_CO3DP" = "DP" . "DIMID"
JOIN "/BIC/DYSD_CO3D2" "D2" ON
"F" . "KEY_YSD_CO3D2" = "D2" . "DIMID"
WHERE
( ( ( ("DP"."SID_0CHNGID" = 0 ) ) AND ( ("DP"."SID_0RECORDTP"= 0 ) ) AND
( ("DP"."SID_0REQUID" <= 82455 ) ) AND ( ("D2"."SID_0SALESORG"= 12 ) ) AND
( ("D3"."SID_YIP_DATE"= 20100507 ) ) AND ( ("D3"."SID_YMAT_TYPE" IN (2 , 3 , 4 , 5 , 6 , 7) ) ) ) )
GROUP BY
"DU"."SID_0DOC_CURRCY" ,"DU"."SID_0SALES_UNIT"
,"D3"."SID_0BILL_DATE" ,"D3"."SID_YMAT_TYPE"
<<<<<<<<<<<<<<Case Hanging Out once>>>>>>>>>
SELECT
/*+ STAR_TRANSFORMATION FACT(F) */
"DU"."SID_0DOC_CURRCY" AS "S____085"
,"DU"."SID_0SALES_UNIT" AS "S____106"
,"D3"."SID_0BILL_DATE" AS "S____076"
,"D3"."SID_YMAT_TYPE" AS "S____114"
, SUM ( "F"."COST" ) AS "Z____339"
, SUM ( "F"."INV_QTY" ) AS "Z____137"
, SUM ( "F"."NETVAL_INV" ) AS "Z____138"
, SUM ( "F"."TAX_AMOUNT" ) AS "Z____139"
, COUNT( * ) AS "Z____051"
, SUM ( "F"."/BIC/YSALES_UP" ) AS "Z____424"
FROM
"/BIC/FYSD_CO3D" "F" JOIN "/BIC/DYSD_CO3DU" "DU" ON
"F" . "KEY_YSD_CO3DU" = "DU" . "DIMID"
JOIN "/BIC/DYSD_CO3D3" "D3" ON
"F" . "KEY_YSD_CO3D3" = "D3" . "DIMID"
JOIN "/BIC/DYSD_CO3DP" "DP" ON
"F" . "KEY_YSD_CO3DP" = "DP" . "DIMID"
JOIN "/BIC/DYSD_CO3D2" "D2" ON
"F" . "KEY_YSD_CO3D2" = "D2" . "DIMID"
WHERE
( ( ( ( "DP"."SID_0CHNGID" = 0 ) ) AND ( ( "DP"."SID_0RECORDTP" = 0 ) ) AND
( ( "DP"."SID_0REQUID" <= 82455 ) ) AND ( ( "D2"."SID_0SALESORG" = 12 ) ) AND
( ( "D3"."SID_YIP_DATE" = 20100507 ) ) AND ( ( "D3"."SID_YMAT_TYPE" IN ( 2 , 3 , 4 , 5 , 6 , 7) ) ) ) )
GROUP BY
"DU"."SID_0DOC_CURRCY" ,"DU"."SID_0SALES_UNIT"
,"D3"."SID_0BILL_DATE" ,"D3"."SID_YMAT_TYPE"
Is there any hint like Query Transformation >>> Can you suggest.
Thanks and Regards,
KIMC.
Maybe you are looking for
-
Errors during upgrade/installation af icloud 4.02
When I try to upgrade icloud 3.1 to 4.02 with Apple Software Update I get this error message: There were errors during the installation of the updates. If the problem persists, choose Tools> Download Only and try installing manually. When I try to in
-
I had very little memory on my C drive and had to remove some programs to free some up but by accident i removed Apple applications support. How do i put it back on or do i have to remove and re-install the whole itunes program to get it to work agai
-
What format i should use for my external hard drive that can be used interchangeably between mac and pc?
-
Hi folks, I have a stack of MiniDV tapes which I have imported into FCP, these were a series of films made by a hospital. I have joined the footage together in FCP where necessary, giving me a series of films ranging from 40 minutes to an hour and 40
-
Problem of java stored procedure
hi, now I use the oracle9i JDeveloper9.0.3.1 to develop java stored procedure and then publish it to oracle9i database. In the database I create PL/SQL procedure to invoke the java stored procedure.But I encounter the problem,that is ,when I run the