Reg : Longest Running Query
Hi ,
Help me out to, find the longest running query in database.
Thank you
With Regards
V.S.Anand
http://www.oracle-base.com/forums/viewtopic.php?f=1&t=9991
See if this helps..
Similar Messages
-
How can i check the longest running query ??
Hi ,
I need to find out which query that is taking the longest time ?
how can i check that ?
pls advise
tks & rgdsCurrent Active Queries:
col sql_text format a50
col machine format a10
col username format a10
col action format a10
set linesize 200
SELECT /*+ ORDERED */
username
,S.LAST_CALL_ET
,s.action
,S.STATUS
,s.sid
,s.serial#
, s.machine
, X.sql_text
FROM sys
.v_$session S
LEFT OUTER JOIN sys.v_$sqlarea X
ON s.sql_address = x.address
AND s.sql_hash_value = x.hash_value
WHERE s.type != 'BACKGROUND'
AND s.STATUS = 'ACTIVE'
ORDER BY 2,1
You can add AND s.USERNAME= 'USERNAME' for a particular user
Long Running Queries
col sql_text format a50
col opname format a20
col machine format a10
col username format a10
col action format a10
set linesize 200
select /*+ ORDERED */
sl.username
,sl.opname
,sl.start_time
,sl.last_update_time
,sl.time_remaining
,sl.elapsed_seconds
,sa.sql_text
from v$sqlarea sa,v$session_longops sl
where sl.sql_hash_value = sa.hash_value
and sl.sql_address = sa.address
/ -
SELECT top two longest running steps from a log file
Simplified example.
Our jobs write records to our own internal log file. I want to write a query that will pull log records for a specific job, between specific dates. This will help determine if the job is running slower than usual and to find the steps within the job that
are the longest running.
Jobs are identified by the Type field. Type=1 is a specific job name.
Each job writes a DESC=START record to the log at the beginning of the job. the Desc=START record will be updated at the end of the job with the ENDDT.
I want to pull the top two longest running steps (ENDDT-BEGINDT) for each job (Type) where the step startdr and enddt falls between the START startDT and end dt.
I also want to always pull key step names, like DESC=START and DESC=xya for each job.
LOG RECORDS
DESC,TYPE,BEGINDT,ENDDT
START,1,2014-10-22 07:56:56.000,2014-10-22 09:56:56.000
aaa,1,2014-10-22 07:57:56.000,2014-10-22 08:57:56.000
bbb,1,2014-10-22 08:57:56.000,2014-10-22 09:01:56.000
ccc,1,2014-10-22 09:01:56.000,2014-10-22 09:56:56.000
xya,1,2014-10-22 09:55:56.000,2014-10-22 09:56:56.000
START,1,2014-10-21 11:56:56.000,2014-10-22 02:56:56.000
aaa,1,2014-10-21 11:57:56.000,2014-10-22 01:57:56.000
bbb,1,2014-10-22 01:57:56.000,2014-10-22 02:56:56.000
ccc,1,2014-10-22 02:56:56.000,2014-10-22 02:56:56.000
xya,1,2014-10-22 09:55:56.000,2014-10-22 09:56:56.000
Desired result set.
If pulling job type 1 records for last 2 days, would end up with this result set. START and xya are always pulled and then the top 2 longest running steps for each of the START records.
DESC,TYPE,BEGINDT,ENDDT,Duration
START,1,2014-10-22 07:56:56.000,2014-10-22 09:56:56.000
aaa,1,2014-10-22 07:57:56.000,2014-10-22 08:57:56.000
ccc,1,2014-10-22 09:01:56.000,2014-10-22 09:56:56.000
xya,1,2014-10-22 09:01:56.000,2014-10-22 09:56:56.000
START,1,2014-10-21 11:56:56.000,2014-10-22 02:56:56.000
aaa,1,2014-10-21 11:57:56.000,2014-10-22 01:57:56.000
bbb,1,2014-10-22 01:57:56.000,2014-10-22 02:56:56.000
xya,1,2014-10-22 09:55:56.000,2014-10-22 09:56:56.000
I am asking for help in how to create this query. ThanksHi TheBrenda,
According to your description, I have written a sample query and tested it in my local environment.
The following sample query is for your reference:
--create table log_records
CREATE TABLE log_records ([DESC] varchar(10),[TYPE] int,BEGINDT datetime,ENDDT datetime)
--insert values to table log_records
INSERT INTO log_records VALUES
('START',1,'2014-10-22 07:56:56.000','2014-10-22 09:56:56.000'),
('aaa',1,'2014-10-22 07:57:56.000','2014-10-22 08:57:56.000'),
('bbb',1,'2014-10-22 08:57:56.000','2014-10-22 09:01:56.000'),
('ccc',1,'2014-10-22 09:01:56.000','2014-10-22 09:56:56.000'),
('xya',1,'2014-10-22 09:55:56.000','2014-10-22 09:56:56.000'),
('START',1,'2014-10-21 11:56:56.000','2014-10-22 02:56:56.000'),
('aaa',1,'2014-10-21 11:57:56.000','2014-10-22 01:57:56.000'),
('bbb',1,'2014-10-22 01:57:56.000','2014-10-22 02:56:56.000'),
('ccc',1,'2014-10-22 02:56:56.000','2014-10-22 02:56:56.000'),
('xya',1,'2014-10-22 02:56:56.000','2014-10-22 02:56:56.000')
--run the following main query to get top two longest running steps
WITH A AS
(SELECT BEGINDT,ENDDT FROM log_records WHERE [DESC]='START'),
B AS
SELECT LR.[DESC], LR.TYPE, LR.BEGINDT BEGINDT1, LR.ENDDT ENDDT1, A.BEGINDT BEGINDT2, A.ENDDT ENDDT2,DATEDIFF(SECOND,LR.BEGINDT,LR.ENDDT) AS timediff,ROW_NUMBER() OVER(PARTITION BY A.BEGINDT ORDER BY DATEDIFF(SECOND,LR.BEGINDT,LR.ENDDT) DESC ) AS rn FROM log_records LR JOIN A
ON LR.BEGINDT >= A.BEGINDT AND LR.ENDDT<=A.ENDDT
SELECT [DESC],[TYPE],BEGINDT1 BEGINDT,ENDDT1 ENDDT FROM B WHERE rn<4 or [DESC]='xya' ORDER BY BEGINDT2,rn
The result of the main query is:
DESC TYPE
BEGINDT
ENDDT
START 1 2014-10-21 11:56:56.000 2014-10-22 02:56:56.000
aaa 1 2014-10-21 11:57:56.000 2014-10-22
01:57:56.000
bbb 1 2014-10-22 01:57:56.000 2014-10-22 02:56:56.000
xya 1 2014-10-22 02:56:56.000 2014-10-22
02:56:56.000
START 1 2014-10-22 07:56:56.000 2014-10-22 09:56:56.000
aaa 1 2014-10-22 07:57:56.000 2014-10-22
08:57:56.000
ccc 1 2014-10-22 09:01:56.000 2014-10-22
09:56:56.000
xya 1 2014-10-22 09:55:56.000 2014-10-22
09:56:56.000
If you have any question, please feel free to let me know.
Regards,
Jerry Li -
How to change the explain plan for currently running query?
Hi All,
I am using Oracle enterprise 9i edition. I have a query which frames dynamically and running in the database. I noticed a table with 31147758 rows
in the query which has no indexes and taking more time to process. I tried to create an INdex on that table. I know the query is already running with a FULL table scan. Is it possible to change the explain plan for the current running query to consider the INDEX?
[code]
SELECT /*+ USE_HASH (c,e,b,a) */
d.att_fcc extrt_prod_dim_id,
d.att_fcc compr_prod_dim_id,
a.glbl_uniq_id glbl_uniq_id,
to_date(c.dit_code,'RRRRMMDD')STRT_DT,
(to_date(c.dit_code,'RRRRMMDD')+150)END_DT,
a.pat_nbr pat_id,
a.rxer_id rxer_id,
e.rxer_geog_id rxer_geog_id,
a.pharmy_id pharmy_id,
a.pscr_pack_id pscr_pack_id,
a.dspnsd_pack_id dspnsd_pack_id,
DENSE_RANK () OVER (PARTITION BY a.pat_nbr ORDER BY c.dit_code) daterank,
COUNT( DISTINCT d.att_fcc ) OVER (PARTITION BY a.pat_nbr, c.dit_code) event_cnt
DENSE_RANK () OVER (PARTITION BY a.pat_nbr,
d.att_fcc
ORDER BY c.dit_code) prodrank,
DENSE_RANK () OVER (PARTITION BY a.pat_nbr,
d.att_fcc
ORDER BY c.dit_code DESC) stoprank
FROM
pd_dimitems c,
pd_pack_attribs d ,
lrx_tmp_rxer_geog e,
lrx_tmp_pat_daterank p,
lrx_tmp_valid_fact_link a
WHERE c.dit_id = a.tm_id
AND e.rxer_id = a.rxer_id
AND a.glbl_uniq_id = p.glbl_uniq_id
AND p.daterank > 1
AND a.pscr_pack_id = d.att_dit_id
[/code]
The table lrx_tmp_pat_daterank is having that 31147758 rows. So I am wondering how to make the query to use the newly created index on the table?Why do you think using Indexes will improve the performance of the query? How many rows this query is returning? Optimizer might chose a Full table scan when it finds out that Index plan might not be useful. Why are you using /*+ USE_HASH (c,e,b,a) */ hint? This Hint will force oracle to use Full table scan instead of using the index. Try removing it and see if the plan changes.
Regards, -
Long running query--- included steps given by Randolf
Hi,
I have done my best to follow Randolf instruction word-by-word and hope to get solution for my
problem soon. Sometime back I have posted a thread on this problem then got busy with other
stuff and was not able to follow it. Here I am again with same issue.
here is link for my previous post
long running query in database 10gHere is backgroud of my requriemment.
I am working on Oracle forms 10g which is using package given below. We want to display client information
with order count basd on different status like Pending, Error, back Order, expedited, std shipping.
Output will look something like.
client name pending error backorder expedited std shipping
ABC 24 0 674 6789 78900
XYZ 35 673 5700 0 798274
.There are total 40 clients . The long running query are expedited and std shipping.
When i run package from Oracle Form Developer it takes 3 mintues to run but when I run same query in our application using forms
(which uses Oracle Application Server) it takes around 1 hour, which is completly unacceptable.
User wants it be done in less than 1 mintue.
I have tried combining Pending,error and backorder queries together but as far as I know it will not
work in Oracle Form as we need a place holder for each status.
Please dont think it is Forms related question, it is a Performance problem.
PACKAGE BODY ORDER_COUNT_PKG IS
PROCEDURE post_query IS
BEGIN
BEGIN
SELECT count(*)
INTO :ORDER_STATUS.PENDING
FROM orders o
WHERE o.status = 'P'
AND (parent_order_id is null
OR (order_type='G'
AND parent_order_id=original_order_number))
AND o.client = :ORDER_STATUS.CLIENT_NUMBER;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
BEGIN
SELECT count(*)
INTO :ORDER_STATUS.ERROR
FROM orders o
WHERE o.status = 'E'
AND (parent_order_id is null
OR (order_type='G'
AND parent_order_id=original_order_number))
AND o.client = :ORDER_STATUS.CLIENT_NUMBER;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
BEGIN
SELECT count(*)
INTO :ORDER_STATUS.BACK_ORDER
FROM orders o
WHERE o.status = 'B'
AND (parent_order_id is null
OR (order_type='G'
AND parent_order_id=original_order_number))
AND o.client = :ORDER_STATUS.CLIENT_NUMBER;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
BEGIN
SELECT count(*)
INTO :ORDER_STATUS.EXPEDITE
FROM orders o,shipment_type_methods stm
WHERE o.status in ('A','U')
AND (o.parent_order_id is null
OR (o.order_type = 'G'
AND o.parent_order_id = o.original_order_number))
AND o.client = stm.client
AND o.shipment_class_code = stm.shipment_class_code
AND (nvl(o.priority,'1') = '2'
OR stm.surcharge_amount <> 0)
AND o.client = :ORDER_STATUS.CLIENT_NUMBER
GROUP BY o.client;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
BEGIN
SELECT count(*)
INTO :ORDER_STATUS.STD_SHIP
FROM orders o,shipment_type_methods stm
WHERE o.status in ('A','U')
AND (o.parent_order_id is null
OR (o.order_type = 'G'
AND o.parent_order_id = o.original_order_number))
AND nvl(o.priority,'1') <> '2'
AND o.client = stm.client
AND o.shipment_class_code = stm.shipment_class_code
AND stm.surcharge_amount = 0
AND o.client = :ORDER_STATUS.CLIENT_NUMBER
GROUP BY o.client;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
END post_query;
END ORDER_COUNT_PKG;one of the query which is taking long time is
SELECT count(*)
FROM orders o,shipment_type_methods stm
WHERE o.status in ('A','U')
AND (o.parent_order_id is null
OR (o.order_type = 'G'
AND o.parent_order_id = o.original_order_number))
AND nvl(o.priority,'1') <> '2'
AND o.client = stm.client
AND o.shipment_class_code = stm.shipment_class_code
AND stm.surcharge_amount = 0
AND o.client = :CLIENT_NUMBER
GROUP BY o.clientThe version of the database is 10.2.1.0.2
SQL> alter session force parallel dml;These are the parameters relevant to the optimizer:
SQL> show parameter user_dump_dest
NAME TYPE VALUE
user_dump_dest string /u01/app/oracle/admin/mcgemqa/
udump
SQL> show parameter optimizer
NAME TYPE VALUE
optimizer_dynamic_sampling integer 2
optimizer_features_enable string 10.2.0.4
optimizer_index_caching integer 0
optimizer_index_cost_adj integer 100
optimizer_mode string ALL_ROWS
optimizer_secure_view_merging boolean TRUE
SQL> show parameter db_file_multi
NAME TYPE VALUE
db_file_multiblock_read_count integer 16
SQL> show parameter db_block_size
NAME TYPE VALUE
db_block_size integer 8192
SQL> show parameter cursor_sharing
NAME TYPE VALUE
cursor_sharing string EXACTHere is the output of EXPLAIN PLAN:
SQL> explain plan for
2 SELECT count(*)
3 FROM orders o,shipment_type_methods stm
4 WHERE o.status in ('A','U')
5 AND (o.parent_order_id is null
6 OR (o.order_type = 'G'
7 AND o.parent_order_id = o.original_order_number))
8 AND nvl(o.priority,'1') <> '2'
9 AND o.client = stm.client
10 AND o.shipment_class_code = stm.shipment_class_code
11 AND stm.surcharge_amount = 0
12 AND o.client = :CLIENT_NUMBER
13 GROUP BY o.client
14 /
Explained.
Elapsed: 00:00:00.12
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 559278019
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 35 | 46764 (3)| 00:09:22 |
| 1 | SORT GROUP BY NOSORT | | 1 | 35 | 46764 (3)| 00:09:22 |
|* 2 | TABLE ACCESS BY INDEX ROWID | ORDERS | 175K| 3431K| 25979 (3)| 00:05:12 |
| 3 | NESTED LOOPS | | 25300 | 864K| 46764 (3)| 00:09:22 |
|* 4 | TABLE ACCESS BY INDEX ROWID| SHIPMENT_TYPE_METHODS | 1 | 15 | 2 (0)| 00:00
|* 5 | INDEX RANGE SCAN | U_SHIPMENT_TYPE_METHODS | 2 | | 1 (0)| 00:00:01 |
|* 6 | INDEX RANGE SCAN | ORDERS_ORDER_DATE | 176K| | 2371 (8)| 00:00:29 |
Predicate Information (identified by operation id):
2 - filter(("O"."PARENT_ORDER_ID" IS NULL OR "O"."ORDER_TYPE"='G' AND
"O"."PARENT_ORDER_ID"=TO_NUMBER("O"."ORIGINAL_ORDER_NUMBER")) AND NVL("O"."PRIORITY",'1')<>'2
AND "O"."SHIPMENT_CLASS_CODE"="STM"."SHIPMENT_CLASS_CODE")
4 - filter("STM"."SURCHARGE_AMOUNT"=0)
5 - access("STM"."CLIENT"=:CLIENT_NUMBER)
6 - access("O"."CLIENT"=:CLIENT_NUMBER)
filter("O"."STATUS"='A' OR "O"."STATUS"='U')
24 rows selected.
Elapsed: 00:00:00.86
SQL> rollback;
Rollback complete.
Elapsed: 00:00:00.07Here is the output of SQL*Plus AUTOTRACE including the TIMING information:
SQL> SELECT count(*)
2 FROM orders o,shipment_type_methods stm
3 WHERE o.status in ('A','U')
4 AND (o.parent_order_id is null
5 OR (o.order_type = 'G'
6 AND o.parent_order_id = o.original_order_number))
7 AND nvl(o.priority,'1') <> '2'
8 AND o.client = stm.client
9 AND o.shipment_class_code = stm.shipment_class_code
10 AND stm.surcharge_amount = 0
11 AND o.client = :CLIENT_NUMBER
12 GROUP BY o.client
13 /
Elapsed: 00:00:03.09
Execution Plan
Plan hash value: 559278019
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 35 | 46764 (3)| 00:09:22 |
| 1 | SORT GROUP BY NOSORT | | 1 | 35 | 46764 (3)| 00:09:22 |
|* 2 | TABLE ACCESS BY INDEX ROWID | ORDERS | 175K| 3431K| 25979 (3)| 00:05:12 |
| 3 | NESTED LOOPS | | 25300 | 864K| 46764 (3)| 00:09:22 |
|* 4 | TABLE ACCESS BY INDEX ROWID| SHIPMENT_TYPE_METHODS | 1 | 15 | 2 (0)| 00:00
|* 5 | INDEX RANGE SCAN | U_SHIPMENT_TYPE_METHODS | 2 | | 1 (0)| 00:00:01 |
|* 6 | INDEX RANGE SCAN | ORDERS_ORDER_DATE | 176K| | 2371 (8)| 00:00:29 |
Predicate Information (identified by operation id):
2 - filter(("O"."PARENT_ORDER_ID" IS NULL OR "O"."ORDER_TYPE"='G' AND
"O"."PARENT_ORDER_ID"=TO_NUMBER("O"."ORIGINAL_ORDER_NUMBER")) AND NVL("O"."PRIORITY",'1')<>'2
AND "O"."SHIPMENT_CLASS_CODE"="STM"."SHIPMENT_CLASS_CODE")
4 - filter("STM"."SURCHARGE_AMOUNT"=0)
5 - access("STM"."CLIENT"=:CLIENT_NUMBER)
6 - access("O"."CLIENT"=:CLIENT_NUMBER)
filter("O"."STATUS"='A' OR "O"."STATUS"='U')
Statistics
55 recursive calls
0 db block gets
7045 consistent gets
0 physical reads
0 redo size
206 bytes sent via SQL*Net to client
238 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
SQL> disconnect
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> The TKPROF output for this statement looks like the following:
SELECT count(*)
FROM orders o,shipment_type_methods stm
WHERE o.status in ('A','U')
AND (o.parent_order_id is null
OR (o.order_type = 'G'
AND o.parent_order_id = o.original_order_number))
AND nvl(o.priority,'1') <> '2'
AND o.client = stm.client
AND o.shipment_class_code = stm.shipment_class_code
AND stm.surcharge_amount = 0
AND o.client = :CLIENT_NUMBER
GROUP BY o.client
call count cpu elapsed disk query current rows
Parse 1 0.01 0.00 0 0 0 0
Execute 1 0.04 0.04 0 0 0 0
Fetch 2 2.96 2.91 0 7039 0 1
total 4 3.01 2.95 0 7039 0 1
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 95
Rows Row Source Operation
1 SORT GROUP BY NOSORT (cr=7039 pr=0 pw=0 time=2913701 us)
91 TABLE ACCESS BY INDEX ROWID ORDERS (cr=7039 pr=0 pw=0 time=261997906 us)
93 NESTED LOOPS (cr=6976 pr=0 pw=0 time=20740 us)
1 TABLE ACCESS BY INDEX ROWID SHIPMENT_TYPE_METHODS (cr=2 pr=0 pw=0 time=208 us)
3 INDEX RANGE SCAN U_SHIPMENT_TYPE_METHODS (cr=1 pr=0 pw=0 time=88 us)(object id 81957)
91 INDEX RANGE SCAN ORDERS_ORDER_DATE (cr=6974 pr=0 pw=0 time=70 us)(object id 81547)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 2 0.00 0.00
SQL*Net message from client 2 0.02 0.02
********************************************************************************The DBMS_XPLAN.DISPLAY_CURSOR output:
SQL> variable CLIENT_NUMBER varchar2(20)
SQL> exec :CLIENT_NUMBER := '14'
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.06
SQL> SELECT /*+ gather_plan_statistics */ count(*)
2 FROM orders o,shipment_type_methods stm
3 WHERE o.status in ('A','U')
4 AND (o.parent_order_id is null
5 OR (o.order_type = 'G'
6 AND o.parent_order_id = o.original_order_number))
7 AND nvl(o.priority,'1') <> '2'
8 AND o.client = stm.client
9 AND o.shipment_class_code = stm.shipment_class_code
10 AND stm.surcharge_amount = 0
11 AND o.client = :CLIENT_NUMBER
12 GROUP BY o.client
13 /
COUNT(*)
91
Elapsed: 00:00:02.85
SQL> set termout on
SQL> select * from table(dbms_xplan.display_cursor(null, null, 'ALLSTATS LAST'));
PLAN_TABLE_OUTPUT
SQL_ID 4nfj368y8w6a3, child number 0
SELECT /*+ gather_plan_statistics */ count(*) FROM orders o,shipment_type_methods stm WHERE
o.status in ('A','U') AND (o.parent_order_id is null OR (o.order_type = 'G'
AND o.parent_order_id = o.original_order_number)) AND nvl(o.priority,'1') <> '2' AND
o.client = stm.client AND o.shipment_class_code = stm.shipment_class_code AND
stm.surcharge_amount = 0 AND o.client = :CLIENT_NUMBER GROUP BY o.client
Plan hash value: 559278019
| Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers |
| 1 | SORT GROUP BY NOSORT | | 1 | 1 | 1 |00:00:02.63 | 7039 |
|* 2 | TABLE ACCESS BY INDEX ROWID | ORDERS | 1 | 175K| 91 |00:03:56.87 | 7039 |
| 3 | NESTED LOOPS | | 1 | 25300 | 93 |00:00:00.02 | 6976 |
|* 4 | TABLE ACCESS BY INDEX ROWID| SHIPMENT_TYPE_METHODS | 1 | 1 | 1 |00:00:00.01 | 2 |
|* 5 | INDEX RANGE SCAN | U_SHIPMENT_TYPE_METHODS | 1 | 2 | 3 |00:00:00.01 | 1 |
|* 6 | INDEX RANGE SCAN | ORDERS_ORDER_DATE | 1 | 176K| 91 |00:00:00.01 | 6974 |
Predicate Information (identified by operation id):
2 - filter((("O"."PARENT_ORDER_ID" IS NULL OR ("O"."ORDER_TYPE"='G' AND
"O"."PARENT_ORDER_ID"=TO_NUMBER("O"."ORIGINAL_ORDER_NUMBER"))) AND NVL("O"."PRIORITY",'1')<>'
"O"."SHIPMENT_CLASS_CODE"="STM"."SHIPMENT_CLASS_CODE"))
4 - filter("STM"."SURCHARGE_AMOUNT"=0)
5 - access("STM"."CLIENT"=:CLIENT_NUMBER)
6 - access("O"."CLIENT"=:CLIENT_NUMBER)
filter(("O"."STATUS"='A' OR "O"."STATUS"='U'))
32 rows selected.
Elapsed: 00:00:01.30
SQL> I'm looking forward for suggestions how to improve the performance of this statement.
Thanks
SandyPlease find explain plan for No hint
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 559278019
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 35 | 46764 (3)| 00:09:22 |
| 1 | SORT GROUP BY NOSORT | | 1 | 35 | 46764 (3)| 00:09:22 |
|* 2 | TABLE ACCESS BY INDEX ROWID | ORDERS | 175K| 3431K| 25979 (3)| 00:05:12 |
| 3 | NESTED LOOPS | | 25300 | 864K| 46764 (3)| 00:09:22 |
|* 4 | TABLE ACCESS BY INDEX ROWID| SHIPMENT_TYPE_METHODS | 1 | 15 | 2 (0)| 00:00
|* 5 | INDEX RANGE SCAN | U_SHIPMENT_TYPE_METHODS | 2 | | 1 (0)| 00:00:01 |
|* 6 | INDEX RANGE SCAN | ORDERS_ORDER_DATE | 176K| | 2371 (8)| 00:00:29 |
Predicate Information (identified by operation id):
2 - filter(("O"."PARENT_ORDER_ID" IS NULL OR "O"."ORDER_TYPE"='G' AND
"O"."PARENT_ORDER_ID"=TO_NUMBER("O"."ORIGINAL_ORDER_NUMBER")) AND NVL("O"."PRIORITY",'1')<>'2
AND "O"."SHIPMENT_CLASS_CODE"="STM"."SHIPMENT_CLASS_CODE")
4 - filter("STM"."SURCHARGE_AMOUNT"=0)
5 - access("STM"."CLIENT"=:CLIENT_NUMBER)
6 - access("O"."CLIENT"=:CLIENT_NUMBER)
filter("O"."STATUS"='A' OR "O"."STATUS"='U')
24 rows selected.
Elapsed: 00:00:00.86Explain Plan for Parallel Hint
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 559278019
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 35 | 46764 (3)| 00:09:22 |
| 1 | SORT GROUP BY NOSORT | | 1 | 35 | 46764 (3)| 00:09:22 |
|* 2 | TABLE ACCESS BY INDEX ROWID | ORDERS | 175K| 3431K| 25979 (3)| 00:05:12 |
| 3 | NESTED LOOPS | | 25300 | 864K| 46764 (3)| 00:09:22 |
|* 4 | TABLE ACCESS BY INDEX ROWID| SHIPMENT_TYPE_METHODS | 1 | 15 | 2 (0)| 00:00
|* 5 | INDEX RANGE SCAN | U_SHIPMENT_TYPE_METHODS | 2 | | 1 (0)| 00:00:01 |
|* 6 | INDEX RANGE SCAN | ORDERS_ORDER_DATE | 176K| | 2371 (8)| 00:00:29 |
Predicate Information (identified by operation id):
2 - filter(("O"."PARENT_ORDER_ID" IS NULL OR "O"."ORDER_TYPE"='G' AND
"O"."PARENT_ORDER_ID"=TO_NUMBER("O"."ORIGINAL_ORDER_NUMBER")) AND NVL("O"."PRIORITY",'1')<>'2
AND "O"."SHIPMENT_CLASS_CODE"="STM"."SHIPMENT_CLASS_CODE")
4 - filter("STM"."SURCHARGE_AMOUNT"=0)
5 - access("STM"."CLIENT"='14')
6 - access("O"."CLIENT"='14')
filter("O"."STATUS"='A' OR "O"."STATUS"='U')
24 rows selected.
Elapsed: 00:00:08.92Explain Plan for USE_Hash hint
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 1465232248
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 35 | 46786 (3)| 00:09:22 |
| 1 | SORT GROUP BY NOSORT | | 1 | 35 | 46786 (3)| 00:09:22 |
|* 2 | HASH JOIN | | 25300 | 864K| 46786 (3)| 00:09:22 |
|* 3 | TABLE ACCESS BY INDEX ROWID| SHIPMENT_TYPE_METHODS | 1 | 15 | 2 (0)| 00:00:0
|* 4 | INDEX RANGE SCAN | U_SHIPMENT_TYPE_METHODS | 2 | | 1 (0)| 00:00:01 |
|* 5 | TABLE ACCESS BY INDEX ROWID| ORDERS | 175K| 3431K| 46763 (3)| 00:09:22 |
|* 6 | INDEX RANGE SCAN | ORDERS_ORDER_DATE | 176K| | 4268 (8)| 00:00:52 |
Predicate Information (identified by operation id):
2 - access("O"."CLIENT"="STM"."CLIENT" AND "O"."SHIPMENT_CLASS_CODE"="STM"."SHIPMENT_CLASS_COD
E")
3 - filter("STM"."SURCHARGE_AMOUNT"=0)
4 - access("STM"."CLIENT"='14')
5 - filter(("O"."PARENT_ORDER_ID" IS NULL OR "O"."ORDER_TYPE"='G' AND
"O"."PARENT_ORDER_ID"=TO_NUMBER("O"."ORIGINAL_ORDER_NUMBER")) AND NVL("O"."PRIORITY",'1')<>'2
6 - access("O"."CLIENT"='14')
filter("O"."STATUS"='A' OR "O"."STATUS"='U')
25 rows selected.
Elapsed: 00:00:01.09
SQL> Thanks
Sandy -
Error while running query "time limit exceeding"
while running a query getting error "time limit exceeding".plz help.
hi devi,
use the following links
queries taking long time to run
Query taking too long
with hopes
Raja Singh -
Erro while running query for a Scheduled work book
The following error found while running query for a schedule workbook:
ORA-12801: Error signaled in parallel query server P000
ORA-01652: uable to extend temp segment by 14720 in tablespace SYSTEM
ORA-27068: skgfdisp: buffer is not aligned properly
OSD-04005: SetFilePointer() failure, unable to read it from file
We are using discoverer 4.1.
Any help is highly appreciated.
nullCandi,
Have your DBA check for trace file and contact Oracle Support: RDBMS group to track these errors down...
Chris
null -
Error while running query? urgent
hi,
while running query am getting an error...
"no internal memory space avilable"
what to do now??Neeraja,
Report this to ur Basis guys.It is b'cas of the memory space unavailable in ur system.They will increase the memory space.
Thanks & Regards,
Suchitra.V -
Getting Strange Error Running Query After Partioning Cube
I am using BI 7.0, Service Pack 11:
I just partitioned a cube. I hav eorginal cube XFI_C001 and create a new cube C2_XFIC01 by copying from XFI_C001. Now I developed a query on C2_XFIC01. Similar query on XFI_C001 does not give any error. How can I debug this problem? Error reported when running query is shown below. I ran ST22, no dump. I did SM50, looked at developer trace, no clue.
The initial exception that caused the request to fail was:
Termination message sent
ABEND RSBOLAP (000): Program error in class SAPMSSY1 method : UNCAUGHT_EXCEPTION
MSGV1: SAPMSSY1
MSGV3: UNCAUGHT_EXCEPTION
com.sap.ip.bi.base.application.exceptions.AbortMessageRuntimeException: Termination message sent
ABEND RSBOLAP (000): Program error in class SAPMSSY1 method : UNCAUGHT_EXCEPTION
MSGV1: SAPMSSY1
MSGV3: UNCAUGHT_EXCEPTION
at com.sap.ip.bi.base.application.message.impl.MessageManager.addMessageInternal(MessageManager.java:148)
at com.sap.ip.bi.base.application.message.impl.MessageManager.addMessage(MessageManager.java:113)
Detailed Exception is:
com.sap.ip.bi.base.exception.BIBaseRuntimeException: Error while generating HTML
at com.sap.ip.bi.webapplications.ui.items.UiItem.render(UiItem.java:365)
at com.sap.ip.bi.webapplications.runtime.rendering.impl.ContainerNode.render(ContainerNode.java:63)
at com.sap.ip.bi.webapplications.runtime.rendering.impl.PageAssemblerRenderingRoot.processRendering(PageAssemblerRenderingRoot.java:52)
at com.sap.ip.bi.webapplications.runtime.impl.Page.processRenderingRootNode(Page.java:3565)
at com.sap.ip.bi.webapplications.runtime.impl.Page.processRendering(Page.java:3280)
at com.sap.ip.bi.webapplications.runtime.impl.Page.doProcessRequest(Page.java:3236)
at com.sap.ip.bi.webapplications.runtime.impl.Page.processRequest(Page.java:2512)
at com.sap.ip.bi.webapplications.runtime.controller.impl.Controller.doProcessRequest(Controller.java:956)
at com.sap.ip.bi.webapplications.runtime.controller.impl.Controller.processRequest(Controller.java:842)
at com.sap.ip.bi.webapplications.runtime.jsp.portal.services.BIRuntimeService.handleRequest(BIRuntimeService.java:430)
at com.sap.ip.bi.webapplications.runtime.jsp.portal.components.LauncherComponent.doContent(LauncherComponent.java:21)
at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:645)
at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:522)
at java.security.AccessController.doPrivileged(Native Method)
at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:174)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: com.sap.ip.bi.base.application.exceptions.AbortMessageRuntimeException: Termination message sent
ABEND RSBOLAP (000): Program error in class SAPMSSY1 method : UNCAUGHT_EXCEPTION
MSGV1: SAPMSSY1
MSGV3: UNCAUGHT_EXCEPTION
at com.sap.ip.bi.base.application.message.impl.MessageManager.addMessageInternal(MessageManager.java:148)
at com.sap.ip.bi.base.application.message.impl.MessageManager.addMessage(MessageManager.java:113)
at com.sap.ip.bi.base.application.message.impl.MessageManager.addMessageInternal(MessageManager.java:144)
at com.sap.ip.bi.base.application.message.impl.MessageManager.addMessage(MessageManager.java:113)
at com.sap.ip.bi.base.application.message.impl.MessageManager.addMessageInternal(MessageManager.java:144)
at com.sap.ip.bi.base.application.message.impl.MessageManager.addMessage(MessageManager.java:113)
at com.sap.ip.bi.base.application.service.RfcService.fillMessages(RfcService.java:268)
at com.sap.ip.bi.base.application.service.RfcService.doPostProcessing(RfcService.java:218)
at com.sap.ip.bi.base.application.service.rfcproxy.impl.RfcFunction.execute(RfcFunction.java:57)
at com.sap.ip.bi.base.application.service.RfcService.doPostProcessing(RfcService.java:227)
at com.sap.ip.bi.base.application.service.rfcproxy.impl.RfcFunction.execute(RfcFunction.java:57)
at com.sap.ip.bi.bics.dataaccess.resource.impl.bi.selector.ProviderInfoObject.prepareForSelectionMemberAccess(ProviderInfoObject.java:1215)
at com.sap.ip.bi.bics.dataaccess.resource.impl.bi.selector.selection.ProviderComponentList.setup(ProviderComponentList.java:87)
at com.sap.ip.bi.bics.dataaccess.resource.impl.bi.selector.selection.ProviderComponentList.getComponents(ProviderComponentList.java:120)
at com.sap.ip.bi.bics.dataaccess.consumer.impl.selector.selection.ComponentList.setup(ComponentList.java:96)
at com.sap.ip.bi.bics.dataaccess.consumer.impl.selector.selection.ComponentList.<init>(ComponentList.java:77)
at com.sap.ip.bi.bics.dataaccess.consumer.impl.selector.selection.CartesianProduct.setup(CartesianProduct.java:78)
at com.sap.ip.bi.bics.dataaccess.consumer.impl.selector.selection.CartesianProduct.<init>(CartesianProduct.java:55)
at com.sap.ip.bi.bics.dataaccess.consumer.impl.selector.selection.Selection.<init>(Selection.java:57)
at com.sap.ip.bi.bics.dataaccess.consumer.impl.selector.SelectionObject.createSelection(SelectionObject.java:538)
at com.sap.ip.bi.bics.dataaccess.consumer.impl.selector.SelectionObject.getSelectionSpace(SelectionObject.java:549)
at com.sap.ip.bi.bics.dataaccess.consumer.impl.selector.SelectionObject.getEffectiveSelection(SelectionObject.java:577)
at com.sap.ip.bi.km.impl.KmUtilities.getEffectiveSelection(KmUtilities.java:66)
at com.sap.ip.bi.km.impl.source.property.QueryBuilderMulti.getQueryExpressionWrapper(QueryBuilderMulti.java:129)
at com.sap.ip.bi.km.impl.source.CmFolderSource.getDocumentQueryResult(CmFolderSource.java:132)
at com.sap.ip.bi.km.common.selection.DocumentSelectorResultSet.readQvDocuments(DocumentSelectorResultSet.java:234)
at com.sap.ip.bi.km.common.selection.DocumentSelectorResultSet.getCellsWithDocuments(DocumentSelectorResultSet.java:136)
at com.sap.ip.bi.km.common.selection.DocumentsSelectionService.getCellsWithDocuments(DocumentsSelectionService.java:258)
at com.sap.ip.bi.bics.dataaccess.consumer.impl.queryview.resultset.RsDataCells.hasDocuments(RsDataCells.java:620)
at com.sap.ip.bi.bics.dataaccess.consumer.impl.queryview.resultset.RsDataCell.hasDocuments(RsDataCell.java:543)
at com.sap.ip.bi.webapplications.ui.items.analysis.renderer.interactive.RendererInteractive.createContent_DocumentSymbol(RendererInteractive.java:1660)
at com.sap.ip.bi.webapplications.ui.items.analysis.renderer.interactive.RendererInteractive.createCell_Content(RendererInteractive.java:545)
at com.sap.ip.bi.webapplications.ui.items.analysis.renderer.interactive.RendererInteractive.createCell(RendererInteractive.java:525)
at com.sap.ip.bi.webapplications.ui.items.analysis.renderer.interactive.RendererInteractive.createTableRow(RendererInteractive.java:489)
at com.sap.ip.bi.webapplications.ui.items.analysis.renderer.interactive.RendererInteractive.getContent(RendererInteractive.java:423)
at com.sap.ip.bi.webapplications.ui.items.analysis.control.AcPivotTableInteractive.buildUrTree(AcPivotTableInteractive.java:321)
at com.sap.ip.bi.webapplications.ui.framework.base.impl.CompositeBuildUrTreeTrigger.process(CompositeBuildUrTreeTrigger.java:33)
at com.sap.ip.bi.webapplications.ui.framework.base.composites.UiRootContainer.iterateOverChildren(UiRootContainer.java:40)
at com.sap.ip.bi.webapplications.ui.framework.base.impl.CompositeBuildUrTreeTrigger.process(CompositeBuildUrTreeTrigger.java:36)
at com.sap.ip.bi.webapplications.ui.advancedcontrols.bridge.AcItemBridge.iterateOverChildren(AcItemBridge.java:61)
at com.sap.ip.bi.webapplications.ui.framework.base.impl.CompositeBuildUrTreeTrigger.process(CompositeBuildUrTreeTrigger.java:36)
at com.sap.ip.bi.webapplications.ui.unifiedrendering.controls.FlowLayoutItem.iterateOverChildren(FlowLayoutItem.java:63)
at com.sap.ip.bi.webapplications.ui.framework.base.impl.CompositeBuildUrTreeTrigger.process(CompositeBuildUrTreeTrigger.java:36)
at com.sap.ip.bi.webapplications.ui.unifiedrendering.controls.FlowLayout.iterateOverChildren(FlowLayout.java:69)
at com.sap.ip.bi.webapplications.ui.framework.base.impl.CompositeBuildUrTreeTrigger.process(CompositeBuildUrTreeTrigger.java:36)
at com.sap.ip.bi.webapplications.ui.framework.base.composites.UiRootContainer.iterateOverChildren(UiRootContainer.java:40)
at com.sap.ip.bi.webapplications.ui.framework.base.impl.CompositeBuildUrTreeTrigger.process(CompositeBuildUrTreeTrigger.java:36)
at com.sap.ip.bi.webapplications.ui.advancedcontrols.bridge.AcItemBridge.iterateOverChildren(AcItemBridge.java:61)
at com.sap.ip.bi.webapplications.ui.framework.base.impl.CompositeBuildUrTreeTrigger.process(CompositeBuildUrTreeTrigger.java:36)
at com.sap.ip.bi.webapplications.ui.unifiedrendering.controls.MatrixLayoutCell.iterateOverChildren(MatrixLayoutCell.java:63)
at com.sap.ip.bi.webapplications.ui.framework.base.impl.CompositeBuildUrTreeTrigger.process(CompositeBuildUrTreeTrigger.java:36)
at com.sap.ip.bi.webapplications.ui.unifiedrendering.controls.MatrixLayoutRow.iterateOverChildren(MatrixLayoutRow.java:56)
at com.sap.ip.bi.webapplications.ui.framework.base.impl.CompositeBuildUrTreeTrigger.process(CompositeBuildUrTreeTrigger.java:36)
at com.sap.ip.bi.webapplications.ui.unifiedrendering.controls.MatrixLayout.iterateOverChildren(MatrixLayout.java:69)
at com.sap.ip.bi.webapplications.ui.framework.base.impl.CompositeBuildUrTreeTrigger.process(CompositeBuildUrTreeTrigger.java:36)
at com.sap.ip.bi.webapplications.ui.container.matrixlayout.control.AcMatrixControlGrid.iterateOverChildren(AcMatrixControlGrid.java:40)
at com.sap.ip.bi.webapplications.ui.framework.base.impl.CompositeBuildUrTreeTrigger.process(CompositeBuildUrTreeTrigger.java:36)
at com.sap.ip.bi.webapplications.ui.framework.base.composites.UiRootContainer.iterateOverChildren(UiRootContainer.java:40)
at com.sap.ip.bi.webapplications.ui.framework.base.impl.CompositeBuildUrTreeTrigger.process(CompositeBuildUrTreeTrigger.java:36)
at com.sap.ip.bi.webapplications.ui.advancedcontrols.bridge.AcItemBridge.iterateOverChildren(AcItemBridge.java:61)
at com.sap.ip.bi.webapplications.ui.framework.base.impl.CompositeBuildUrTreeTrigger.process(CompositeBuildUrTreeTrigger.java:36)
at com.sap.ip.bi.webapplications.ui.unifiedrendering.controls.Group.iterateOverChildren(Group.java:63)
at com.sap.ip.bi.webapplications.ui.framework.base.impl.CompositeBuildUrTreeTrigger.process(CompositeBuildUrTreeTrigger.java:36)
at com.sap.ip.bi.webapplications.ui.container.group.control.AcGroupControl.iterateOverChildren(AcGroupControl.java:259)
at com.sap.ip.bi.webapplications.ui.framework.base.impl.CompositeBuildUrTreeTrigger.process(CompositeBuildUrTreeTrigger.java:36)
at com.sap.ip.bi.webapplications.ui.framework.base.composites.UiRootContainer.iterateOverChildren(UiRootContainer.java:40)
at com.sap.ip.bi.webapplications.ui.framework.base.impl.CompositeBuildUrTreeTrigger.process(CompositeBuildUrTreeTrigger.java:36)
at com.sap.ip.bi.webapplications.ui.advancedcontrols.bridge.AcItemBridge.iterateOverChildren(AcItemBridge.java:61)
at com.sap.ip.bi.webapplications.ui.framework.base.impl.CompositeBuildUrTreeTrigger.process(CompositeBuildUrTreeTrigger.java:36)
at com.sap.ip.bi.webapplications.ui.unifiedrendering.controls.FlowLayoutItem.iterateOverChildren(FlowLayoutItem.java:63)
at com.sap.ip.bi.webapplications.ui.framework.base.impl.CompositeBuildUrTreeTrigger.process(CompositeBuildUrTreeTrigger.java:36)
at com.sap.ip.bi.webapplications.ui.unifiedrendering.controls.FlowLayout.iterateOverChildren(FlowLayout.java:69)
at com.sap.ip.bi.webapplications.ui.framework.base.impl.CompositeBuildUrTreeTrigger.process(CompositeBuildUrTreeTrigger.java:36)
at com.sap.ip.bi.webapplications.ui.framework.base.composites.UiRootContainer.iterateOverChildren(UiRootContainer.java:40)
... 42 moreHi,
The error log shows you are executing your query on portal which uses Java stack. There may some issue with the portal configuration. Check with your basis/portal team.
The query will execute in BEx and RSRT as RSRT executes query on ABAP stack.
Regards,Niraj -
How to save a document programatically when u click on "Run Query" button
Hi all,
I am new to BO Web Intelligence java SDK. I am using Java Report Panel to edit and save the document.
(As per my knowledge the default functionality of the Java Panel is, once u edited the document query and then run the query and as when as u click on the "Save" icon then only the report will be saved into the repository )
What my doubt is ?
Once i edited the query in java query panel, when i click on the "Run Query" button the following operation needs to be performed
1) The doucment has to be saved in the specified reposiory folder.
2) The SQL for the docment has to be captured.
how to do the above operations programatically? can any body help me please.... thanks in advance
Thanks & Regards,
Madan KumarYou would have to modify the Java Report Panel to be able to do this. There is no documentation on how to make modifications to the Java Report Panel, and it is beyond the scope of what assistance support would be able to provide you. There may be people in the community that have done this before that can assist you.
-
Explain for a very long running query
Dear gurus,
I have an issue with a long running query which takes around 2 hrs to execute. The tables being used here pertains to 11i, so there is no scope of indexing.
SELECT peia.expenditure_item_id, DECODE (peia.system_linkage_function, 'ST', 'TIME', 'EXP' ) AS CATEGORY,
pea.incurred_by_person_id AS employee_id, emp.attribute6 AS q_number, NVL (emp.employee_number, npw_number) AS employee_number, emp.full_name AS employee_name, peia.project_id,
ppa.segment1, ppa.NAME, func_get_proj_attribute (peia.project_id, NULL, 'PROJECT ENTITY NAME' ) AS project_entity,
func_get_proj_attribute (peia.project_id, NULL, 'PROJECT MANAGER') AS project_manager,
DECODE (ppa.distribution_rule, 'WORK/WORK', 'TM', 'WORK/EVENT', 'TM with Milestone' ) AS project_classification,
ppa.project_type AS funding_type, func_get_proj_attribute(peia.project_id, NULL, 'CUSTOMER GROUP' ) AS customer_group,
func_get_proj_attribute(peia.project_id, NULL, 'ACCOUNT MANAGER' ) AS account_manager,
pt.top_task_id, func_get_task_attribute(pt.top_task_id, 'TASK NUMBER' ) AS task_number,
func_get_task_attribute (pt.top_task_id, 'TASK NAME' ) AS task_name, peia.expenditure_item_date, peia.projfunc_raw_revenue AS func_raw_revenue,
peia.accrued_revenue AS func_accrued_revenue, peia.projfunc_currency_code,
DECODE (peia.project_raw_revenue, NULL,
DECODE (peia.system_linkage_function, 'ST', peia.quantity* NVL (peia.bill_rate, func_get_emp_billrate (pea.incurred_by_person_id, peia.project_id, peia.task_id,
peia.expenditure_item_date )
peia.quantity
peia.project_raw_revenue
( peia.accrued_revenue
/ peia.projfunc_raw_revenue
* peia.project_raw_revenue
) AS project_accrued_revenue,
ppa.project_currency_code,
NVL(peia.bill_rate, func_get_emp_billrate (pea.incurred_by_person_id, peia.project_id, peia.task_id, peia.expenditure_item_date)
) AS bill_rate,
peia.rev_dist_rejection_code, SYSDATE AS generated_date
FROM pa_expenditures_all pea
INNER JOIN (SELECT * FROM per_all_people_f WHERE SYSDATE BETWEEN effective_start_date AND effective_end_date) emp ON NVL(pea.incurred_by_person_id, 61) =emp.person_id
INNER JOIN (SELECT * FROM pa_expenditure_items_all WHERE billable_flag = 'Y' AND quantity <> 0) peia ON pea.expenditure_id =peia.expenditure_id
INNER JOIN (SELECT * FROM pa_projects_all WHERE project_status_code = 'APPROVED' AND distribution_rule IN ('WORK/WORK', 'WORK/EVENT')) ppa ON peia.project_id =ppa.project_id
INNER JOIN pa_tasks pt ON peia.task_id = pt.task_id;
The explain plan for this is:
SELECT STATEMENT CHOOSECost: 26,758 Bytes: 53,373,971 Cardinality: 245,963
9 HASH JOIN Cost: 26,758 Bytes: 53,373,971 Cardinality: 245,963
1 TABLE ACCESS FULL TABLE HR.PER_ALL_PEOPLE_F Cost: 67 Bytes: 546,900 Cardinality: 9,115
8 HASH JOIN Cost: 26,581 Bytes: 20,174,029 Cardinality: 128,497
2 TABLE ACCESS FULL TABLE PA.PA_TASKS Cost: 596 Bytes: 856,370 Cardinality: 85,637
7 HASH JOIN Cost: 25,691 Bytes: 18,889,059 Cardinality: 128,497
3 TABLE ACCESS FULL TABLE PA.PA_EXPENDITURES_ALL Cost: 1,524 Bytes: 5,220,330 Cardinality: 522,033
6 HASH JOIN Cost: 23,701 Bytes: 17,604,089 Cardinality: 128,497
4 TABLE ACCESS FULL TABLE PA.PA_PROJECTS_ALL Cost: 91 Bytes: 49,059 Cardinality: 621
5 TABLE ACCESS FULL TABLE PA.PA_EXPENDITURE_ITEMS_ALL Cost: 23,575 Bytes: 68,913,570 Cardinality: 1,188,165
Can anyone suggests what can be done to improve this query?
Thanks in advance
SA
Edited by: user593719 on Oct 5, 2010 10:29 AM
Edited by: user593719 on Oct 5, 2010 10:30 AM1) Your inner joins are doing record selections that could be done on the Join's ON clause.
2) Look at your functions to see if you can get performance improvements using parameterized CURSORs & adding DETERMINISTIC to the definition.
3) Consider using WITH to first pull your data & then running your functions.
For example:
with
smiths as (
select *
from hr.per_all_people_f papf
where papf.first_name='Smith'
select *
from smiths
where trunc(sysdate) between effective_start_date and effective_end_date;
In general, pare down your data first. Whatever will restrict your data most, start with selecting that table/view. -
Hello Gurus,
Could you send me how to run query in background. There is a record which uses 2-3 years old data which takes 4-5 hrs to run, so we decided to run this query as soon as ODS is loaded with data everyday. This will solve the cache issue as the query already exists in cache.
I know we can do it with broadcaster or running webtemplates..... but step by step process will be a great help.
Thanks a lot.
ChrisDear Follow this link...
http://help.sap.com/saphelp_nw2004s/helpdata/en/a4/1be541f321c717e10000000a155106/frameset.htm
Regards
venu -
I am creating a new Web intelligence document. When I run the queries, after a while I get the following message:
"Running Query
A database error occured. The database error text is: ORA-12154: TNS:could not resolve the connect identifier specified
. (WIS 10901)"
Any ideas what this error means and how to resolve?The message means that the oracle network layer tried to resolve the connection parameters given and failed.
When you use infoview in the browser, the problem is on the physical server where the connection server runs.
Ask the persons responsible to check the oracle client installation there and try to get a connection to that oracle database.
It can be anywhere in the oracle names administration. The most common error is an incomplete tnsnames.ora file.
Good luck,
Marianne -
Longest Run - Sequence of the same character
I want to return the letter that has the longest run in String s. How would i do that.
For example...in "aaabbbbcc"....b would be the result...plz help
Here's my code...but something's wrong with it:
import java.io.*;
import javax.swing.*;
import java.lang.String;
public class StringInfo1 {
public static char longestRun(String s) {
String letter=null;
int num1Letter=0;
int num2Letter=0;
for (int i=0; i != s.length()-1 && s.length() > 0; i++) {
if (s.charAt(i) == s.charAt(i+1)) {
num1Letter=num1Letter+1;
else {
num2Letter=num1Letter;
num1Letter=0;
letter=s.charAt(num1Letter);
return letter(s.charAt(num1Letter));y doesn't this work
-
Running query as diffrent user
Hi,
My qestion is, is there a substitiute for linux "su" in oracle. I.E when im loged in as DBA i whant to run query as XXX user with lower privileges. The problem is i whant to use connectionpool and Ora Lable Security.
Thanks in advice,
MTPerhaps what you want is to run a query connected as a user that has privileges on another user. If it is what you want to do you can do it putting the name of the schema in front of the object name.
for example connected as sys but I want to query
emp table from scott:
select * from scott.emp;
if that is not what you want , reply and explain your
case again.
Joel P�rez
Maybe you are looking for
-
Ok, this is something that just came up. TV shows that I could once sync to my ATV will no longer sync. I don't even get an error in iTunes about why they are not syncing. I did a full factory reset of the ATV (which brings it back to verions 1.0) an
-
Item category related to Quotation, Statistical value field
Hi All, IN my Project, Item category Y003 which is used in creation of Quotions, for which Statistical value is 'X' which means "No cumulation - Values can not be used Statistically". My requirement is I need to change this filed value to 'Y' which m
-
I am going to Fiji and the only internet access that I will have will be a USB stick connected to my MacBook pro through ISP provider over there vodafone. Can I use that Internet connection to create a wifi network so I can use my iPad and iPhone?
-
How to upgrade Tiger and install iLife without a hi-speed connection?
I recently sold my 17" iMac G4 to an internet buyer who wants to edit movies. The last thing I did was reinstall Tiger, erasing all of my files to provide the buyer with a clean slate. First, I'm not sure whether this installation would include iLife
-
Opening outlook file (*.msg) using SAP document viewer...
Hello Gurus, My program uses a function module called 'ARCHIVOBJECT_DISPLAY' to display archived document. This opens SAP dcoument viewer in which I am able to display all kind of files such as doc, pdf, xls but when I try to open a msg file i.e outl