Sql is running for ever
We have one report which will process every night which is running good from couple of years. Today that report is running for ever. I extrated sql from that report and if I run that sql by giving * after select, it is giving result with in one minute. If I run the sql by selecting column names, it is running for ever. Our daily report will run by selecting few columns from three tables. We are using choose based optimizer.
But when I run the same query by selecting the columns, with yesterday, I will get the output with in one minute. If I run the same query for today's date, getting that problem. But we had almost more than 10 thousand transactions over night. Not sure whether I need to run compute statistics on those tables which can fix the problem.
Pls advice how to fix this. Our db is 9i.
Thanks in advance.
Hari Babu
Edited by: user6367891 on Oct 8, 2009 12:55 PM
Pl also see HOW TO: Post a SQL statement tuning request - template posting
The information you have posted so far is insufficient to make any kind of diagnosis.
HTH
Srini
Similar Messages
-
Dbms_scheduler job neither succeeds nor errors its just keep running for ever
Hi All,
I am trying to run a shell script from plsql using the dbms_scheduler, job is getting created and it keeps running for ever without success or error.
Can some please help me where I am doing the mistake.
Thanks
DB Version:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
PL/SQL Release 10.2.0.5.0 - Production
Plsql Script:
BEGIN
DBMS_SCHEDULER.create_job (
job_name => 'SFTP_PAYMENTECH_BATCHID1',
job_type => 'EXECUTABLE',
job_action => '/app07/ebdev/ebdevappl/xxtpc/bin/test.sh',
number_of_arguments => 1,
enabled => FALSE,
auto_drop => TRUE,
comments => 'SFTP Batch File to Paymentech');
DBMS_OUTPUT.put_line (
'Job Created Successfully:' || 'SFTP PAYMENTECH BATCHID');
fnd_file.put_line (
fnd_file.output,
'Job Created Successfully:' || 'SFTP PAYMENTECH BATCHID');
COMMIT;
DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE (
job_name => 'SFTP_PAYMENTECH_BATCHID1',
argument_position => 1,
argument_value => '66667' /*v_printer_name*/
DBMS_SCHEDULER.enable (name => 'SFTP_PAYMENTECH_BATCHID1');
EXCEPTION
WHEN OTHERS
THEN
fnd_file.put_line (fnd_file.output,
'Error while creating the Job:' || SQLERRM);
DBMS_OUTPUT.put_line ('Error while creating the Job:' || SQLERRM);
END;
Shell Script which I am calling:
#!/usr/bin/ksh
FILENAME=$1
PMTHOST=198.xx.xx.xx
PMTUSER=xxxxx
PMTPW=xxxxx
a='apps'
b='xxxxxx'
c='EBDEV'
INST=`echo $TWO_TASK | sed 's/_BALANCE//'`
echo INSTANCE: $INST
echo
File_Path=$XXTPC_TOP/iby/out
echo File Name: $FILENAME
echo $PMTHOST
echo $PMTUSER
echo
echo Date: `date`
echo
echo File System User: `whoami`
echo
echo Instance: $TWO_TASK
echo
echo File_Path: $File_Path
echo
echo PMT SFTP
# Fetch file using MBATCHID as File Name
cd $File_Path
echo
echo -----------------------------------------------
echo
echo Current File :$FILENAME
l_date_time=`date +%Y%m%d%H%M%S`
echo SFTP Remittance File
# sftp $PMTUSER@$PMTHOST << EOF
lftp -u $PMTUSER,$PMTPW sftp://$PMTHOST << EOF
lcd $File_Path
cd test/945299
put $FILENAME
exit
EOF
#`sqlplus -s apps/tpcdev2013@EBDEV @try.sql $FILENAME`Have you tried running the script manually to confirm it isnt just hanging on input for the lftp ?
You could add a -o <file> to the lftp command line which would output debug info into <file> so you could see.
Creation of the job looks fine so as GregV said, what output do you have in ALL_SCHEDULER_RUNNING_JOBS and any ADDITIONAL_INFO in the ALL_SCHEDULER_JOB_RUN_DETAILS or in $ORACLE_HOME/scheduler/log that might indicate what the problem is ?
If this answer was helpful, please mark as helpful answer. -
Query runs for ever - suggestions - ideas - tips
Hello all,
I have the following situation:
1) Database 1: XE 10g Release 10.2.0.1.0 - Production
2) Database 2: 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
3) Dblink from Database 1 pointing to Database 2
4) Synonyms created withing Database 1, pointing to Database 2 packages and tables:
- "mytable1" exists in Database 2 therefore a synonym "mytable1" is created in Database 1
- "mytable2" exists in Database 2 therefore a synonym "mytable2" is created in Database 1
- "mypackage" exists in Database 2 therefore a synonym "mypackage" is created in Database 1
5) Of course select and execute rights are granted
6) Query:
SELECT field1
FROM myshcema.mytable1
WHERE field2 = myshcema.mypackage.myfunction ('PARAMVALUE'))
AND EXISTS (SELECT 1 FROM myshcema.mytable2 WHERE field_in_tab2 = field_in_tab1)
7) Problem.This query runs for ever
8) Explain plan
OPERATION - OBJECT_NAME - OPTIONS - COST
SELECT STATEMENT - - - 17
-> FILTER - - -
-> -> FILTER - - - 3
-> -> -> REMOTE - mytable1 - -
-> -> REMOTE - mytable2 - - 1
9) Now I get the value returned by the function and re-execute the previous query:
- select myshcema.mypackage.myfunction ('PARAMVALUE')) from dual;
- return value is *89787621*
- re-executing the query:
SELECT field1
FROM myshcema.mytable1
WHERE field2 = *89787621*
AND EXISTS (SELECT 1 FROM myshcema.mytable2 WHERE field_in_tab2 = field_in_tab1)
10) Explain plan
OPERATION - OBJECT_NAME - OPTIONS - COST
SELECT STATEMENT - - REMOTE - 3
-> NESTED LOOPS - - SEMI - 3
-> -> INDEX - MY_UK_NAME - RANGE SCAN - 3
-> -> INDEX - MY_2ND_UK - UNIQUE SCAN - 0
And the results are instantaneous
Now my question: Can somebody direct me on whether a hint or something else will correct this situation? Due to restrictions that I cannot currently explain here, I am not able to change the code to first get the value and then execute the query.
Thanks for helping
G
Edited by: G on May 17, 2011 9:07 AM
Edited by: G on May 17, 2011 9:10 AMI would think the driving site hint woud be the frist thing I tried. If for some reason Oracle does not seem to be able to use the hint or if hints are heavily frowned on at your site then here is another approach to the problem.
Code the query into a view and define the view on the remote database then issues a local query against the remote view.
HTH -- Mark D Powell -- -
My sql query running for more than 4 hours could some one please help me
Hi ,
I have one sql executable and the query is running for more than 4 hours . Could some one please help me in tuning the sql.
The stats and all the general stuff is intact at db level :
SELECT pasl.item_id item_id
, pv.vendor_name vendor_name
, msif.segment1 item
, NVL(cic.item_cost,0) item_cost
, NVL(pasl.attribute1,0) asl_cost
FROM apps.mtl_system_items_b msif
, apps.po_approved_supplier_list pasl
, apps.cst_item_cost_type_v cic
, apps.po_vendors pv
, apps.po_asl_statuses past
, apps.mtl_item_categories mic
, apps.mtl_categories_b mc
, apps.mtl_category_sets_b mcb
, apps.mtl_category_sets_b mcbm
, apps.mtl_categories_b mcm
, apps.mtl_item_categories micm
WHERE pasl.item_id = msif.inventory_item_id
AND msif.inventory_item_id = cic.inventory_item_id
AND msif.inventory_item_status_code in ('Active','ENG HOLD')
AND cic.cost_type = 'Frozen'
AND msif.organization_id = cic.organization_id
AND EXISTS (SELECT 1
FROM apps.mtl_system_items_b msin,
apps.mtl_parameters mpn,
apps.org_organization_definitions oodn
WHERE msin.organization_id = mpn.organization_id
AND mpn.organization_id = oodn.organization_id
AND msin.inventory_item_id = msif.inventory_item_id
AND oodn.operating_unit = :p_ou
AND cic.organization_id = 87
AND NVL(pv.end_date_active,TRUNC(SYSDATE+1)) > TRUNC(SYSDATE)
AND pv.vendor_id = pasl.vendor_id
AND mcbm.structure_id = mcm.structure_id
AND nvl(mcm.start_date_active, (SYSDATE - 1)) < SYSDATE
AND nvl(mcm.end_date_active, (SYSDATE + 1)) > SYSDATE
AND mcbm.category_set_id = 1
AND micm.inventory_item_id = msif.inventory_item_id
AND micm.organization_id = msif.organization_id
AND micm.category_set_id = mcbm.category_set_id
AND micm.category_id = mcm.category_id
AND (SUBSTR(mcm.segment1,1,2) = 'FG' OR msif.item_type LIKE 'FG%')
AND mcm.segment3 NOT IN ('4','5','9','A')
AND mcb.structure_id = mc.structure_id
AND NVL(mc.start_date_active, (SYSDATE - 1)) < SYSDATE
AND nvl(mc.end_date_active, (SYSDATE + 1)) > SYSDATE
AND mcb.category_set_id = 1100000022
AND mic.inventory_item_id = msif.inventory_item_id
AND mic.organization_id = msif.organization_id
AND mic.category_set_id = mcb.category_set_id
AND mic.category_id = mc.category_id
AND SUBSTR(mc.segment2,1,2) = pv.attribute6
AND ROUND(NVL(pasl.attribute1,0),2) <> ROUND(NVL(cic.item_cost,0),2)
AND pasl.asl_status_id = past.status_id
AND UPPER(past.status) = 'APPROVED'
--and pv.attribute6 not in('IN','BG','CT')
and msif.inventory_item_id = :p_item_id42737
UNION
SELECT pasl.item_id item_id
, pv.vendor_name vendor_name
, msif.segment1 item
, NVL(cic.item_cost,0) item_cost
, NVL(pasl.attribute1,0) asl_cost
FROM apps.mtl_system_items_fvl msif
, apps.po_approved_supplier_list pasl
, apps.cst_item_cost_type_v cic
, apps.po_vendors pv
, apps.po_asl_statuses past
, apps.mtl_item_categories mic
, apps.mtl_categories_b mc
, apps.mtl_category_sets_b mcb
, apps.mtl_category_sets_b mcbm
, apps.mtl_categories_b mcm
, apps.mtl_item_categories micm
WHERE pasl.item_id = msif.inventory_item_id
AND msif.inventory_item_id = cic.inventory_item_id
AND msif.inventory_item_status_code in ('Active','ENG HOLD')
AND cic.cost_type = 'Frozen'
AND msif.organization_id = cic.organization_id
AND EXISTS (SELECT 1
FROM apps.mtl_system_items_b msin,
apps.mtl_parameters mpn,
apps.org_organization_definitions oodn
WHERE msin.organization_id = mpn.organization_id
AND mpn.organization_id = oodn.organization_id
AND msin.inventory_item_id = msif.inventory_item_id
AND oodn.operating_unit = :p_ou
AND cic.organization_id = 87
AND NVL(pv.end_date_active,TRUNC(SYSDATE+1)) > TRUNC(SYSDATE)
AND pv.vendor_id = pasl.vendor_id
AND mcbm.structure_id = mcm.structure_id
AND NVL(mcm.start_date_active,(SYSDATE - 1)) < SYSDATE
AND NVL(mcm.end_date_active, (SYSDATE + 1)) > SYSDATE
AND mcbm.category_set_id = 1
AND micm.inventory_item_id = msif.inventory_item_id
AND micm.organization_id = msif.organization_id
AND micm.category_set_id = mcbm.category_set_id
AND micm.category_id = mcm.category_id
AND (SUBSTR(mcm.segment1,1,2) = 'FG' OR msif.item_type LIKE 'FG%')
AND mcm.segment3 NOT IN ('4','5','9','A')
AND mcb.structure_id = mc.structure_id
AND NVL(mc.start_date_active,(SYSDATE - 1)) < SYSDATE
AND nvl(mc.end_date_active,(SYSDATE + 1)) > SYSDATE
AND mcb.category_set_id = 1100000022
AND mic.inventory_item_id = msif.inventory_item_id
AND mic.organization_id = msif.organization_id
AND mic.category_set_id = mcb.category_set_id
AND mic.category_id = mc.category_id
AND SUBSTR(mc.segment2,1,2) = pv.attribute6
AND pasl.asl_status_id = past.status_id
AND UPPER(past.status) = 'APPROVED'
--and pv.attribute6 not in('IN','BG','CT')
AND NVL(pasl.attribute1,0) = 0
AND NVL(cic.item_cost,0) != 0
and msif.inventory_item_id = :p_item_id42737
The execution plan displayed in taod is as below :
Plan
SELECT STATEMENT ALL_ROWSCost: 464 Bytes: 905 Cardinality: 2
140 SORT UNIQUE Cost: 464 Bytes: 905 Cardinality: 2
139 UNION-ALL
69 NESTED LOOPS Cost: 185 Bytes: 446 Cardinality: 1
67 NESTED LOOPS OUTER Cost: 180 Bytes: 444 Cardinality: 1
65 NESTED LOOPS Cost: 178 Bytes: 408 Cardinality: 1
63 NESTED LOOPS Cost: 177 Bytes: 404 Cardinality: 1
60 NESTED LOOPS Cost: 176 Bytes: 378 Cardinality: 1
57 NESTED LOOPS Cost: 174 Bytes: 353 Cardinality: 1
55 NESTED LOOPS Cost: 174 Bytes: 349 Cardinality: 1
53 NESTED LOOPS Cost: 174 Bytes: 342 Cardinality: 1
50 NESTED LOOPS Cost: 173 Bytes: 336 Cardinality: 1
48 NESTED LOOPS Cost: 173 Bytes: 332 Cardinality: 1
46 FILTER
45 NESTED LOOPS OUTER Cost: 171 Bytes: 322 Cardinality: 1
43 NESTED LOOPS Cost: 169 Bytes: 305 Cardinality: 1
41 NESTED LOOPS Cost: 168 Bytes: 292 Cardinality: 1
38 NESTED LOOPS Cost: 166 Bytes: 277 Cardinality: 1
36 NESTED LOOPS Cost: 166 Bytes: 273 Cardinality: 1
33 NESTED LOOPS Cost: 165 Bytes: 256 Cardinality: 1
30 NESTED LOOPS Cost: 162 Bytes: 237 Cardinality: 1
27 NESTED LOOPS Cost: 161 Bytes: 203 Cardinality: 1
24 NESTED LOOPS Cost: 159 Bytes: 185 Cardinality: 1
22 NESTED LOOPS Cost: 158 Bytes: 163 Cardinality: 1
19 NESTED LOOPS Cost: 156 Bytes: 117 Cardinality: 1
16 NESTED LOOPS Cost: 90 Bytes: 95 Cardinality: 1
13 NESTED LOOPS Cost: 49 Bytes: 72 Cardinality: 1
10 NESTED LOOPS Cost: 8 Bytes: 41 Cardinality: 1
8 NESTED LOOPS Cost: 3 Bytes: 30 Cardinality: 1
5 NESTED LOOPS Cost: 2 Bytes: 22 Cardinality: 1
2 TABLE ACCESS BY INDEX ROWID TABLE INV.MTL_CATEGORY_SETS_B Cost: 1 Bytes: 11 Cardinality: 1
1 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_CATEGORY_SETS_B_U1 Cost: 0 Cardinality: 1
4 TABLE ACCESS BY INDEX ROWID TABLE INV.MTL_CATEGORY_SETS_B Cost: 1 Bytes: 11 Cardinality: 1
3 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_CATEGORY_SETS_B_U1 Cost: 0 Cardinality: 1
7 TABLE ACCESS BY INDEX ROWID TABLE INV.MTL_DEFAULT_CATEGORY_SETS Cost: 1 Bytes: 8 Cardinality: 1
6 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_DEFAULT_CATEGORY_SETS_U1 Cost: 0 Cardinality: 1
9 TABLE ACCESS FULL TABLE PO.PO_ASL_STATUSES Cost: 5 Bytes: 11 Cardinality: 1
12 TABLE ACCESS BY INDEX ROWID TABLE INV.MTL_CATEGORIES_B Cost: 41 Bytes: 93 Cardinality: 3
11 INDEX RANGE SCAN INDEX INV.MTL__CATEGORIES_B_N2 Cost: 3 Cardinality: 1,426
15 TABLE ACCESS BY INDEX ROWID TABLE INV.MTL_CATEGORIES_B Cost: 41 Bytes: 92 Cardinality: 4
14 INDEX RANGE SCAN INDEX INV.MTL__CATEGORIES_B_N2 Cost: 3 Cardinality: 1,426
18 TABLE ACCESS BY INDEX ROWID TABLE INV.MTL_ITEM_CATEGORIES Cost: 65 Bytes: 22 Cardinality: 1
17 INDEX RANGE SCAN INDEX INV.MTL_ITEM_CATEGORIES_N3 Cost: 2 Cardinality: 293
21 TABLE ACCESS BY INDEX ROWID TABLE INV.MTL_SYSTEM_ITEMS_B Cost: 2 Bytes: 46 Cardinality: 1
20 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_SYSTEM_ITEMS_B_U1 Cost: 1 Cardinality: 1
23 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_ITEM_CATEGORIES_U1 Cost: 1 Bytes: 22 Cardinality: 1
26 TABLE ACCESS BY INDEX ROWID TABLE PO.PO_APPROVED_SUPPLIER_LIST Cost: 2 Bytes: 18 Cardinality: 1
25 INDEX RANGE SCAN INDEX PO.PO_APPROVED_SUPPLIER_LIST_N1 Cost: 1 Cardinality: 1
29 TABLE ACCESS BY INDEX ROWID TABLE PO.PO_VENDORS Cost: 1 Bytes: 34 Cardinality: 1
28 INDEX UNIQUE SCAN INDEX (UNIQUE) PO.PO_VENDORS_U1 Cost: 0 Cardinality: 1
32 TABLE ACCESS BY INDEX ROWID TABLE BOM.CST_ITEM_COSTS Cost: 3 Bytes: 19 Cardinality: 1
31 INDEX RANGE SCAN INDEX (UNIQUE) BOM.CST_ITEM_COSTS_U1 Cost: 2 Cardinality: 1
35 TABLE ACCESS BY INDEX ROWID TABLE BOM.CST_COST_TYPES Cost: 1 Bytes: 17 Cardinality: 1
34 INDEX UNIQUE SCAN INDEX (UNIQUE) BOM.CST_COST_TYPES_U1 Cost: 0 Cardinality: 1
37 INDEX UNIQUE SCAN INDEX (UNIQUE) BOM.CST_COST_TYPES_U1 Cost: 0 Bytes: 4 Cardinality: 1
40 TABLE ACCESS BY INDEX ROWID TABLE INV.MTL_SYSTEM_ITEMS_B Cost: 2 Bytes: 15 Cardinality: 1
39 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_SYSTEM_ITEMS_B_U1 Cost: 1 Cardinality: 1
42 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_SYSTEM_ITEMS_TL_U1 Cost: 1 Bytes: 13 Cardinality: 1
44 INDEX RANGE SCAN INDEX (UNIQUE) INV.MTL_ITEM_CATEGORIES_U1 Cost: 2 Bytes: 17 Cardinality: 1
47 INDEX RANGE SCAN INDEX (UNIQUE) INV.MTL_SYSTEM_ITEMS_B_U1 Cost: 2 Bytes: 30 Cardinality: 3
49 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_PARAMETERS_U1 Cost: 0 Bytes: 4 Cardinality: 1
52 TABLE ACCESS BY INDEX ROWID TABLE HR.HR_ALL_ORGANIZATION_UNITS Cost: 1 Bytes: 6 Cardinality: 1
51 INDEX UNIQUE SCAN INDEX (UNIQUE) HR.HR_ORGANIZATION_UNITS_PK Cost: 0 Cardinality: 1
54 INDEX UNIQUE SCAN INDEX (UNIQUE) HR.HR_ALL_ORGANIZATION_UNTS_TL_PK Cost: 0 Bytes: 7 Cardinality: 1
56 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_PARAMETERS_U1 Cost: 0 Bytes: 4 Cardinality: 1
59 TABLE ACCESS BY INDEX ROWID TABLE HR.HR_ORGANIZATION_INFORMATION Cost: 2 Bytes: 25 Cardinality: 1
58 INDEX RANGE SCAN INDEX HR.HR_ORGANIZATION_INFORMATIO_FK2 Cost: 1 Cardinality: 1
62 TABLE ACCESS BY INDEX ROWID TABLE HR.HR_ORGANIZATION_INFORMATION Cost: 1 Bytes: 26 Cardinality: 1
61 INDEX RANGE SCAN INDEX HR.HR_ORGANIZATION_INFORMATIO_FK2 Cost: 1 Cardinality: 1
64 INDEX FULL SCAN INDEX (UNIQUE) GL.GL_SETS_OF_BOOKS_U2 Cost: 1 Bytes: 4 Cardinality: 1
66 INDEX RANGE SCAN INDEX (UNIQUE) APPLSYS.FND_LOOKUP_VALUES_U1 Cost: 2 Bytes: 36 Cardinality: 1
68 TABLE ACCESS FULL TABLE APPLSYS.FND_PRODUCT_GROUPS Cost: 5 Bytes: 2 Cardinality: 1
138 NESTED LOOPS Cost: 278 Bytes: 459 Cardinality: 1
136 NESTED LOOPS Cost: 277 Bytes: 449 Cardinality: 1
134 NESTED LOOPS Cost: 277 Bytes: 445 Cardinality: 1
132 NESTED LOOPS Cost: 277 Bytes: 441 Cardinality: 1
129 NESTED LOOPS Cost: 275 Bytes: 415 Cardinality: 1
127 NESTED LOOPS Cost: 275 Bytes: 408 Cardinality: 1
124 NESTED LOOPS Cost: 274 Bytes: 402 Cardinality: 1
122 NESTED LOOPS Cost: 273 Bytes: 398 Cardinality: 1
120 MERGE JOIN CARTESIAN Cost: 268 Bytes: 373 Cardinality: 1
117 FILTER
116 NESTED LOOPS OUTER Cost: 263 Bytes: 371 Cardinality: 1
114 NESTED LOOPS Cost: 261 Bytes: 354 Cardinality: 1
112 NESTED LOOPS OUTER Cost: 260 Bytes: 341 Cardinality: 1
110 NESTED LOOPS Cost: 258 Bytes: 305 Cardinality: 1
107 NESTED LOOPS Cost: 256 Bytes: 290 Cardinality: 1
105 NESTED LOOPS Cost: 256 Bytes: 286 Cardinality: 1
102 NESTED LOOPS Cost: 255 Bytes: 269 Cardinality: 1
99 NESTED LOOPS Cost: 252 Bytes: 250 Cardinality: 1
97 NESTED LOOPS Cost: 251 Bytes: 237 Cardinality: 1
95 NESTED LOOPS Cost: 250 Bytes: 215 Cardinality: 1
93 NESTED LOOPS Cost: 249 Bytes: 193 Cardinality: 1
90 NESTED LOOPS Cost: 245 Bytes: 294 Cardinality: 2
87 HASH JOIN Cost: 230 Bytes: 387 Cardinality: 3
85 TABLE ACCESS BY INDEX ROWID TABLE INV.MTL_CATEGORIES_B Cost: 41 Bytes: 92 Cardinality: 4
84 NESTED LOOPS Cost: 90 Bytes: 95 Cardinality: 1
82 NESTED LOOPS Cost: 49 Bytes: 72 Cardinality: 1
79 NESTED LOOPS Cost: 8 Bytes: 41 Cardinality: 1
77 NESTED LOOPS Cost: 3 Bytes: 30 Cardinality: 1
74 NESTED LOOPS Cost: 2 Bytes: 22 Cardinality: 1
71 TABLE ACCESS BY INDEX ROWID TABLE INV.MTL_CATEGORY_SETS_B Cost: 1 Bytes: 11 Cardinality: 1
70 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_CATEGORY_SETS_B_U1 Cost: 0 Cardinality: 1
73 TABLE ACCESS BY INDEX ROWID TABLE INV.MTL_CATEGORY_SETS_B Cost: 1 Bytes: 11 Cardinality: 1
72 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_CATEGORY_SETS_B_U1 Cost: 0 Cardinality: 1
76 TABLE ACCESS BY INDEX ROWID TABLE INV.MTL_DEFAULT_CATEGORY_SETS Cost: 1 Bytes: 8 Cardinality: 1
75 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_DEFAULT_CATEGORY_SETS_U1 Cost: 0 Cardinality: 1
78 TABLE ACCESS FULL TABLE PO.PO_ASL_STATUSES Cost: 5 Bytes: 11 Cardinality: 1
81 TABLE ACCESS BY INDEX ROWID TABLE INV.MTL_CATEGORIES_B Cost: 41 Bytes: 93 Cardinality: 3
80 INDEX RANGE SCAN INDEX INV.MTL__CATEGORIES_B_N2 Cost: 3 Cardinality: 1,426
83 INDEX RANGE SCAN INDEX INV.MTL__CATEGORIES_B_N2 Cost: 3 Cardinality: 1,426
86 TABLE ACCESS FULL TABLE PO.PO_VENDORS Cost: 139 Bytes: 15,980 Cardinality: 470
89 TABLE ACCESS BY INDEX ROWID TABLE PO.PO_APPROVED_SUPPLIER_LIST Cost: 13 Bytes: 18 Cardinality: 1
88 INDEX RANGE SCAN INDEX PO.PO_APPROVED_SUPPLIER_LIST_N3 Cost: 1 Cardinality: 64
92 TABLE ACCESS BY INDEX ROWID TABLE INV.MTL_SYSTEM_ITEMS_B Cost: 2 Bytes: 46 Cardinality: 1
91 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_SYSTEM_ITEMS_B_U1 Cost: 1 Cardinality: 1
94 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_ITEM_CATEGORIES_U1 Cost: 1 Bytes: 22 Cardinality: 1
96 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_ITEM_CATEGORIES_U1 Cost: 1 Bytes: 22 Cardinality: 1
98 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_SYSTEM_ITEMS_TL_U1 Cost: 1 Bytes: 13 Cardinality: 1
101 TABLE ACCESS BY INDEX ROWID TABLE BOM.CST_ITEM_COSTS Cost: 3 Bytes: 19 Cardinality: 1
100 INDEX RANGE SCAN INDEX (UNIQUE) BOM.CST_ITEM_COSTS_U1 Cost: 2 Cardinality: 1
104 TABLE ACCESS BY INDEX ROWID TABLE BOM.CST_COST_TYPES Cost: 1 Bytes: 17 Cardinality: 1
103 INDEX UNIQUE SCAN INDEX (UNIQUE) BOM.CST_COST_TYPES_U1 Cost: 0 Cardinality: 1
106 INDEX UNIQUE SCAN INDEX (UNIQUE) BOM.CST_COST_TYPES_U1 Cost: 0 Bytes: 4 Cardinality: 1
109 TABLE ACCESS BY INDEX ROWID TABLE INV.MTL_SYSTEM_ITEMS_B Cost: 2 Bytes: 15 Cardinality: 1
108 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_SYSTEM_ITEMS_B_U1 Cost: 1 Cardinality: 1
111 INDEX RANGE SCAN INDEX (UNIQUE) APPLSYS.FND_LOOKUP_VALUES_U1 Cost: 2 Bytes: 36 Cardinality: 1
113 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_SYSTEM_ITEMS_TL_U1 Cost: 1 Bytes: 13 Cardinality: 1
115 INDEX RANGE SCAN INDEX (UNIQUE) INV.MTL_ITEM_CATEGORIES_U1 Cost: 2 Bytes: 17 Cardinality: 1
119 BUFFER SORT Cost: 266 Bytes: 2 Cardinality: 1
118 TABLE ACCESS FULL TABLE APPLSYS.FND_PRODUCT_GROUPS Cost: 5 Bytes: 2 Cardinality: 1
121 TABLE ACCESS FULL TABLE HR.HR_ORGANIZATION_INFORMATION Cost: 5 Bytes: 25 Cardinality: 1
123 INDEX FULL SCAN INDEX (UNIQUE) GL.GL_SETS_OF_BOOKS_U2 Cost: 1 Bytes: 4 Cardinality: 1
126 TABLE ACCESS BY INDEX ROWID TABLE HR.HR_ALL_ORGANIZATION_UNITS Cost: 1 Bytes: 6 Cardinality: 1
125 INDEX UNIQUE SCAN INDEX (UNIQUE) HR.HR_ORGANIZATION_UNITS_PK Cost: 0 Cardinality: 1
128 INDEX UNIQUE SCAN INDEX (UNIQUE) HR.HR_ALL_ORGANIZATION_UNTS_TL_PK Cost: 0 Bytes: 7 Cardinality: 1
131 TABLE ACCESS BY INDEX ROWID TABLE HR.HR_ORGANIZATION_INFORMATION Cost: 2 Bytes: 26 Cardinality: 1
130 INDEX RANGE SCAN INDEX HR.HR_ORGANIZATION_INFORMATIO_FK2 Cost: 1 Cardinality: 1
133 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_PARAMETERS_U1 Cost: 0 Bytes: 4 Cardinality: 1
135 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_PARAMETERS_U1 Cost: 0 Bytes: 4 Cardinality: 1
137 INDEX UNIQUE SCAN INDEX (UNIQUE) INV.MTL_SYSTEM_ITEMS_B_U1 Cost: 1 Bytes: 10 Cardinality: 1
Regards,
Siva.Welcome to the forums !
Pl post details of OS, database and EBS versions.
Pl see these threads on how to post a tuning request -
HOW TO: Post a SQL statement tuning request - template posting
When your query takes too long ...
HTH
Srini -
When upgrading to R12.1.1 script apilnupg.sql is running for 4 days
Script apilnupg.sql ran for almost 7 days and errored with unique constraint error,support given datafix and restarted again
now it is running for almost 4 days ...whether any performance issue of server wheter any specific init parameters need to set
and another R12.1.3 instance with 11.2.0.2 DB is running on same server
Solaris 10 -- DB and CM/admin ---
Linux --forms/web
Can anyone please help meI applied latest patch and tried to run patch again but still script taking 4 days to complete
Whether it is performance of server ,hardware ,already other instance R12.1.3 running on same server
our solaris sparc III 900 MHz -
What are the areas impact query to run for ever/long?
Hi All,
When I have to talk about long running scripts or procedures I focus on DTA which suggests on Indexing and infact I think this is the main cause. What are the other areas which we need to consider for Long running queries and troubleshooting tools we need
to use do you think?
Ofcourse blocking impacts but am purely thinking at query perspective.
Thanks
SwapnaWhat are the other areas which we need to consider for Long running queries and troubleshooting tools we need to use do you think?
One of the reasons is blocking. Please take a look at these links:
INF: Understanding and resolving SQL Server blocking problems
Troubleshoot Slow-Running Queries In SQL Server
T-SQL Articles
T-SQL e-book by TechNet Wiki Community
T-SQL blog -
Materialised view runs for ever ...
Hi
I'd appreciate if someone could shine some light on an issue I'm having with a materialised view.
I inherited this when I came into my current project, so before you ask me why tables are not partitioned or why a MV is being used for such a scenario, the answer is I don't know!!
Anyway ... I'm using "Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod" running on SUSE ...
There are a number of normalised tables two of which contain in the region of 400million rows each and tend to grow at the rate of 27000 rows per day.
There's a materialised view (for the purposes of providing fast interactive reporting) that is setup as a normal join between 4 tables; the above two and the other two are just basic dictionary type lookups each containing around 100 or so rows.
SELECT .... FROM LargeTable1, LargeTable2, Lookup3, Lookup4 WHERE Lookup3.ID=LargeTable1.LID and LargeTable2.ID=LargeTable1.ID and LargeTable2.LID=Lookup4.ID ;
Running a FULL refresh on the MV failes with a 'ora-01555 snapshot too old' error after about 5 days!! Then takes around the same amount of time to rollback. Can't do a FAST refresh, I think because logs and/or mv indecies are out of sync.
Table space is 63% full and undo space is set to auto-extend.
I've tried /*+RULE */ but that doesn't seem to make a huge difference.
Why does it take so long? Why does it fail? What can I do to speed it up?
Thanks in advance for your assistance.
Edited by: 883758 on Sep 7, 2011 2:16 PMYou should approach this as a SQL tuning exercise, without the ability to change the query itself.
Are table statistics up to date? Look at the execution plan – does it look reasonable for you? Are there any indexes that can help? (I am thinking covering indexes on the large tables …)
Iordan Iotzov
http://iiotzov.wordpress.com/ -
Job running for ever...
Hi Gurus,
I created a generic extractor and when execute it using RSA3 transaction in SRM, is OK.
When i execute the function module is also OK.
When i start a job (infopackage) using this extractor, the records are load in BI but the job still running...
I saw in SM5O that the work process is reading a ROIS table...
Why it it taking so long...it has only 20 records.
Appreciate your response.
Thanks,
rCm.Hi,
When a BI load takes long time to finish.It may be hanged in tRFC.
Do the following steps.
1.Go to the long running load monitor (T-code: RSMO) screen and from menu at top navigate to u2018Environmentu2018 -> u2018Transact. RFCu2018 and then,
-> To u2018In the Data Warehouseu2018 , if the data source is in same SAP system as of the current load
-> To u2018In the source systemu2018 , if the data source exists in external SAP system (like R/3).
2.Now we will be in u2018Transactional RFCu2018 list selection screen. Here enter the input parameters. Put wild character asterisk u2018*u2019 in you need to get entire list of tRFCu2019s in the system.
3.Now the screen will list all the tRFCs currently scheduled to execute or held up. If a tRFC is held for long time, then we can manually push it by clicking on it from the list and then from menu go to u2018Editu2018 -> u2018Execute LUWu2018 or pressing F6.
Regards,
Shiva. -
I have three summary tables which are yearly,monthly and daily. The yearly table has year and some aggreagted facts. The monthly table has year,month and some aggregated facts while day table has year,month and day and some aggregated facts.
I ran a Query on yearly table and monthly table with a join on year for these fields
Year(year from yearly table)
month and some aggregated facts (monthly table). This query runs forever. But if I pull all these fields from monthly table it runs fast. Can I join on year to pull the data. I dont have any keys in these tables.Query from different tables:
SELECT
PMAC.ACT_ALL_SUM_YEAR.DEPT_AIRPORT,
PMAC.ACT_ALL_SUM_YEAR.ARR_AIRPORT,
(PMAC.ACT_ALL_SUM_YEAR.DATE_YEAR),
PMAC.ACT_ALL_SUM_MONTH.AVG_AIRB,
(PMAC.ACT_ALL_SUM_MONTH.DATE_MONTH)
FROM
PMAC.ACT_ALL_SUM_YEAR,
PMAC.ACT_ALL_SUM_MONTH,
PMAC.ACT_ALL_SUM_DAY
WHERE
( PMAC.ACT_ALL_SUM_YEAR.DATE_YEAR=PMAC.ACT_ALL_SUM_DAY.DATE_YEAR )
AND ( PMAC.ACT_ALL_SUM_DAY.DATE_YEAR=PMAC.ACT_ALL_SUM_MONTH.DATE_YEAR )
AND
PMAC.ACT_ALL_SUM_YEAR.DEPT_AIRPORT = 'ATL'
AND
PMAC.ACT_ALL_SUM_YEAR.ARR_AIRPORT = 'JFK'
AND
(PMAC.ACT_ALL_SUM_YEAR.DATE_YEAR) In ( '2001','2002','2003' )
)Query to pull data from single table:
SELECT
PMAC.ACT_ALL_SUM_MONTH.AVG_AIRB,
(PMAC.ACT_ALL_SUM_MONTH.DATE_MONTH),
PMAC.ACT_ALL_SUM_MONTH.ARR_AIRPORT,
PMAC.ACT_ALL_SUM_MONTH.DEPT_AIRPORT,
(PMAC.ACT_ALL_SUM_MONTH.DATE_YEAR)
FROM
PMAC.ACT_ALL_SUM_MONTH
WHERE
PMAC.ACT_ALL_SUM_MONTH.DEPT_AIRPORT = 'ATL'
AND
PMAC.ACT_ALL_SUM_MONTH.ARR_AIRPORT = 'JFK'
AND
(PMAC.ACT_ALL_SUM_MONTH.DATE_YEAR) In ( '2001','2002','2003' )
)These are two queries which I was working on. The first query takes too much time to run and it runs fast on the second query. How can I optimise the first query. Can we include any keys in these tables to make the query faster.
Edited by: user9518444 on Dec 3, 2008 7:34 AM
Edited by: user9518444 on Dec 3, 2008 7:38 AM -
Multiple instance of Sql server running for Analyzer 7.0 install
Hi,I do have a Sql server instance where the server name is: abc\xyz. Will analyzer accetp a '\' as the server name. This instance of Sql server is not running is not running on the std port 1433. Let me know if there will be any issues whrn installing Analyzer 7.0.Thanks,
There can only be a single default instance and multiple named instances.
BOL: http://technet.microsoft.com/en-us/library/ms143547.aspx
Kalman Toth Database & OLAP Architect
SELECT Video Tutorials 4 Hours
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012 -
LMS 3.2 discovery process runs for ever
Dear friends,
I am having a problem with discovery on Ciscoworks LMS 3.2. The discovery process runs eternally and does not discover any devices.
Here are the individual device versions:
Name Version Size Status Expiration Date
1. CM 5.2 300 Purchased Never
2. DFM 3.2 300 Purchased Never
3. HUM 1.0 100 Evaluation Sun Jul 26 12:18:01 GMT+03:00 2009
4. IPM 4.2 300 Purchased Never
5. RME 4.3 300 Purchased Never
6. VNM 1.0 Unlimited Purchased Never
Please find enclosed the csdiscovery.log which indicates the following error
1000 [main] DEBUG com.cisco.nm.csdiscovery.CSDiscoveryManager - FATAL: Exception occured in the start discovery Exception occured during start of discovery in CS.
Reason : failed to initialize DiscoveryController
I am also enclosing the CSDiscovery-config.xml under the config directory and the specific job as well.
ngdiscovery.log shows 0 bytes. I am not sure if it is to be populated only when we initiate some debugging?
Thanks a lot
GautamIt seems you're missing some critical files. Under NMSROOT/conf/csdiscovery, you should have the following zip files:
SharedDiscoveryAUS.zipSharedDiscoveryCluster.zipSharedDiscoveryGeneral.zipSharedDiscoveryIGX.zip
The casusers group should have full control on all four files. If these files really are missing, you will need to contact TAC to get new ones, or you will need to reinstall Common Services. -
SQL with connect by prior running for a long time
Hi,
We are using Oracle 10g. Below is a cursor sql which is having performance issues. The pAccountid is being passed from the output of a different cursor. But this cursor sql is running for a long time. Could you please help me in tuning this sql. I believe the subquery with connect by prior is causing the trouble.
The TRXNS is a huge table which is not partitioned. The query is forced to use the index on the accountid of the TRXNS table.
The accountlink table has 20,000 records and the TRXNStrack table has 10,000 records in total.
This sql executes for 200,000 pAccountids and runs for more than 8 hours.
SELECT /*+ INDEX(T TRXNS_ACCOUNTID_NIDX) */ AL.FROMACCOUNTID oldaccountid ,
A.ACCOUNTNUM oldaccountnum,
T.TRXNSID,
T.TRXNSTYPEID,
T.DESCRIPTION ,
T.postdt,
T.TRXNSAMT
FROM
ACCOUNTLINK AL,
TRXNS T,
ACCOUNT A
WHERE AL.TOACCOUNTID IN
(SELECT TOACCOUNTID FROM ACCOUNTLINK START WITH TOACCOUNTID = pAccountid
CONNECT BY PRIOR FROMACCOUNTID = TOACCOUNTID)
AND AL.FROMACCOUNTID = T.ACCOUNTID
AND A.ACCOUNTID = AL.FROMACCOUNTID
AND NOT EXISTS (select 1 from TRXNStrack trck where trck.TRXNSid = t.TRXNSid AND TRXNSTrackReasonid = 1)
AND T.postdt > A.CLOSEDATE
AND T.postdt >= sysdate-2
AND T.postdt <= sysdate;
Create script for trxn table:
CREATE TABLE SP.TRXNS
TRXNSID NUMBER(15) CONSTRAINT "BIN$rpIQEeyLDfbgRAAUT4DEnQ==$0" NOT NULL,
ACCOUNTID NUMBER(15) CONSTRAINT "BIN$rpIQEeyMDfbgRAAUT4DEnQ==$0" NOT NULL,
STATEMENTID NUMBER(15),
TRXNSTYPEID NUMBER(15),
DESCRIPTION VARCHAR2(80 BYTE),
postdt DATE,
TRXNSAMT NUMBER(12,2),
TRXNSREQID NUMBER(15),
LASTUPDATE DATE,
SOURCEID NUMBER(15),
HIDE VARCHAR2(1 BYTE)
TABLESPACE SO_TRXN_DATA
RESULT_CACHE (MODE DEFAULT)
PCTUSED 40
PCTFREE 10
INITRXNS 2
MAXTRXNS 255
STORAGE (
INITIAL 50M
NEXT 1M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
FREELISTS 8
FREELIST GROUPS 1
BUFFER_POOL DEFAULT
FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
CREATE INDEX SP.TRXNS_ACCOUNTID_NIDX ON SP.TRXNS
(ACCOUNTID, postdt)
LOGGING
TABLESPACE SO_TRXN_INDEX
PCTFREE 10
INITRXNS 2
MAXTRXNS 255
STORAGE (
INITIAL 64K
NEXT 1M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
FREELISTS 1
FREELIST GROUPS 1
BUFFER_POOL DEFAULT
FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT
NOPARALLEL;
below is the executing plan for this sql taken from toad :
PLAN_ID
TIMESTAMP
OPERATION
OPTIONS
OBJECT_OWNER
OBJECT_NAME
OBJECT_ALIAS
OBJECT_INSTANCE
OBJECT_TYPE
OPTIMIZER
SEARCH_COLUMNS
ID
PARENT_ID
DEPTH
POSITION
COST
CARDINALITY
BYTES
CPU_COST
IO_COST
TEMP_SPACE
ACCESS_PREDICATES
FILTER_PREDICATES
PROJECTION
TIME
QBLOCK_NAME
1121
9/10/2013 3:30
FILTER
1
0
1
1
NOT EXISTS (SELECT 0 FROM "TRXNSTRACK" "TRCK" WHERE "TRXNSTRACKREASONID"=1 AND "TRCK"."TRXNSID"=:B1)
AL."FROMACCOUNTID"[NUMBER,22], "T"."TRXNSID"[NUMBER,22], "T"."TRXNSTYPEID"[NUMBER,22], "T"."DESCRIPTION"[VARCHAR2,80], "T"."POSTDT"[DATE,7], "T"."TRXNSAMT"[NUMBER,22], "A"."ACCOUNTNUM"[VARCHAR2,19]
SEL$5DA710D3
1121
9/10/2013 3:30
FILTER
2
1
2
1
SYSDATE@!-2<=SYSDATE@!
AL."FROMACCOUNTID"[NUMBER,22], "T"."TRXNSID"[NUMBER,22], "T"."TRXNSTYPEID"[NUMBER,22], "T"."DESCRIPTION"[VARCHAR2,80], "T"."POSTDT"[DATE,7], "T"."TRXNSAMT"[NUMBER,22], "A"."ACCOUNTNUM"[VARCHAR2,19]
1121
9/10/2013 3:30
NESTED LOOPS
3
2
3
1
(#keys=0) "AL"."FROMACCOUNTID"[NUMBER,22], "T"."TRXNSID"[NUMBER,22], "T"."TRXNSTYPEID"[NUMBER,22], "T"."DESCRIPTION"[VARCHAR2,80], "T"."POSTDT"[DATE,7], "T"."TRXNSAMT"[NUMBER,22], "A"."ACCOUNTNUM"[VARCHAR2,19]
1121
9/10/2013 3:30
NESTED LOOPS
4
3
4
1
5
1
119
3989858
4
(#keys=0) "AL"."FROMACCOUNTID"[NUMBER,22], "T"."TRXNSID"[NUMBER,22], "T"."TRXNSTYPEID"[NUMBER,22], "T"."DESCRIPTION"[VARCHAR2,80], "T"."POSTDT"[DATE,7], "T"."TRXNSAMT"[NUMBER,22], "A".ROWID[ROWID,10]
1
1121
9/10/2013 3:30
NESTED LOOPS
5
4
5
1
4
1
90
3989690
3
(#keys=0) "AL"."FROMACCOUNTID"[NUMBER,22], "T"."TRXNSID"[NUMBER,22], "T"."TRXNSTYPEID"[NUMBER,22], "T"."DESCRIPTION"[VARCHAR2,80], "T"."POSTDT"[DATE,7], "T"."TRXNSAMT"[NUMBER,22]
1
1121
9/10/2013 3:30
HASH JOIN
SEMI
6
5
6
1
3
2
54
3989094
2
AL."TOACCOUNTID"="TOACCOUNTID"
(#keys=1) "AL"."FROMACCOUNTID"[NUMBER,22]
1
1121
9/10/2013 3:30
INDEX
FULL SCAN
SP
ACCOUNTLINK_AK1
AL@SEL$1
INDEX (UNIQUE)
ANALYZED
7
6
7
1
1
18
252
107
1
AL."FROMACCOUNTID"[NUMBER,22], "AL"."TOACCOUNTID"[NUMBER,22]
1
SEL$5DA710D3
1121
9/10/2013 3:30
VIEW
SYS
VW_NSO_1
VW_NSO_1@SEL$5DA710D3
11
VIEW
8
6
7
2
2
18
234
107
1
TOACCOUNTID[NUMBER,22]
1
SEL$683B0107
1121
9/10/2013 3:30
CONNECT BY
NO FILTERING WITH START-WITH
9
8
8
1
TOACCOUNTID=PRIOR "FROMACCOUNTID"
TOACCOUNTID=56354162
TOACCOUNTID[NUMBER,22], "FROMACCOUNTID"[NUMBER,22], PRIOR NULL[22], LEVEL[4]
SEL$683B0107
1121
9/10/2013 3:30
INDEX
FULL SCAN
SP
ACCOUNTLINK_AK1
ACCOUNTLINK@SEL$3
INDEX (UNIQUE)
ANALYZED
10
9
9
1
1
18
252
107
1
ACCOUNTLINK.ROWID[ROWID,10], "FROMACCOUNTID"[NUMBER,22], "TOACCOUNTID"[NUMBER,22]
1
SEL$3
1121
9/10/2013 3:30
TABLE ACCESS
BY INDEX ROWID
SP
TRXNS
T@SEL$1
2
TABLE
ANALYZED
11
5
6
2
1
1
63
298
1
T."TRXNSID"[NUMBER,22], "T"."TRXNSTYPEID"[NUMBER,22], "T"."DESCRIPTION"[VARCHAR2,80], "T"."POSTDT"[DATE,7], "T"."TRXNSAMT"[NUMBER,22]
1
SEL$5DA710D3
1121
9/10/2013 3:30
INDEX
RANGE SCAN
SP
TRXNS_ACCOUNTID_NIDX
T@SEL$1
INDEX
ANALYZED
2
12
11
7
1
1
1
224
1
AL."FROMACCOUNTID"="T"."ACCOUNTID" AND "T"."POSTDT">=SYSDATE@!-2 AND "T"."POSTDT"<=SYSDATE@!
T.ROWID[ROWID,10], "T"."POSTDT"[DATE,7]
1
SEL$5DA710D3
1121
9/10/2013 3:30
INDEX
UNIQUE SCAN
SP
ACCOUNT_PK
A@SEL$1
INDEX (UNIQUE)
ANALYZED
1
13
4
5
2
1
1
90
1
A."ACCOUNTID"="AL"."FROMACCOUNTID"
A.ROWID[ROWID,10]
1
SEL$5DA710D3
1121
9/10/2013 3:30
TABLE ACCESS
BY INDEX ROWID
SP
ACCOUNT
A@SEL$1
3
TABLE
ANALYZED
14
3
4
2
1
1
29
168
1
A."CLOSEDATE"<SYSDATE@! AND "T"."POSTDT">"A"."CLOSEDATE"
A."ACCOUNTNUM"[VARCHAR2,19]
1
SEL$5DA710D3
1121
9/10/2013 3:30
INDEX
RANGE SCAN
SP
TRXNSTRACK_TRXNSID_NIDX
TRCK@SEL$6
INDEX
ANALYZED
2
15
1
2
2
1
1
10
73
1
TRCK."TRXNSID"=:B1 AND "TRXNSTRACKREASONID"=1
TRCK."TRXNSID"[NUMBER,22], "TRXNSTRACKREASONID"[NUMBER,22]
1
SEL$6
Please help me in debugging this thanks!Hi,
Thanks for your thought on this subject. Below is the trace info that I got from the DBA
SQL ID: d0x879qx2zgtz Plan Hash: 4036333519
SELECT /*+ INDEX(T TRXNS_ACCOUNTID_NIDX) */ AL.FROMACCOUNTID OLDACCOUNTID ,
A.ACCOUNTNUM OLDACCOUNTNUM, T.TRXNSID, T.TRXNSTYPEID, T.DESCRIPTION ,
T.POSTDT, T.TRXNSAMT
FROM
ACCOUNTLINK AL, TRXNS T, ACCOUNT A WHERE AL.TOACCOUNTID IN (SELECT
TOACCOUNTID FROM ACCOUNTLINK START WITH TOACCOUNTID = :B3 CONNECT BY PRIOR
FROMACCOUNTID = TOACCOUNTID) AND AL.FROMACCOUNTID = T.ACCOUNTID AND
A.ACCOUNTID = AL.FROMACCOUNTID AND NOT EXISTS (SELECT 1 FROM TRXNSTRACK
TRCK WHERE TRCK.TRXNSID = T.TRXNSID AND TRXNSTRACKREASONID = :B4 ) AND
T.POSTDT > A.CLOSEDATE AND T.POSTDT >= :B2 AND T.POSTDT <= :B1
call count cpu elapsed disk query current rows
Parse 0 0.00 0.00 0 0 0 0
Execute 17160 2.10 1.87 0 0 0 0
Fetch 17160 7354.61 7390.86 169408 5569856 883366791 0
total 34320 7356.71 7392.74 169408 5569856 883366791 0
Misses in library cache during parse: 0
Optimizer mode: CHOOSE
Parsing user id: 38 (recursive depth: 1)
SQL ID: gs89hpavb4cts Plan Hash: 3415795327
SELECT A.ACCOUNTID, C.MEMBERID, A.PROGRAMID, A.ACCOUNTNUM
FROM
CUSTOMER C, CUSTOMERACCOUNT CA, ACCOUNT A, PROGRAMPARAMVALUE PPV,
BATCHPROCESSPROGRAM BP WHERE A.PROGRAMID = BP.PROGRAMID AND A.PROGRAMID =
PPV.PROGRAMID AND A.ACCOUNTID = CA.ACCOUNTID AND CA.PERSONID = C.PERSONID
AND PPV.PARAMID = :B2 AND PPV.VALUE = 'Y' AND BP.PROCESSID = :B1 AND BP.RUN
= 'Y' AND A.ACCOUNTTYPEID = 4 AND A.ACCOUNTSTATUSID = 1 AND C.MEMBERID IS
NOT NULL
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 172 13.14 115.34 80826 278650 0 17200
total 172 13.14 115.34 80826 278650 0 17200
Misses in library cache during parse: 0
Parsing user id: 38 (recursive depth: 1)
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
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 0 0.00 0.00 0 0 0 0
Execute 17160 2.10 1.87 0 0 0 0
Fetch 17332 7367.75 7506.21 250234 5848506 883366791 17200
total 34492 7369.85 7508.09 250234 5848506 883366791 17200
Misses in library cache during parse: 0
2 user SQL statements in session.
0 internal SQL statements in session.
2 SQL statements in session.
Trace file: svoprod_ora_12346.trc
Trace file compatibility: 11.1.0.7
Sort options: default
1 session in tracefile.
2 user SQL statements in trace file.
0 internal SQL statements in trace file.
2 SQL statements in trace file.
2 unique SQL statements in trace file.
66499 lines in trace file.
7516 elapsed seconds in trace file. -
Sql query runs slower from the application
Hi,
We are using oracle 9ias on AIX box.The jdk version used: 1.3.1 . From the j2ee application when we perfom a search, the sql query takes for ever to return the results. I know that we are waiting on the database because I can see the query working when I look at TOAD.But if i run the same query on the database server itself, it returns the results in less than a sec. Could you guys throw some light on how we could troubleshoot this problem. Thanks.When the results have to travel over the network, it is slow, and when they don't, it is fast.
That is what you are saying, correct?
So your approach should be to not bring so much data over the network. Don't select columns you don't need, and don't select rows you don't need. -
Discoverer report running for hours
Hi,
One of the custom discoverer report (based on custom SQL) is running for hours.
When U ran the query for the respective folder, the results were returned in few seconds.
Hence, data size is not an issue. How can I identify the cause and solve it?
Thanks,
Kamath.Hello
If you dont need to run the report urgently then you can always schedule it to run the background till it is finished.
First log into desktop. Select tools > options > query governor tab. Make sure only radio button named "Never" is ticked. Leave all other options empty / not ticked. Click OK when ur done.
Then go to File > Manage Workbooks > Scheduling Manager > Schedule.... button then choose either My Computer or Database depending on where your report is stored. Scroll down and find your report. Enter a time and date that you want to start running the report. When you are done click Finish button. Normally the report would run for an hour or till it is complete. But it won't bomb out.
After 2 hours or even the next morning go to File > Manage workbooks > then look for your report > if it has run successfully then the status column would return something positive like "completed successfully". just double click your report and your are done....
It works for me if i need to run one of my reports. but that is only if your not in a rush to run your report
Hope it helps
Edited by: iandekoker on Jun 11, 2009 12:48 PM
Edited by: iandekoker on Jun 11, 2009 12:49 PM -
How do I set a Phase Listener to only run for a specific page?
How do I set a Phase Listener to only run for a specific page?
I understand that a Phase Listener runs for ever page in the application, however I want a phase listener to only run for one page at the beginning of the application.
I discovered I can't use a Filter, because the JSF Application instance always returns null.
Thus, I thought a Phase Listener would be a good approach.
Thoughts?
Thanks,
--ToddI have moved forward with checking the requested URI...
(shivers)
Thanks,
--Todd
Maybe you are looking for
-
Dear all, I have data in a table with 3 columns. Tabke name---test & columns are .... Proeductioncode varchar2(5); revisionno varchar2(3); dateadopted char(8); SELECT PRODUCTIONCODE, REVISIONNO, dateadopted FROM test where productioncode ='CI50E'; ou
-
How do pass the UserID and Password in the SOAP header for web services
I am encountering issues trying to pass the userid and password in the SOAP header when consuming a 3rd party web service. Rostewitz posted something similiar but I don't know how to type iv_xml. Any help would be greatly appreciated. Thank you, jp
-
Prompt used as view selector for multiple reports
Hi All, Can a dashboard prompt be used as View Selector for multiple reports? If yes, please let me know how? Thanks Sumita
-
Unlock iPhone 1 - carrier AT&T denies to be the carrier
Today i tried to unlock my iPhone 1, since it is locked due to a ios upgrade (to 3.1.3) i made yesterday. Apple service center checked my imei number, cross referenced it to the serial number and concluded that the carrier is AT&T. Service incident n
-
Okay, this is weird. I created a web site in DW8. All looked good and displays fine in browser. I just downloaded CS3 and opened the same site and now one specific GIF is not displaying correctly. In Photoshop or Mac Preview, the GIF looks as expecte