Query is Very Slow but after using sql tuning advisor the Query is fine
Currently we have Query which takes ages to retrieve small data set of 30 seconds.So i used the sql advisor and applied the profile now the same query comes in msec.This was tested on Test enviorement.
Metadata for Table: TIBEX_PARTICIPANT
CREATE TABLE "TST_PRE_EOD"."TIBEX_PARTICIPANT"
( "PARTICIPANTID" VARCHAR2(25) NOT NULL ENABLE,
"PARTICIPANTTYPE" NUMBER(4,0),
"PARTICIPANTSUBTYPE" VARCHAR2(5),
"PARTICIPANTSTATUS" NUMBER(4,0),
"PARTICIPANTNAMESHORT" VARCHAR2(15),
"PARTICIPANTNAME" VARCHAR2(60),
"ROOTPARTICIPANTID" VARCHAR2(25),
"PARENTPARTICIPANTID" VARCHAR2(25),
"SFAREPORTING" CHAR(1),
"ADDRESSOFFICENAME" VARCHAR2(30),
"ADDRESSLINE1" VARCHAR2(60),
"ADDRESSLINE2" VARCHAR2(40),
"ADDRESSLINE3" VARCHAR2(50),
"ADDRESSLINE4" VARCHAR2(50),
"ADDRESSCOUNTRY" VARCHAR2(50),
"WEBURL" VARCHAR2(100),
"PHONENO" VARCHAR2(20),
"FAXNO" VARCHAR2(20),
"CONTACTNAME" VARCHAR2(50),
"CONTACTTITLE" VARCHAR2(30),
"CONTACTEMAIL" VARCHAR2(35),
"CURRENTOPENVAL" FLOAT(126) NOT NULL ENABLE,
"OPENVALLIMIT" FLOAT(126) NOT NULL ENABLE,
"TIMESTAMP" NUMBER(20,0) NOT NULL ENABLE,
"ORDERVALLIMIT" FLOAT(126) NOT NULL ENABLE,
"NOTE" VARCHAR2(50),
"PARTICIPANTINDEX" NUMBER(4,0),
"AUTOROUTETOCLEARING" CHAR(1),
"CREDITID" VARCHAR2(25),
"ISCPTRDDETAILS" CHAR(1) NOT NULL ENABLE,
"PRIMARY_BIC" VARCHAR2(11),
"QSID" VARCHAR2(10) NOT NULL ENABLE,
"INTERNALISEDTRADES" CHAR(1) NOT NULL ENABLE,
CONSTRAINT "XPKTIBEX_PARTICIPANT" PRIMARY KEY ("PARTICIPANTID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "TST_PRE_EOD" ENABLE
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "TST_PRE_EOD" ;
Back to Metadata
Back to Top
Metadata for Table: TIBEX_QUOTE
CREATE TABLE "TST_PRE_EOD"."TIBEX_QUOTE"
( "QUOTEID" CHAR(20) NOT NULL ENABLE,
"USERORDERID" VARCHAR2(25),
"QUOTESTATUS" NUMBER(4,0) NOT NULL ENABLE,
"INDICATIVE" CHAR(1),
"BOARDID" VARCHAR2(10),
"INSTRUMENTID" VARCHAR2(50) NOT NULL ENABLE,
"SELLPRICE" FLOAT(126),
"SELLQTY" NUMBER(10,0),
"BUYPRICE" FLOAT(126),
"BUYQTY" NUMBER(10,0),
"PARTICIPANTID" VARCHAR2(25),
"ACCOUNTNO" VARCHAR2(50),
"LASTINSTRESULT" VARCHAR2(50),
"LASTINSTMESSAGESEQUENCE" NUMBER(20,0) NOT NULL ENABLE,
"BUYQUOTEMINSIZE" NUMBER(10,0),
"LASTEXECUTIONID" CHAR(20),
"SELLQUOTEMINSIZE" NUMBER(10,0),
"TICKMOVECOUNT" NUMBER(10,0),
"TIMESTAMP" NUMBER(20,0) NOT NULL ENABLE,
"SELLQTYFILLED" NUMBER(10,0),
"BUYQTYFILLED" NUMBER(10,0),
"MEID" VARCHAR2(10) NOT NULL ENABLE,
"LASTINSTREJECTCODE" VARCHAR2(10),
"LASTEXECPRICE" FLOAT(126),
"LASTEXECQTY" NUMBER(10,0),
"LASTEXECSIDE" NUMBER(4,0),
"LASTINSTTYPE" NUMBER(4,0),
"LASTEXECUTIONCOUNTERPARTY" VARCHAR2(25),
"BIDTIMESTAMP" NUMBER(20,0),
"OFFERTIMESTAMP" NUMBER(20,0),
"LASTEXECCLEARINGAGENCY" VARCHAR2(11),
"LASTEXECACCOUNTNO" VARCHAR2(50),
"LASTEXECCPCLEARINGAGENCY" VARCHAR2(11),
"LASTEXECBOARDID" VARCHAR2(10),
"MESSAGESEQUENCE" NUMBER(20,0) NOT NULL ENABLE,
"LASTINSTUSERALIAS" CHAR(4) NOT NULL ENABLE,
"PARTNEREXID" CHAR(20),
"LASTSETTLEMENTCYCLE" NUMBER(4,0),
"LASTEXECPOSTTRADEVENUETYPE" NUMBER(4,0),
"PRICELEVELPOSITION" NUMBER(4,0),
"MATCHTYPE" NUMBER(4,0),
"LASTEXECUTIONROLE" VARCHAR2(4),
"REFERENCEID" VARCHAR2(25),
"BUYMDENTRYID" VARCHAR2(13),
"SELLMDENTRYID" VARCHAR2(13),
"HALTREASON" NUMBER(4,0),
"LASTINSTFIXSEQUENCE" NUMBER(20,0)
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "TST_PRE_EOD" ;
Back to Metadata
Back to Top
Metadata for Table: TIBEX_QUOTESTATUSENUM
CREATE TABLE "TST_PRE_EOD"."TIBEX_QUOTESTATUSENUM"
( "QUOTESTATUS" NUMBER(4,0) NOT NULL ENABLE,
"SHORTDESC" VARCHAR2(32) NOT NULL ENABLE,
"DESCRIPTION" VARCHAR2(50),
CONSTRAINT "XPKTIBEX_QUOTESTATUSENUM" PRIMARY KEY ("QUOTESTATUS")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "TST_PRE_EOD" ENABLE
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "TST_PRE_EOD" ;
Back to Metadata
Back to Top
Metadata for Index: IX_QUOTEBOOK
CREATE INDEX "TST_PRE_EOD"."IX_QUOTEBOOK" ON "TST_PRE_EOD"."TIBEX_QUOTE" ("QUOTEID", "MESSAGESEQUENCE", "QUOTESTATUS")
PCTFREE 10 INITRANS 2 MAXTRANS 255 NOLOGGING COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "TST_PRE_EOD" ;
Back to Metadata
Back to Top
Metadata for Index: IX_QUOTE_TIMESTAMP
CREATE INDEX "TST_PRE_EOD"."IX_QUOTE_TIMESTAMP" ON "TST_PRE_EOD"."TIBEX_QUOTE" ("TIMESTAMP")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "TST_PRE_EOD" ;
Back to Metadata
Back to Top
Metadata for Index: TIBEX_PARTICIPANTQSID
CREATE INDEX "TST_PRE_EOD"."TIBEX_PARTICIPANTQSID" ON "TST_PRE_EOD"."TIBEX_PARTICIPANT" ("QSID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "TST_PRE_EOD" ;
Back to Metadata
Back to Top
Metadata for Index: TIBEX_QUOTE_IDX_QLT
CREATE INDEX "TST_PRE_EOD"."TIBEX_QUOTE_IDX_QLT" ON "TST_PRE_EOD"."TIBEX_QUOTE" ("LASTINSTUSERALIAS", "TIMESTAMP")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "TST_PRE_EOD" ;
Back to Metadata
Back to Top
Metadata for Index: XPKTIBEX_PARTICIPANT
CREATE UNIQUE INDEX "TST_PRE_EOD"."XPKTIBEX_PARTICIPANT" ON "TST_PRE_EOD"."TIBEX_PARTICIPANT" ("PARTICIPANTID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "TST_PRE_EOD" ;
Back to Metadata
Back to Top
Metadata for Index: XPKTIBEX_QUOTESTATUSENUM
CREATE UNIQUE INDEX "TST_PRE_EOD"."XPKTIBEX_QUOTESTATUSENUM" ON "TST_PRE_EOD"."TIBEX_QUOTESTATUSENUM" ("QUOTESTATUS")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "TST_PRE_EOD" ;
Back to Metadata
Back to Top
Metadata for View: TIBEX_QUOTESBYQSIDVIEW
CREATE OR REPLACE FORCE VIEW "TST_PRE_EOD"."TIBEX_QUOTESBYQSIDVIEW" ("QUOTEID", "USERORDERID", "QUOTESTATUS", "INDICATIVE", "BOARDID", "INSTRUMENTID", "SELLPRICE", "SELLQTY", "BUYPRICE", "BUYQTY", "PARTICIPANTID", "ACCOUNTNO", "LASTINSTRESULT", "LASTINSTMESSAGESEQUENCE", "BUYQUOTEMINSIZE", "LASTEXECUTIONID", "SELLQUOTEMINSIZE", "TICKMOVECOUNT", "TIMESTAMP", "SELLQTYFILLED", "BUYQTYFILLED", "MEID", "LASTINSTREJECTCODE", "LASTEXECPRICE", "LASTEXECQTY", "LASTEXECSIDE", "LASTINSTTYPE", "LASTEXECUTIONCOUNTERPARTY", "BIDTIMESTAMP", "OFFERTIMESTAMP", "LASTEXECCLEARINGAGENCY", "LASTEXECACCOUNTNO", "LASTEXECCPCLEARINGAGENCY", "LASTEXECBOARDID", "MESSAGESEQUENCE", "LASTINSTUSERALIAS", "PARTNEREXID", "LASTSETTLEMENTCYCLE", "LASTEXECPOSTTRADEVENUETYPE", "PRICELEVELPOSITION", "MATCHTYPE", "LASTEXECUTIONROLE", "REFERENCEID", "BUYMDENTRYID", "SELLMDENTRYID", "HALTREASON", "LASTINSTFIXSEQUENCE", "QSID") AS
SELECT a.QUOTEID, a.USERORDERID, a.QUOTESTATUS, a.INDICATIVE, a.BOARDID,
a.INSTRUMENTID, a.SELLPRICE, a.SELLQTY, a.BUYPRICE, a.BUYQTY,
a.PARTICIPANTID, a.ACCOUNTNO, a.LASTINSTRESULT,
a.LASTINSTMESSAGESEQUENCE, a.BUYQUOTEMINSIZE, a.LASTEXECUTIONID,
a.SELLQUOTEMINSIZE, a.TICKMOVECOUNT, a.TIMESTAMP,
a.SELLQTYFILLED, a.BUYQTYFILLED, a.MEID, a.LASTINSTREJECTCODE,
a.LASTEXECPRICE, a.LASTEXECQTY, a.LASTEXECSIDE, a.LASTINSTTYPE,
a.LASTEXECUTIONCOUNTERPARTY, a.BIDTIMESTAMP, a.OFFERTIMESTAMP,
a.LASTEXECCLEARINGAGENCY, a.LASTEXECACCOUNTNO,
a.LASTEXECCPCLEARINGAGENCY, a.LASTEXECBOARDID,
a.MESSAGESEQUENCE, a.LASTINSTUSERALIAS, a.PARTNEREXID,
a.LASTSETTLEMENTCYCLE, a.LASTEXECPOSTTRADEVENUETYPE,
a.PRICELEVELPOSITION, a.MATCHTYPE, a.LASTEXECUTIONROLE,
a.referenceID, a.BuyMDEntryID, a.SellMDEntryID, a.haltReason,
a.lastInstFixSequence, b.QSID
FROM tibex_quote A,
tibex_Participant b
WHERE a.participantID = b.participantID
AND (A.MessageSequence, A.QuoteID) IN (
SELECT max(C.MessageSequence), C.quoteID
FROM tibex_quote C
WHERE LastInstRejectCode = 'OK'
GROUP By C.QuoteID
AND a.QuoteStatus IN (
SELECT QuoteStatus
FROM tibex_quoteStatusEnum
WHERE ShortDesc IN (
'QUO_ONMKT', 'QUO_OFFMKT', 'QUO_PREOPN'
);Tkprof in Next post
Tkprof Details
TKPROF: Release 10.2.0.4.0 - Production on Thu Jan 28 14:38:44 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Trace file: mifex3_ora_2598_mytrace1.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
BEGIN DBMS_OUTPUT.GET_LINES(:LINES, :NUMLINES); END;
call count cpu elapsed disk query current rows
Parse 2 0.00 0.00 0 0 0 0
Execute 2 0.00 0.00 0 0 0 2
Fetch 0 0.00 0.00 0 0 0 0
total 4 0.00 0.00 0 0 0 2
Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 163
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 3 0.00 0.00
SQL*Net message from client 3 0.00 0.00
select text
from
view$ where rowid=:1
call count cpu elapsed disk query current rows
Parse 2 0.00 0.00 0 0 0 0
Execute 2 0.00 0.02 0 0 0 0
Fetch 2 0.00 0.00 0 4 0 2
total 6 0.00 0.02 0 4 0 2
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
1 TABLE ACCESS BY USER ROWID VIEW$ (cr=1 pr=0 pw=0 time=18 us)
SELECT quoteid, lastexecposttradevenuetype, lastexecqty, matchtype,
haltreason, buyquoteminsize, meid, lastinstuseralias, boardid,
userorderid, buymdentryid, indicative, lastinsttype, lastexecprice,
buyprice, partnerexid, lastinstresult, pricelevelposition,
lastinstrejectcode, TIMESTAMP, buyqtyfilled, referenceid,
lastexecboardid, bidtimestamp, tickmovecount, lastexecside,
offertimestamp, sellprice, participantid, lastexecutioncounterparty,
lastexecaccountno, sellmdentryid, accountno, buyqty, messagesequence,
lastexecutionid, lastexeccpclearingagency, sellqty,
lastexecclearingagency, sellquoteminsize, lastinstfixsequence,
quotestatus, lastinstmessagesequence, instrumentid, sellqtyfilled,
lastexecutionrole, lastsettlementcycle
FROM tibex_quotesbyqsidview
WHERE participantid = 'NITE'
call count cpu elapsed disk query current rows
Parse 1 0.01 0.02 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 6 21.43 20.94 1125 2405864 0 468
total 8 21.44 20.97 1125 2405864 0 468
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 163
Rows Row Source Operation
468 FILTER (cr=2405864 pr=1125 pw=1125 time=20927185 us)
24523 HASH GROUP BY (cr=2405864 pr=1125 pw=1125 time=21171165 us)
2994085 TABLE ACCESS BY INDEX ROWID TIBEX_QUOTE (cr=2405864 pr=0 pw=0 time=8983645 us)
3076661 NESTED LOOPS (cr=87651 pr=0 pw=0 time=3092729 us)
24523 HASH JOIN (cr=18276 pr=0 pw=0 time=173004 us)
3 NESTED LOOPS (cr=8 pr=0 pw=0 time=81 us)
1 INDEX UNIQUE SCAN XPKTIBEX_PARTICIPANT (cr=1 pr=0 pw=0 time=18 us)(object id 168573)
3 TABLE ACCESS FULL TIBEX_QUOTESTATUSENUM (cr=7 pr=0 pw=0 time=55 us)
24523 TABLE ACCESS FULL TIBEX_QUOTE (cr=18268 pr=0 pw=0 time=122762 us)
3052137 INDEX RANGE SCAN IX_QUOTEBOOK (cr=69375 pr=0 pw=0 time=195648 us)(object id 168590)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 6 0.00 0.00
SQL*Net more data to client 46 0.00 0.00
direct path write temp 75 0.00 0.04
SQL*Net message from client 6 0.00 0.00
direct path read temp 75 0.00 0.00
DELETE FROM PLAN_TABLE
WHERE
STATEMENT_ID=:1
call count cpu elapsed disk query current rows
Parse 2 0.00 0.00 0 0 0 0
Execute 2 0.00 0.04 0 9 16 11
Fetch 0 0.00 0.00 0 0 0 0
total 4 0.00 0.04 0 9 16 11
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 163
Rows Row Source Operation
0 DELETE PLAN_TABLE$ (cr=4 pr=0 pw=0 time=33 us)
0 TABLE ACCESS FULL PLAN_TABLE$ (cr=4 pr=0 pw=0 time=30 us)
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.01 0.02
SELECT /* OPT_DYN_SAMP */ /*+ ALL_ROWS IGNORE_WHERE_CLAUSE
NO_PARALLEL(SAMPLESUB) opt_param('parallel_execution_enabled', 'false')
NO_PARALLEL_INDEX(SAMPLESUB) NO_SQL_TUNE */ NVL(SUM(C1),0), NVL(SUM(C2),0)
FROM
(SELECT /*+ IGNORE_WHERE_CLAUSE NO_PARALLEL("PLAN_TABLE") FULL("PLAN_TABLE")
NO_PARALLEL_INDEX("PLAN_TABLE") */ 1 AS C1, CASE WHEN
"PLAN_TABLE"."STATEMENT_ID"=:B1 THEN 1 ELSE 0 END AS C2 FROM
"SYS"."PLAN_TABLE$" "PLAN_TABLE") SAMPLESUB
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 4 0 1
total 3 0.00 0.00 0 4 0 1
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 163 (recursive depth: 1)
Rows Row Source Operation
1 SORT AGGREGATE (cr=4 pr=0 pw=0 time=56 us)
0 TABLE ACCESS FULL PLAN_TABLE$ (cr=4 pr=0 pw=0 time=43 us)
EXPLAIN PLAN SET STATEMENT_ID='PLUS8205116' FOR SELECT quoteid, lastexecposttradevenuetype, lastexecqty, matchtype,
haltreason, buyquoteminsize, meid, lastinstuseralias, boardid,
userorderid, buymdentryid, indicative, lastinsttype, lastexecprice,
buyprice, partnerexid, lastinstresult, pricelevelposition,
lastinstrejectcode, TIMESTAMP, buyqtyfilled, referenceid,
lastexecboardid, bidtimestamp, tickmovecount, lastexecside,
offertimestamp, sellprice, participantid, lastexecutioncounterparty,
lastexecaccountno, sellmdentryid, accountno, buyqty, messagesequence,
lastexecutionid, lastexeccpclearingagency, sellqty,
lastexecclearingagency, sellquoteminsize, lastinstfixsequence,
quotestatus, lastinstmessagesequence, instrumentid, sellqtyfilled,
lastexecutionrole, lastsettlementcycle
FROM tibex_quotesbyqsidview
WHERE participantid = 'NITE'
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 0 0.00 0.00 0 0 0 0
total 2 0.01 0.01 0 0 0 0
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 163
Rows Row Source Operation
0 FILTER (cr=0 pr=0 pw=0 time=0 us)
0 HASH GROUP BY (cr=0 pr=0 pw=0 time=0 us)
0 TABLE ACCESS BY INDEX ROWID TIBEX_QUOTE (cr=0 pr=0 pw=0 time=0 us)
0 NESTED LOOPS (cr=0 pr=0 pw=0 time=0 us)
0 HASH JOIN (cr=0 pr=0 pw=0 time=0 us)
0 NESTED LOOPS (cr=0 pr=0 pw=0 time=0 us)
0 INDEX UNIQUE SCAN XPKTIBEX_PARTICIPANT (cr=0 pr=0 pw=0 time=0 us)(object id 168573)
0 TABLE ACCESS FULL TIBEX_QUOTESTATUSENUM (cr=0 pr=0 pw=0 time=0 us)
0 TABLE ACCESS FULL TIBEX_QUOTE (cr=0 pr=0 pw=0 time=0 us)
0 INDEX RANGE SCAN IX_QUOTEBOOK (cr=0 pr=0 pw=0 time=0 us)(object id 168590)
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 0.00 0.00
insert into plan_table (statement_id, timestamp, operation, options,
object_node, object_owner, object_name, object_instance, object_type,
search_columns, id, parent_id, position, other,optimizer, cost, cardinality,
bytes, other_tag, partition_start, partition_stop, partition_id,
distribution, cpu_cost, io_cost, temp_space, access_predicates,
filter_predicates, projection, time, qblock_name, object_alias, plan_id,
depth, remarks, other_xml )
values
(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14,:15,:16,:17,:18,:19,:20,:21,
:22,:23,:24,:25,:26,:27,:28,:29,:30,:31,:32,:33,:34,:35,:36)
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 11 0.00 0.03 0 4 16 11
Fetch 0 0.00 0.00 0 0 0 0
total 12 0.00 0.03 0 4 16 11
Misses in library cache during parse: 1
Misses in library cache during execute: 3
Optimizer mode: ALL_ROWS
Parsing user id: 163 (recursive depth: 1)
SELECT ORA_PLAN_ID_SEQ$.NEXTVAL
FROM
DUAL
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 0 0 1
total 3 0.00 0.00 0 0 0 1
Misses in library cache during parse: 1
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
1 SEQUENCE ORA_PLAN_ID_SEQ$ (cr=0 pr=0 pw=0 time=18 us)
1 FAST DUAL (cr=0 pr=0 pw=0 time=2 us)
SELECT PLAN_TABLE_OUTPUT
FROM
TABLE(DBMS_XPLAN.DISPLAY('PLAN_TABLE', :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 117 0 0
Fetch 2 0.00 0.00 0 0 0 28
total 4 0.00 0.00 0 117 0 28
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 163
Rows Row Source Operation
28 COLLECTION ITERATOR PICKLER FETCH DISPLAY (cr=202 pr=0 pw=0 time=19391 us)
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.00 0.00
SQL*Net more data to client 1 0.00 0.00
select u.name, o.name, a.interface_version#, o.obj#
from
association$ a, user$ u, obj$ o where a.obj# = :1
and a.property = :2
and a.statstype# = o.obj# and
u.user# = o.owner#
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 1 0 0
total 3 0.00 0.00 0 1 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 NESTED LOOPS (cr=1 pr=0 pw=0 time=32 us)
0 NESTED LOOPS (cr=1 pr=0 pw=0 time=30 us)
0 TABLE ACCESS BY INDEX ROWID ASSOCIATION$ (cr=1 pr=0 pw=0 time=27 us)
0 INDEX RANGE SCAN ASSOC1 (cr=1 pr=0 pw=0 time=23 us)(object id 387)
0 TABLE ACCESS BY INDEX ROWID OBJ$ (cr=0 pr=0 pw=0 time=0 us)
0 INDEX UNIQUE SCAN I_OBJ1 (cr=0 pr=0 pw=0 time=0 us)(object id 36)
0 TABLE ACCESS CLUSTER USER$ (cr=0 pr=0 pw=0 time=0 us)
0 INDEX UNIQUE SCAN I_USER# (cr=0 pr=0 pw=0 time=0 us)(object id 11)
SELECT /* OPT_DYN_SAMP */ /*+ ALL_ROWS IGNORE_WHERE_CLAUSE
NO_PARALLEL(SAMPLESUB) opt_param('parallel_execution_enabled', 'false')
NO_PARALLEL_INDEX(SAMPLESUB) NO_SQL_TUNE */ NVL(SUM(C1),:"SYS_B_0"),
NVL(SUM(C2),:"SYS_B_1")
FROM
(SELECT /*+ NO_PARALLEL("PLAN_TABLE") FULL("PLAN_TABLE")
NO_PARALLEL_INDEX("PLAN_TABLE") */ :"SYS_B_2" AS C1, :"SYS_B_3" AS C2 FROM
"SYS"."PLAN_TABLE$" "PLAN_TABLE") SAMPLESUB
call count cpu elapsed disk query current rows
Parse 2 0.00 0.00 0 0 0 0
Execute 2 0.00 0.00 0 0 0 0
Fetch 2 0.00 0.00 0 8 0 2
total 6 0.00 0.00 0 8 0 2
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 163 (recursive depth: 2)
Rows Row Source Operation
1 SORT AGGREGATE (cr=4 pr=0 pw=0 time=55 us)
11 TABLE ACCESS FULL PLAN_TABLE$ (cr=4 pr=0 pw=0 time=44 us)
select /*+ opt_param('parallel_execution_enabled',
'false') EXEC_FROM_DBMS_XPLAN */ * from PLAN_TABLE where 1=0
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 1 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
total 2 0.00 0.00 0 1 0 0
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 163 (recursive depth: 1)
Rows Row Source Operation
0 FILTER (cr=0 pr=0 pw=0 time=1 us)
0 TABLE ACCESS FULL PLAN_TABLE$ (cr=0 pr=0 pw=0 time=0 us)
SELECT /*+ opt_param('parallel_execution_enabled', 'false') */
/* EXEC_FROM_DBMS_XPLAN */ id, position, depth, operation, options, object_name, cardinality, bytes, temp_space, cost, io_cost, cpu_cost , time, partition_start, partition_stop, object_node, other_tag, distribution, projection, access_predicates, filter_predicates , other, qblock_name, object_alias, nvl(other_xml, remarks), null, null, null, null, null, null, null,
null, null, null, null, null,
null, null, null, null from PLAN_TABLE where plan_id = (select max(plan_id)
from PLAN_TABLE where id=0 and statement_id = :stmt_id)
order by id
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 2 0 0
Fetch 12 0.00 0.00 0 8 7 11
total 14 0.00 0.00 0 10 7 11
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 163 (recursive depth: 2)
Rows Row Source Operation
11 SORT ORDER BY (cr=8 pr=0 pw=0 time=239 us)
11 TABLE ACCESS FULL PLAN_TABLE$ (cr=8 pr=0 pw=0 time=117 us)
1 SORT AGGREGATE (cr=4 pr=0 pw=0 time=30 us)
1 TABLE ACCESS FULL PLAN_TABLE$ (cr=4 pr=0 pw=0 time=21 us)
SELECT /* OPT_DYN_SAMP */ /*+ ALL_ROWS IGNORE_WHERE_CLAUSE
NO_PARALLEL(SAMPLESUB) opt_param('parallel_execution_enabled', 'false')
NO_PARALLEL_INDEX(SAMPLESUB) NO_SQL_TUNE */ NVL(SUM(C1),0), NVL(SUM(C2),0)
FROM
(SELECT /*+ IGNORE_WHERE_CLAUSE NO_PARALLEL("PLAN_TABLE") FULL("PLAN_TABLE")
NO_PARALLEL_INDEX("PLAN_TABLE") */ 1 AS C1, CASE WHEN "PLAN_TABLE"."ID"=0
AND "PLAN_TABLE"."STATEMENT_ID"=:B1 THEN 1 ELSE 0 END AS C2 FROM
"SYS"."PLAN_TABLE$" "PLAN_TABLE") SAMPLESUB
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 4 0 1
total 3 0.00 0.00 0 4 0 1
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 163 (recursive depth: 2)
Rows Row Source Operation
1 SORT AGGREGATE (cr=4 pr=0 pw=0 time=57 us)
11 TABLE ACCESS FULL PLAN_TABLE$ (cr=4 pr=0 pw=0 time=44 us)
SELECT PLAN_TABLE_OUTPUT
FROM
TABLE(CAST(DBMS_XPLAN.PREPARE_RECORDS(:B1 , :B2 ) AS
SYS.DBMS_XPLAN_TYPE_TABLE))
call count cpu elapsed disk query current rows
Parse 0 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 5 5 28
total 2 0.00 0.00 0 5 5 28
Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 163 (recursive depth: 1)
SELECT /*+ opt_param('parallel_execution_enabled', 'false') */
extractvalue(xmlval, '/*/info[@type = "sql_profile"]'), extractvalue(xmlval,
'/*/info[@type = "outline"]'), extractvalue(xmlval, '/*/info[@type =
"dynamic_sampling"]'), extractvalue(xmlval, '/*/info[@type =
"row_shipping"]'), extractvalue(xmlval, '/*/info[@type = "index_size"]'),
extractvalue(xmlval,'/*/info[@type = "plan_hash"]')
from
(select xmltype(:v_other_xml) xmlval from dual)
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 150 0 0
Fetch 1 0.00 0.00 0 24 0 1
total 3 0.01 0.01 0 174 0 1
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 163 (recursive depth: 2)
Rows Row Source Operation
1 FAST DUAL (cr=0 pr=0 pw=0 time=3 us)
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 7 0.01 0.03 0 0 0 0
Execute 7 0.01 0.04 0 126 16 13
Fetch 8 21.43 20.94 1125 2405864 0 496
total 22 21.46 21.02 1125 2405990 16 509
Misses in library cache during parse: 4
Misses in library cache during execute: 2
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 14 0.00 0.00
SQL*Net message from client 14 0.01 0.03
SQL*Net more data to client 47 0.00 0.00
direct path write temp 75 0.00 0.04
direct path read temp 75 0.00 0.00
log file sync 1 0.00 0.00
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 12 0.00 0.00 0 1 0 0
Execute 23 0.01 0.07 0 156 16 11
Fetch 22 0.00 0.00 0 58 12 47
total 57 0.02 0.08 0 215 28 58
Misses in library cache during parse: 10
Misses in library cache during execute: 10
16 user SQL statements in session.
4 internal SQL statements in session.
20 SQL statements in session.
Trace file: mifex3_ora_2598_mytrace1.trc
Trace file compatibility: 10.01.00
Sort options: default
4 sessions in tracefile.
35 user SQL statements in trace file.
9 internal SQL statements in trace file.
20 SQL statements in trace file.
16 unique SQL statements in trace file.
493 lines in trace file.
21 elapsed seconds in trace file.
Similar Messages
-
Additional licenses reuired for using Sql Tuning Advisor In SQL Developer 4.0.3
Hi,
We have Oracle Database 11g Enterprise Edition Release 11.2.0.3.0. Do we need to purchase an additional oracle license for using SQL Tuning Advisor Option in SQL Developer 4.0.3We have Oracle Database 11g Enterprise Edition Release 11.2.0.3.0. Do we need to purchase an additional oracle license for using SQL Tuning Advisor Option in SQL Developer 4.0.3
The Oracle Tuning Pack is DATABASE functionality - it is part of the database. Sql Developer just uses it.
Yes - to use ANY of the features of the tuning pack requires an extra cost license.
http://docs.oracle.com/cd/B28359_01/license.111/b28287/options.htm#CIHFIHFG
Oracle Tuning Pack
The Oracle Tuning Pack provides database administrators with expert performance management for the Oracle environment, including SQL tuning and storage optimizations. The Oracle Diagnostic Pack is a prerequisite product to the Oracle Tuning Pack. Therefore, to use the Tuning Pack, you must also have a Diagnostic Pack.
The Tuning Pack includes the following features:
SQL Access Advisor
SQL Tuning Advisor
Automatic SQL Tuning
SQL Tuning Sets
SQL Monitoring
Reorganize objects
In order to use the features listed above, you must purchase licenses for the Tuning Pack, with one exception: SQL Tuning Sets can be used if you have licensed either the Tuning Pack or Oracle Real Application Testing. A new initialization parameter, CONTROL_MANAGEMENT_PACK_ACCESS, is introduced to control access to the Diagnostic Pack and Tuning Pack in the database server. This parameter can be set to one of three values:
DIAGNOSTIC+TUNING: Diagnostic Pack and Tuning Pack functionally is enabled in the database server.
DIAGNOSTIC: Only Diagnostic Pack functionality is enabled in the server.
NONE: Diagnostic Pack and Tuning pack functionally is disabled in the database server.
The Tuning Pack functionality can be accessed by the Enterprise Manager links as well as through the database server command-line APIs. The use of either interface requires licensing of the Tuning Pack -
Tuning sql automatic using SQL Tuning Advisor Tool
I need to work on Automatic sql tuning..
Please give suggestion for the below
1) I have installed oracle11g client version. confirm this is okey for my project. because i heard we should have oracle enterprise edition for this.
2) User with only sys privelage can work on this automatic sql tuning using sql tuning advisior tool.
Please clarify above suggestions.
ALso suggest me best way to proceed further
SSunny kichloo wrote:
This docs will help
http://www.oracle-base.com/articles/10g/automatic-sql-tuning-10g.php
http://www.oracle-base.com/articles/11g/automatic-sql-tuning-11gr1.php
Thanks for your link. i already seen this link.
Could u pls answer my question on above with " Yes" or "No"
Kindly reply
S -
Help with performance SQL tuning - Rewriting the query
Hi
I have serious performance issues with some 8 update queries
These were earlier taking 5 mins . Now taking 2.5 hours
This is one of the culprit UPDATE statement (These are 7 such other update statements on different tables but same logic)
We have change the update to MERGE and used PARALLEL hints but have not got desired results
There are appropriate indexes on the tables
Is there a way to rewrite the UPDATE statement in a better way to improve the performance
update TABLE_dob
set key_act =
(select skey from table_subs
where sub_act = sub_num)
where exists
(select 1 from table_subs
where sub_act = sub_num);
Table_DOB has 37 million records
Table_subs has 20 million recordsaashoo_5 wrote:
Hi
I have serious performance issues with some 8 update queries
These were earlier taking 5 mins . Now taking 2.5 hours
This is one of the culprit UPDATE statement (These are 7 such other update statements on different tables but same logic)
We have change the update to MERGE and used PARALLEL hints but have not got desired results
There are appropriate indexes on the tables
Is there a way to rewrite the UPDATE statement in a better way to improve the performance
update TABLE_dob
set key_act =
(select skey from table_subs
where sub_act = sub_num)
where exists
(select 1 from table_subs
where sub_act = sub_num);
Table_DOB has 37 million records
Table_subs has 20 million recordsThread: HOW TO: Post a SQL statement tuning request - template posting
HOW TO: Post a SQL statement tuning request - template posting -
Hardware Information:
iMac (24-inch, Early 2008)
iMac - model: iMac8,1
1 3.06 GHz Intel Core 2 Duo CPU: 2 cores
2 GB RAM
Video Information:
NVIDIA GeForce 8800 GS - VRAM: 512 MB
System Software:
Mac OS X 10.7.5 (11G63) - Uptime: 9 days 2:47:17
Disk Information:
ST3500630AS Q disk0 : (500.11 GB)
disk0s1 (disk0s1) <not mounted>: 209.7 MB
Macintosh HD (disk0s2) / [Startup]: 499.25 GB (163.92 GB free)
Recovery HD (disk0s3) <not mounted>: 650 MB
USB Information:
Apple Inc. Built-in iSight
Apple, Inc. Keyboard Hub
Apple, Inc Apple Keyboard
Apple Inc. BRCM2046 Hub
Apple Inc. Bluetooth USB Host Controller
Apple Computer, Inc. IR Receiver
FireWire Information:
Thunderbolt Information:
Launch Daemons:
[System] com.adobe.fpsaud.plist 3rd-Party support link
[System] com.carbonite.launchd.carbonitedaemon.plist 3rd-Party support link
[System] com.microsoft.office.licensing.helper.plist 3rd-Party support link
[System] com.oracle.java.Helper-Tool.plist 3rd-Party support link
Launch Agents:
[System] com.adobe.AAM.Updater-1.0.plist 3rd-Party support link
[System] com.carbonite.launchd.carbonitealerts.plist 3rd-Party support link
[System] com.carbonite.launchd.carbonitestatus.plist 3rd-Party support link
[System] com.oracle.java.Java-Updater.plist 3rd-Party support link
User Launch Agents:
[not loaded] com.adobe.AAM.Updater-1.0.plist 3rd-Party support link
[not loaded] com.adobe.ARM.[...].plist 3rd-Party support link
[not loaded] com.zeobit.MacKeeper.Helper.plist 3rd-Party support link
User Login Items:
iTunesHelper
Canon IJ Network Scan Utility
Safari
Internet Plug-ins:
JavaAppletPlugin: Version: Java 7 Update 45 Outdated! Update
FlashPlayer-10.6: Version: 12.0.0.70 - SDK 10.6 3rd-Party support link
QuickTime Plugin: Version: 7.7.1
Flash Player: Version: 12.0.0.70 - SDK 10.6 3rd-Party support link
AdobePDFViewer: Version: 9.5.5 3rd-Party support link
CouponPrinter-FireFox_v2: Version: Version 1.1.6 3rd-Party support link
SharePointBrowserPlugin: Version: 14.3.9 - SDK 10.6 3rd-Party support link
Silverlight: Version: 2.0.40115.0 3rd-Party support link
iPhotoPhotocast: Version: 7.0 - SDK 10.8
Audio Plug-ins:
iSightAudio: Version: 7.7.1 - SDK 10.7
iTunes Plug-ins:
Quartz Composer Visualizer: Version: 1.3 - SDK 10.7
3rd Party Preference Panes:
Carbonite 3rd-Party support link
Flash Player 3rd-Party support link
Java 3rd-Party support link
Old Applications:
None
Time Machine:
Time Machine not configured!
Top Processes by CPU:
1% WindowServer
1% EtreCheck
1% activitymonitord
0% Activity Monitor
0% CarboniteDaemon
Top Processes by Memory:
238 MB WebProcess
119 MB mds
94 MB Safari
88 MB Finder
88 MB CarboniteDaemon
Virtual Memory Information:
385 MB Free RAM
1.00 GB Active RAM
230 MB Inactive RAM
402 MB Wired RAM
3.94 GB Page-ins
1.57 GB Page-outsUpdate Java and then see:
Mac Maintenance Quick Assist,
Mac OS X speed FAQ,
Speeding up Macs,
How to Speed up Macs,
Macintosh OS X Routine Maintenance,
Mac troubleshooting: What to do when your computer is too slow,
Essential Mac Maintenance: Get set up,
Essential Mac Maintenance: Rev up your routines,
Maintaining OS X,
Five Mac maintenance myths and
Myths of required versus not required maintenance for Mac OS X for information. -
Firefox responds generally very slow but fast when moving the mouse
Firefox respons very slow but speeds up when I move the mouse over the page. Keeping the mouse moving results in normal speed.
?? PeterWeird thing is that if I revert back to FF15, everything works with HA enabled and full bookmark menu.
but its a no go with FF16
PEACE -
Dear all,
We have installed oracle 11g on solaris. We have configured EM with this DB.. Is there anyway I can check a query using sql tuning advisor in oracle 11g. ? .. I tried, but I couldn't find the exact navigation ?. I need to submit th query and get the advise from sql tuninig advisor ?
Please guide
KaiOEM db console ?
Am doing this for educational purpose and not in production
kai -
Stucked between SQL Tuning Advisor and and SQL statement
Hi,
There is an important query running on my system which consists
MEMBER OF function.
At first place let me explain why i used MEMBER OF,
I am sending a string( eg : #123#124#125) to query and a function converts this string into a number array.
After then I use this number array inside my sql.
The reason I am using this structure, in order to generate a dynamic IN statement inside my sql. (IF you have any other solution that would be great)
The most important point is; when I put this statement to SQL Tuning Advisor the response is only ORA-00932: inconsistent datatypes: expected UDT got CHAR
Any answer will be greatly appreciated.
ThanksSolomon Yakobson wrote:
Object oriented stuff almost never provides better performance over relational. You should stay away from MEMBER OF if performance is a factor. Instead of:
WHERE expr MEMBER OF nested-tableI'd test:
WHERE expr IN (SELECT column_value FROM TABLE(nested-table))SY.
expr IN (SELECT COLUMN_VALUE FROM TABLE (CAST (v_type_number_table AS type_number_table)))worked like a charm. i hope tuning advisor will like it as i do.
thanks. -
I am working as a junior DBA. I tried to tune a query using SQL Tuning Advisor that is with DBMS_SQLTUNE.I have created the tuning task successfully with DBMS_SQLTUNE.create_tuning_task.But when i execute the tuning task with EXEC DBMS_SQLTUNE.execute_tuning_task() i got an error like
SQL> EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => 'rep_three');
BEGIN DBMS_SQLTUNE.execute_tuning_task(task_name => 'rep_three'); END;
ERROR at line 1:
ORA-00081: address range [0x60000000000A7D70, 0x60000000000A7D74) is not
readable
ORA-00600: internal error code, arguments: [kesatmGetSqlStats:optCost], [], [],
ORA-06512: at "SYS.PRVT_ADVISOR", line 1624
ORA-06512: at "SYS.DBMS_ADVISOR", line 186
ORA-06512: at "SYS.DBMS_SQLTUNE", line 1008
ORA-06512: at line 1The oracle version is Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bi. The OS is HP-UX. The version is HP-UX B.11.23 U ia64.
I tried to execute DBMS_SQLTUNE as DWH user.I have granted the advisor,DROP ANY SQL PROFILE,ALTER ANY SQL PROFILE,CREATE ANY SQL PROFILE privileges and DBA roles to the DWH user. The way i ran DBMS_SQLTUNE is, first i logged in as DWH user and i tried to execute the query for getting the SQL_ID for the query. For getting the SQL_ID i selected the SQL_ID column value for the DWH user session from v$session.I kept that query executing and meanwhile i opened another session as DWH user and created the tuning task as follows
DECLARE
l_sql_tune_task_id VARCHAR2(100);
BEGIN
l_sql_tune_task_id := DBMS_SQLTUNE.create_tuning_task (
sql_id => 'b65fj39dkkb9v',
scope => DBMS_SQLTUNE.scope_limited,
time_limit => 3600,
task_name => 'rep_three',
description => 'Report Tuning');
DBMS_OUTPUT.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id);
END;
/The creation of tuning task was successful.And i executed the tuning task as follows
EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => 'rep_three');The above mentioned errors came when i executed the tuning task.
I am also adding the query which i have tried to tune
select * from dwh.beneficiary_dim BEN_DIM,
(Select adr_dp_id,
adr_account_no,
ADR_ADDRESS_LINE_1 || ' ' ||
ADR_ADDRESS_LINE_2 || ' ' ||
ADR_ADDRESS_LINE_3 || ' ' ||
ADR_ADDRESS_LINE_4 as ADDRESS,
adr_pin_code,adr_phone_no,adr_fax_no
from dwh.beneficiary_address_dim where adr_type_id = 1) PERMANENT_ADD_DIM,
(Select adr_dp_id,
adr_account_no,
ADR_ADDRESS_LINE_1 || ' ' ||
ADR_ADDRESS_LINE_2 || ' ' ||
ADR_ADDRESS_LINE_3 || ' ' ||
ADR_ADDRESS_LINE_4 as ADDRESS,
adr_pin_code,adr_phone_no,adr_fax_no
from dwh.beneficiary_address_dim where adr_type_id = 2) BANK_ADD_DIM,
(Select adr_dp_id,
adr_account_no,
ADR_ADDRESS_LINE_1 || ' ' ||
ADR_ADDRESS_LINE_2 || ' ' ||
ADR_ADDRESS_LINE_3 || ' ' ||
ADR_ADDRESS_LINE_4 as ADDRESS,
adr_pin_code,adr_phone_no,adr_fax_no
from dwh.beneficiary_address_dim where adr_type_id = 3) NOM_GUARDIAN_ADD_DIM,
(Select adr_dp_id,
adr_account_no,
ADR_ADDRESS_LINE_1 || ' ' ||
ADR_ADDRESS_LINE_2 || ' ' ||
ADR_ADDRESS_LINE_3 || ' ' ||
ADR_ADDRESS_LINE_4 as ADDRESS,
adr_pin_code,adr_phone_no,adr_fax_no
from dwh.beneficiary_address_dim where adr_type_id = 4) CORR_ADD_DIM,
(Select adr_dp_id,
adr_account_no,
ADR_ADDRESS_LINE_1 || ' ' ||
ADR_ADDRESS_LINE_2 || ' ' ||
ADR_ADDRESS_LINE_3 || ' ' ||
ADR_ADDRESS_LINE_4 as ADDRESS,
adr_pin_code,adr_phone_no,adr_fax_no
from dwh.beneficiary_address_dim where adr_type_id = 6) MINOR_ADDRESS,
(Select rp.requestid as requestid,
decode(rp.value,'ALL','ALL','','ALL',decode(substr(rp.value,1,instr(rp.value,'|',1,1)-1),'','ALL',substr(rp.value,1,instr(rp.value,'|',1,1)-1))) as Name,
decode(rp.value,'ALL','ALL','','ALL',decode(substr(rp.value,(instr(rp.value,'|',1,1)+1),((instr(rp.value,'|',1,2))-(instr(rp.value,'|',1,1)+1))),'','ALL',substr(rp.value,(instr(rp.value,'|',1,1)+1),((instr(rp.value,'|',1,2))-(instr(rp.value,'|',1,1)+1))))) as Address,
decode(rp.value,'ALL','ALL','','ALL',decode(substr(rp.value,(instr(rp.value,'|',1,2)+1)),'','ALL',substr(rp.value,(instr(rp.value,'|',1,2)+1)))) as PAN
from disadmin.requestparameters rp, disadmin.requestparameters rps, disadmin.reportrequests rr
where rp.parameterid = 'CNAS_PARAM_VALUE'
and rr.status = 'A'
and rp.requestid = rr.id
and rp.id = rps.id) P_PARAM_VALUE,
(Select rp.requestid as requestid, rp.value as Type
from disadmin.requestparameters rp, disadmin.reportrequests rr
where rp.parameterid = 'CNAS_NAME_TYPE'
and rr.status = 'A'
and rp.requestid = rr.id) P_NAME_TYPE,
(Select rp.requestid as requestid, rp.value as Addtype
from disadmin.requestparameters rp, disadmin.reportrequests rr
where rp.parameterid = 'CNAS_ADDRESS_TYPE'
and rr.status = 'A'
and rp.requestid = rr.id) P_ADDRESS_TYPE
where ( 1= case when P_NAME_TYPE.Type = 'F' then
case when BEN_DIM.BDM_FIRST_HOLDER_NAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_FIRST_HOLDER_NAME||'%','%'||P_PARAM_VALUE.Name||'%')
or BEN_DIM.BDM_FIRST_HOLDER_SURNAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_FIRST_HOLDER_SURNAME||'%','%'||P_PARAM_VALUE.Name||'%')
then 1
else null end
else
case when P_NAME_TYPE.Type = 'ALL' then
case when (BEN_DIM.BDM_FIRST_HOLDER_NAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_FIRST_HOLDER_NAME||'%','%'||P_PARAM_VALUE.Name||'%')
or BEN_DIM.BDM_FIRST_HOLDER_SURNAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_FIRST_HOLDER_SURNAME||'%','%'||P_PARAM_VALUE.Name||'%'))
and BEN_DIM.BDM_SECOND_HOLDER_NAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_SECOND_HOLDER_NAME||'%','%'||P_PARAM_VALUE.Name||'%')
and BEN_DIM.BDM_THIRD_HOLDER_NAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_THIRD_HOLDER_NAME||'%','%'||P_PARAM_VALUE.Name||'%')
then 1
else null end
else null end
end )
and BEN_DIM.BDM_IT_PAN like DECODE(P_PARAM_VALUE.PAN,'ALL','%'||BEN_DIM.BDM_IT_PAN||'%','%'||P_PARAM_VALUE.PAN||'%')
and (1 = case when P_ADDRESS_TYPE.ADDTYPE = 1 then
case when instr(PERMANENT_ADD_DIM.ADDRESS, DECODE(P_PARAM_VALUE.ADDRESS,'ALL',PERMANENT_ADD_DIM.ADDRESS, P_PARAM_VALUE.ADDRESS)) <> 0
then 1
else null end
when P_ADDRESS_TYPE.ADDTYPE = 3 then
case when instr(NOM_GUARDIAN_ADD_DIM.ADDRESS, DECODE(P_PARAM_VALUE.ADDRESS,'ALL',NOM_GUARDIAN_ADD_DIM.ADDRESS, P_PARAM_VALUE.ADDRESS)) <> 0
then 1
else null end
when P_ADDRESS_TYPE.ADDTYPE = 4 then
case when instr(CORR_ADD_DIM.ADDRESS, DECODE(P_PARAM_VALUE.ADDRESS,'ALL',CORR_ADD_DIM.ADDRESS, P_PARAM_VALUE.ADDRESS)) <> 0
then 1
else null end
when P_ADDRESS_TYPE.ADDTYPE = 6 then
case when instr(MINOR_ADDRESS.ADDRESS, DECODE(P_PARAM_VALUE.ADDRESS,'ALL',MINOR_ADDRESS.ADDRESS, P_PARAM_VALUE.ADDRESS)) <> 0
then 1
else null end
else null end );The above query also tries to access some tables from another user DISADMIN. Could you please help me in solving this problem while using SQL Tuning Advisor ? I am the only DBA here.will the rows really be updated just by using the package?Considering DMLs
SQL> select * from test
2 /
NO
1
2
SQL> ed
Wrote file afiedt.buf
1 DECLARE
2 my_task_name VARCHAR2(30);
3 my_sqltext CLOB;
4 BEGIN
5 my_sqltext := 'insert into test values (3)';
6 my_task_name := DBMS_SQLTUNE.CREATE_TUNING_TASK(
7 sql_text => my_sqltext,
8 task_name => 'my_sql_tuning_task');
9* end;
SQL> /
PL/SQL procedure successfully completed.
SQL> BEGIN
2 DBMS_SQLTUNE.EXECUTE_TUNING_TASK( task_name => 'my_sql_tuning_task' );
3 END;
4 /
PL/SQL procedure successfully completed.
SQL> select * from test
2 /
NO
1
2
SQL> SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK( 'my_sql_tuning_task')
2 FROM DUAL;
DBMS_SQLTUNE.REPORT_TUNING_TASK('MY_SQL_TUNING_TASK')
GENERAL INFORMATION SECTION
Tuning Task Name : my_sql_tuning_task
Tuning Task Owner : TEST
Scope : COMPREHENSIVE
Time Limit(seconds): 1800
Completion Status : COMPLETED
Started at : 03/27/2008 05:16:14
Completed at : 03/27/2008 05:16:16
DBMS_SQLTUNE.REPORT_TUNING_TASK('MY_SQL_TUNING_TASK')
Schema Name: TEST
SQL ID : gwkmgmyj9824t
SQL Text : insert into test values (3)
There are no recommendations to improve the statement.
-------------------------------------------------------------------------------Adith -
Oracle11g standarad Edititon-Sql tuning Advisor
Hi,
Do we have provision to tune the query using sql tuning advisor in oracle 11g r1 Standard Edition SE
Thanks
mafaizMafaiz,
Tuning & Diagnostic Packs are available in Enterprise Edition only
Oracle Database - Standard Edition & Diagnosis Pack???
Thanks,
Ajay More
http://www.moreajays.com -
Sql tuning advisor for concurrent requests
Dear all,
I am having one doubt in my mind from very long time.Can we use sql tuning advisor from 10G(EM) to tune concurrent requests and reports?
RegardsHi Helios,
I am just thinking wiht voice. If you have one code blog which is typed in sql-pl/sql for your concurrent request, its going and run on dbtier. So it has one SQL'ID and also can be check on AWR report. So i belive you can use sqltuning adviser for to can tune related sqlAFAIK, some Instances a single concurrent request may contain multiple SQLID's and in that scenario tuning approach is difficult. Any information how can we consolidate it. If tune one specific sql then the explain plan for other sql become more worst. I came across this situation so many time.
Any information or inputs on this is really appreciated.
thanks,
X A H E E R -
SQL Tuning Advisor on a specific SQL statement
Hi all,
How can I used SQL Tuning Advisor in Oracle EM Database Control to tune a specific SQL statement; i.e. the statement is not any of: Top SQL, SQL Tuning Sets, Snapshots Preserved Snapshot Sets.
Thanks in advance,
Ahmed B.Hi,
You can use either the automatic SQL tuning features that are accessible from Enterprise Manager Database Console on the "Advisor Central" page or trough SQL*PLUS using the DBMS_SQLTUNE pakage:
-- creating the tuning task
set serveroutput on
declare
l_sql_tune_task_id varchar2(100);
begin
l_sql_tune_task_id := dbms_sqltune.create_tuning_task (
sql_id => '<your_sql_id>',
scope => dbms_sqltune.scope_comprehensive,
time_limit => 60,
task_name => '<your_tuning_task_name>',
description => 'tuning task for statement your_sql_id.');
dbms_output.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id);
end;
-- executing the tuning task
exec dbms_sqltune.execute_tuning_task(task_name => '<your_tuning_task_name>');
-- displaying the recommendations
set long 100000;
set longchunksize 1000
set pagesize 10000
set linesize 100
select dbms_sqltune.report_tuning_task('<your_tuning_task_name>') as recommendations from dual;For more information, take a look at link provided by Jaffy.
Cheers
Legatti -
Sql Tuning advisor Misc message
HI I am using SQL Tuning advisor to tune one of my queries.I am gettin following recommendation
Miscellaneous The optimizer could not merge the view at line ID 4 of the execution plan.
I am attaching my execution plan .Please let me know what does that mean and what action i have to take
Execution Plan
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Tim
| 0 | SELECT STATEMENT | | | | 10130 (100)|
| 1 | HASH GROUP BY | | 56 | 15848 | 10130 (1)| 00:
| 2 | VIEW | | 56 | 15848 | 10129 (1)| 00:
| 3 | WINDOW BUFFER | | 56 | 63280 | 10129 (1)| 00:
| 4 | VIEW | | 56 | 63280 | 10129 (1)| 00:
| 5 | WINDOW SORT | | 56 | 24752 | 10129 (1)| 00:
| 6 | NESTED LOOPS | | 56 | 24752 | 10128 (1)| 00:
| 7 | NESTED LOOPS | | 55 | 22165 | 10018 (1)| 00:
| 8 | NESTED LOOPS | | 58 | 21866 | 9902 (1)| 00:
| 9 | NESTED LOOPS | | 60 | 21060 | 9781 (1)| 00:
| 10 | NESTED LOOPS | | 60 | 19020 | 9661 (1)| 00:
| 11 | NESTED LOOPS | | 63 | 18333 | 9534 (1)| 00:
| 12 | NESTED LOOPS | | 67 | 17755 | 9400 (1)| 00:
| 13 | NESTED LOOPS | | 67 | 12931 | 9333 (1)| 00:
| 14 | NESTED LOOPS | | 67 | 11725 | 9266 (1)| 00:
| 15 | HASH JOIN | | 67 | 10854 | 9198 (1)| 00:
| 16 | HASH JOIN | | 67 | 10117 | 9160 (1)| 00:
| 17 | HASH JOIN | | 67 | 9581 | 9154 (1)| 00:
| 18 | TABLE ACCESS BY INDEX ROWID | T_FACT_AGGR_TAX_RPTG | 1355 | 178K| 9149 (1)| 00:
| 19 | NESTED LOOPS | | 67 | 9045 | 9149 (1)| 00:
| 20 | MAT_VIEW ACCESS FULL | MV_T_DIM_INSTM | 1 | 43 | 53 (4)| 00:
| 21 | BITMAP CONVERSION TO ROWIDS| | | | |
| 22 | BITMAP INDEX SINGLE VALUE | XB_T_FACT_AGGR_TAX_RPTG_N5 | | | |
| 23 | MAT_VIEW ACCESS FULL | MV_T_DIM_CURR | 457 | 3656 | 5 (0)| 00:
| 24 | MAT_VIEW ACCESS FULL | MV_T_DIM_CURR | 457 | 3656 | 5 (0)| 00:
| 25 | VIEW | index$_join$_007 | 3480 | 38280 | 38 (6)| 00:
| 26 | HASH JOIN | | | | |
| 27 | INDEX FAST FULL SCAN | XPK_MV_ORIG_T_DIM_MNGMT_ENT | 3480 | 38280 | 10 (0)| 00:
| 28 | INDEX FAST FULL SCAN | X_MV_CUR_T_DIM_MNGMT_ENT_N1 | 3480 | 38280 | 27 (4)| 00:
| 29 | TABLE ACCESS BY INDEX ROWID | T_DIM_DATE | 1 | 13 | 1 (0)| 00:
| 30 | INDEX UNIQUE SCAN | XPK_T_DIM_DATE | 1 | | 0 (0)|
| 31 | MAT_VIEW ACCESS BY INDEX ROWID | MV_T_DIM_EXTL_PARTY | 1 | 18 | 1 (0)| 00:
| 32 | INDEX UNIQUE SCAN | XPK_MV_T_DIM_EXTL_PARTY | 1 | | 0 (0)|
| 33 | MAT_VIEW ACCESS BY INDEX ROWID | MV_T_DIM_LGL_ENT_BR | 1 | 72 | 1 (0)| 00:
| 34 | INDEX UNIQUE SCAN | XPK_MV_O_LGL_ENT_BR | 1 | | 0 (0)|
| 35 | TABLE ACCESS BY INDEX ROWID | T_FACT_DAILY_RATE | 1 | 330 | 2 (0)| 00:
| 36 | INDEX UNIQUE SCAN | XPK_T_FACT_DAILY_RATE | 1 | | 1 (0)| 00:
| 37 | TABLE ACCESS BY INDEX ROWID | T_FACT_DAILY_RATE | 1 | 356 | 2 (0)| 00:
| 38 | INDEX UNIQUE SCAN | XPK_T_FACT_DAILY_RATE | 1 | | 1 (0)| 00:
| 39 | MAT_VIEW ACCESS BY INDEX ROWID | MV_T_DIM_TRD | 1 | 34 | 2 (0)| 00:
| 40 | INDEX UNIQUE SCAN | XPK_MV_T_DIM_TRD | 1 | | 1 (0)| 00:
| 41 | TABLE ACCESS BY INDEX ROWID | T_FACT_DAILY_RATE | 1 | 382 | 2 (0)| 00:
| 42 | INDEX UNIQUE SCAN | XPK_T_FACT_DAILY_RATE | 1 | | 1 (0)| 00:
| 43 | TABLE ACCESS BY INDEX ROWID | T_FACT_DAILY_RATE | 1 | 442 | 2 (0)| 00:
| 44 | INDEX UNIQUE SCAN | XPK_T_FACT_DAILY_RATE | 1 | | 1 (0)| 00:
| 45 | TABLE ACCESS BY INDEX ROWID | T_FACT_AGGR_WGT_AVG_RATE | 1 | 39 | 2 (0)| 00:
| 46 | INDEX UNIQUE SCAN | XPK_T_FACT_AGGR_WGT_AVG_RATE | 1 | | 1 (0)| 00:
Thanks
Pramod GarreNo version number? Why? And I am not interested in manually formatting your post to make it readable.
In the FAQ which you should have read there is a clear explanation of how to use tags so that what you copy in retains its formatting.
Please read the FAQ and correct what you posted as well as providing more information such as the type of application, the DML being executed, and why you are using the tuning advisor at all?
There doesn't seem to be much here that couldn't be far more easily created with:
explain plan for
<your SQL statement>
followed by:
SELECT * FROM TABLE(dbms_xplan.display); -
How to get the query result of improvement (Before and After ) using sql de
how to get the query result of improvement (Before and After ) using sql developer.
Check
http://www.oracle.com/technetwork/articles/sql/exploring-sql-developer-1637307.html -
I am using ipod touch 4g 8 gb, with ios6 software. It is getting very very slow even after i reinstalled the software. Apps like temple run 2 and subway surfers are getting stuck and it is very very slow.My ipod has 2.6 gb free space. What is the problem. I am not getting to know. Even after i reinstalled these apps it is still getting stuck and it is very very slow. Is this what i get after paying so much money for ipod. Is this what i get very poor perfomance.
Periodically double click the home button and close all the apps in the recently used dock. Then power off and then back on the iPod. This frees up memory. The 4G only has 256 MB of memory.
Next
- Reset the iOS device. Nothing will be lost
Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
least ten seconds, until the Apple logo appears.
- Restore from backup. See:
iOS: How to back up
- Restore to factory settings/new iOS device.
Maybe you are looking for
-
How to add an order disappers in version
hi guru How do I add an order to this allocation? In changing the version 3 to version 2 for 2011, in this segment, the ZK_AR1 disappears. can you help me out how to add it? It worked fine in version 3, but disappears in version 2.. Please advise I
-
Can I query with a select statement in the from statement
I'm working with an application that creates a MASTERTABLE that keeps track of DATATABLEs as it creates them. These data tables are only allowed to be so big, so the data tables are time stamped. What I need to do is to be able to query the MASTERTAB
-
Hi All, We have a termination process from MSS. When clicked on the function from home page, it launches hirerachy page and then from then when clicked on action for a particular person takes you to the effective date PG. After selecting effective da
-
New iPhone 5s Overheating and Losing Battery Life
I just received the new iPhone 5s, and it's been on for all of 30 minutes, during which I restored the phone via iCloud backup and reinstalled my apps, etc. In these 30 minutes, the phone overheated and dropped down to 40% battery. Any reason as to w
-
My sister got locked out of her macbook air. What can I do to help her get back in?
She tried to reset her password and that wasn't working so she gave up and shut the laptop. When she opened it both her old password and new password failed. :/ She was confused because it hadn't reset her password in the beginning so why wouldn't he