SQL advisor
Hi,
Can you please let me know purpose or usage of sql advisor in oracle 10g.While select the particular task its showing the below error
- ORA-01006: bind variable does not exist
some times its showing
ORA-00972: identifier is too long
Dird wrote:
Hi riedelme,
The too many values was strange, it seems that Oracle doesn't take the most recent version of a profile but instead returns them all. I executed the same thing 2 times at first & that must be the reason for the error. I used the drop profile command & re-ran them once & the profile could be accepted.
My issue now with the query is it's built around a specified value e.g.
FROM t1, t2
WHERE t1.col = t2.col and t1.col = 'JIM'Now if I do it with the value 'PAUL' it ignores the profile. Since the profiles are declared in PL/SQL can I just replace 'JIM' with :name and would that work with = 'JIM' or 'PAUL'? Or would I have to use bind variables then? :x
I used the table name instead of alias for USE_NL()...I'll try again with the alias tomorrow.
Do you know the tables the new query is kept in related to an Oracle profile? Or does Oracle not publish this? If I can't use a placeholder like :name then I'd like to manually use the hints without the profiler instead~Sorry for a late reply. I was off last week :)
If you change a hard-coded value and the plan changes the most likely reason is that the optimizer is using histograms and is deciding that an index would help with one value but not another (skewed data). Using bind variables makes this less certain depending on your version but in 11g may not make a difference. Also possible is a phenemenon known as "bind peeking" (theoretically fixed in 11g) which re-uses an execution plan under less-than-perfect circumstances.
It is hard to tell what the profiler does behind the scenes. Using hints is more work but probably offers better control although under the right circumstances a profile might offer better results
Similar Messages
-
SQL Advisor with SQL_ID
Hi All,
I want to use SQL Advisor for SQL performance tuning. Here I don't want to create SQL and pass it to DBMS_SQLTUNE.create_tuning_task. I want to pass SQL_ID in this. So whenever I ran my SQL, I want to capture its SQL_ID. How can we get this. I used gv$sql, but it is not showing me my SQL.
Regards,
Danish
Edited by: dbdan on Aug 7, 2009 9:42 AM
changed view to useHi Anantha,
Is it not possible to RUN any SQL --> Get its SQL_ID --> Pass it to SQL Advisor? Without creating snapshots or tuning sets.
regards,
Danish
Edited by: dbdan on Aug 10, 2009 12:20 AM -
How to use sql advisor in sql developer 3.0?
I don't see it in the documentation. I download the docs. I did a search through the user guide for "advisor". I did a search of help for "advisor". I have version 3.0.04
It's in the worksheet. Enter some sql. 5th icon on the toolbar is the sql tuning advisor.
-kris -
SQL Advisor Job failed...
Hi ,
I have installed the Oracle RDBMS 10g and Enterprise Manager as well.....
I try to run the SQL Access Advisor as user SYS but it constantly fails...
The error messages are as follows.....
ORA-13605: Task or Object SQLACCESS8165579 does not exist...
Details ORA-06512: in "SYS.PRVT_ADVISOR", line 2676 , ORA-06512: in "SYS.DBMS_ADVISOR line 247 , ORA-06512: line23 does not exist for the current user....
So , do i have to run the SQL Access Advisor with another user or should I first grant some specific-in this situation which are- privileges to user SYS...????
Regards,
SimonSomething else....
I have noticed in the the Job Scheduler window that the following pl/sql block has been executed....
DECLARE
taskname varchar2(30);
task_desc varchar2(256);
task_or_template varchar2(30);
task_id number;
wkld_name varchar2(30);
saved_rows number;
failed_rows number;
num_found number;
BEGIN
task_id := 0;
saved_rows := 0;
failed_rows := 0;
taskname := 'SQLACCESS6026890';
task_desc := 'SQL Access Advisor';
task_or_template := 'null';
wkld_name := 'SQLACCESS6026890_wkld';
/* Create Task */
dbms_advisor.create_task(DBMS_ADVISOR.SQLACCESS_ADVISOR,task_id,taskname,task_desc,task_or_template);
/* Reset Task */
dbms_advisor.reset_task(taskname);
/* Create Workload */
select count(*) into num_found from user_advisor_sqlw_sum where workload_name = wkld_name;
IF num_found = 0 THEN
dbms_advisor.create_sqlwkld(wkld_name,null);
END IF;
/* Reset Workload */
dbms_advisor.reset_sqlwkld(wkld_name);
/* Link Workload to Task */
select count(*) into num_found from user_advisor_sqla_wk_map where task_name = taskname and workload_name = wkld_name;
IF num_found = 0 THEN
dbms_advisor.add_sqlwkld_ref(taskname,wkld_name);
END IF;
/* Set Workload Parameters */
dbms_advisor.set_sqlwkld_parameter(wkld_name,'ACTION_LIST',DBMS_ADVISOR.ADVISOR_UNUSED);
dbms_advisor.set_sqlwkld_parameter(wkld_name,'MODULE_LIST',DBMS_ADVISOR.ADVISOR_UNUSED);
dbms_advisor.set_sqlwkld_parameter(wkld_name,'SQL_LIMIT',DBMS_ADVISOR.ADVISOR_UNLIMITED);
dbms_advisor.set_sqlwkld_parameter(wkld_name,'ORDER_LIST','PRIORITY,OPTIMIZER_COST');
dbms_advisor.set_sqlwkld_parameter(wkld_name,'USERNAME_LIST',DBMS_ADVISOR.ADVISOR_UNUSED);
dbms_advisor.set_sqlwkld_parameter(wkld_name,'VALID_TABLE_LIST',DBMS_ADVISOR.ADVISOR_UNUSED);
dbms_advisor.set_sqlwkld_parameter(wkld_name,'INVALID_TABLE_LIST',DBMS_ADVISOR.ADVISOR_UNUSED);
dbms_advisor.set_sqlwkld_parameter(wkld_name,'INVALID_ACTION_LIST',DBMS_ADVISOR.ADVISOR_UNUSED);
dbms_advisor.set_sqlwkld_parameter(wkld_name,'INVALID_USERNAME_LIST',DBMS_ADVISOR.ADVISOR_UNUSED);
dbms_advisor.set_sqlwkld_parameter(wkld_name,'INVALID_MODULE_LIST',DBMS_ADVISOR.ADVISOR_UNUSED);
dbms_advisor.set_sqlwkld_parameter(wkld_name,'VALID_SQLSTRING_LIST',DBMS_ADVISOR.ADVISOR_UNUSED);
dbms_advisor.set_sqlwkld_parameter(wkld_name,'INVALID_SQLSTRING_LIST',DBMS_ADVISOR.ADVISOR_UNUSED);
dbms_advisor.set_sqlwkld_parameter(wkld_name,'JOURNALING','9');
dbms_advisor.set_sqlwkld_parameter(wkld_name,'DAYS_TO_EXPIRE','30');
dbms_advisor.import_sqlwkld_sqlcache(wkld_name,'REPLACE',2,saved_rows,failed_rows);
/* Set Task Parameters */
dbms_advisor.set_task_parameter(taskname,'EXECUTION_TYPE','FULL');
dbms_advisor.set_task_parameter(taskname,'MODE','COMPREHENSIVE');
dbms_advisor.set_task_parameter(taskname,'STORAGE_CHANGE',DBMS_ADVISOR.ADVISOR_UNLIMITED);
dbms_advisor.set_task_parameter(taskname,'DML_VOLATILITY','TRUE');
dbms_advisor.set_task_parameter(taskname,'ORDER_LIST','PRIORITY,OPTIMIZER_COST');
dbms_advisor.set_task_parameter(taskname,'WORKLOAD_SCOPE','FULL');
dbms_advisor.set_task_parameter(taskname,'DEF_INDEX_TABLESPACE',DBMS_ADVISOR.ADVISOR_UNUSED);
dbms_advisor.set_task_parameter(taskname,'DEF_INDEX_OWNER',DBMS_ADVISOR.ADVISOR_UNUSED);
dbms_advisor.set_task_parameter(taskname,'DEF_MVIEW_TABLESPACE',DBMS_ADVISOR.ADVISOR_UNUSED);
dbms_advisor.set_task_parameter(taskname,'DEF_MVIEW_OWNER',DBMS_ADVISOR.ADVISOR_UNUSED);
dbms_advisor.set_task_parameter(taskname,'DEF_MVLOG_TABLESPACE',DBMS_ADVISOR.ADVISOR_UNUSED);
dbms_advisor.set_task_parameter(taskname,'CREATION_COST','TRUE');
dbms_advisor.set_task_parameter(taskname,'EVALUATION_ONLY','FALSE');
dbms_advisor.set_task_parameter(taskname,'JOURNALING','9');
dbms_advisor.set_task_parameter(taskname,'DAYS_TO_EXPIRE','30');
/* Execute Task */
dbms_advisor.execute_task(taskname);
END;In the above , the create task command is under comments.....
But if i uncomment this , and execute it in SQL*PLUS as user SYS , then I get the following errors...
ORA-13600:error encountered in Advisor string
ORA-13635:The value provided for parameter string cannot be converted to a number. The parameter string is "ADJUSTED_SCALEUP_GREEN_THRESH"
ORA-06512: in "SYS.PRVT_ADVISOR", line 3902
ORA-06512: in "SYS.DBMS_ADVISOR", line 102
ORA-06512: in line 21
Whowwww!!!
What can I get rid of these errors?????
Thanks , a lot for time and interest!!!
Simon -
Hi All
I am using Oracle 10g on windows.. With help of Advisor Central i get the latest explain of the SQL Query .. when i click on Implement button .. its create a SQL Profile for me.. Now is that is their any way were i can get the query which is created by SQL Profile.
Thanx in Advance
ManiHi,
When you click Implmenet, then a job is created with a Immediate execution. You can go to the page of Advisor Central and down, you can find the jobs that were created and executed. You can find out the job by the descrition and/or date time that you have tried. You can click on the job and see all the details.
HTH
Regards,
Badri. -
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 postTkprof 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. -
Enterprise Manager - sql tuning advisor , Access advisor for SQL Tuning
Hi,
NO I mean in oracle 10g you have the enterprise manager which can be used to tune sql statements using the SQL ADvisor and SQL access advisor.
I believe in oracle 10g the process of SQL Tuning is slightly easier using the Enterprise Manager ...so if some one could explain me that process...
Again thanking you in advance
regds
Manoj GokhaleHi Manoj,
tune sql statements using the SQL ADvisor and SQL access advisor.Do you have the OEM extra cost "performance pack"?
The OEM screens are fairly self-explainatory, but here are some references on the 10 SQL tuning advisors:
http://www.oracle-base.com/articles/10g/AutomaticSQLTuning10g.php
http://www.remote-dba.net/oracle_10g_tuning/t_oracle_sql_tuning_advisor_session_example.htm -
Differernce between SQL Tuning Pack and SQL Tuning Advisor, Access Advisor
Hi. all.
I have been using "TKPROF" in order to tune SQL till now.
I am learning 10g, and would like to know the difference
between "1. SQL Tuning Pack" and "2. SQL Tuning Advisor, Access Advisor".
Are they same thing? If not, what are the differences in their "functionality"?
All I know is that SQL Tuning Pack is not free, and SQL Tuning Advisor
is packed with default installation. Right???
Could you give me some html links or your "any advice and experience"?
Thanks in advance. Have a good day.
Best Regards.Hi,
There are alternatives to the Oracle tuning packs, and remember the SQL advisors are relatuively simple, finding missing indexes and recommending MV's.
A human can do a better job if you use the right techniques.
BTW, you can get a SQLTuning advisor license online for only $3k:
http://www.dba-oracle.com/oracle_news/2005_3_17_dql_tuning_access_advisor_licenses_available_online.htm
SHAMELESS PITCH! - I wrote a book that describes techniques for tuning with scripts, instead of the advisors, if you are interested:
http://www.rampant-books.com/book_2005_1_awr_proactive_tuning.htm
Hope this helps. . . .
Donald K. Burleson
Oracle Press author -
Dear all,
DB version:10.2.0.3
Yeasterday i ran a sql advisor jobs from EM and implemented the profile with recommedations.Now i want to disable it.I am unable to find that profile through EM.
Please provide the right procedure.
RegardsHi,
SQL profiles implementedthis is what i am not finding...where?I i want to search with SQL_ID may be i will get but in table dba_sql_profiles im unable to see sql id
Regards
Edited by: hungry_dba on Mar 3, 2011 10:50 AM -
Hi,
I have a sql which is recently having a performance problems in Production. I have generated a explain plan for it trying to find out what it is doing but plan itself is close to 1000 lines. I want to check if there is any efficient way to go through big plan like this one and quickly find the damaging areas..
2) I also wanted to know if there is way to generate explain plans in HTML format which executed in past and have entry in dba_hist_sqltext.
3) I also have two sql_monitor reports which I want to compare. is there any efficient way to do it as well?
Please share your thoughts!
Thanks in advance!
Regards,
Suman-Hi,
I suggest you can try running sql advisor on the query maybe something fruitful comes up
http://www.oracle-base.com/articles/11g/sql-access-advisor-11gr1.php
I am not sure about the explain plan being printed in html format but
You may also want to try the sqlhistory.sql query from below page
http://evdbt.com/scripts/
I have used it many times to check on executions and explain plans which may have changed over the period
I have faced it many times , the query picks up a bad explain plan and performs poorly -
SQL Tuning Pack for 10G R2 database
Hi,
I am looking for a SQL tuning pack plug in with SQL Developer 2.1 release for Oracle 10g R2 database.
Any information this would be appreciated.
Thanks,
PatchavaThere is no 'tuning pack' plugin for SQL Developer, We can process trace files, monitor sessions etc.
If you are looking for specifics on things like SQL Advisor, SQL Profiles and things, we do not have specific features for them yet, but we have planned them in the future.
Barry -
High CPU usage after 10g to 11g Migration
Hello,
I have migrated some database instances via import/export from 10g 10.0.3.0 to 11g 11.2.0.2
I found that below SQL Statements mainly cause the high CPU load
select * from (select null table_qualifier, o1.owner table_owner, o1.object_name table_name, decode(o1.owner, :"SYS_B_00", decode(o1.object_type, :"SYS_B_01", :"SYS_B_02", :"SYS_B_03", :"SYS_B_04", o1.object_type), :"SYS_B_05", decode(o1.object_type, :"SYS_B_06", :"SYS_B_07", :"SYS_B_08", :"SYS_B_09 ", o1.object_type), o1.object_type) table_type, null remarks from all_objects o1 where o1.object_type in (:"SYS_B_10", :"SYS_B_11") union select null table_qualifier, s.owner table_owner, s.synonym_name table_name, :"SYS_B_12" table_type, null remarks from all_objects o3, all_synonyms s where o3.object_type in (:"SYS_B_13", :"SYS_B_14") and s.table_owner= o3.owner and s.table_name = o3.object_name union select null table_qualifier, s1.owner table_owner, s1.synonym_name table_name, :"SYS_B_15" table_type, null remarks from all_synonyms s1 where s1.db_link is not null ) tables WHERE :"SYS_B_16"=:"SYS_B_17" AND TABLE_NAME=:"SYS_B_18" ORDER BY :"SYS_B_19", :"SYS_B_20", :"SYS_B_21"
(SELECT :"SYS_B_00", T.owner, T.table_name, TO_NUMBER(NULL), :"SYS_B_01", :"SYS_B_02", :"SYS_B_03", TO_NUMBER(NULL), :"SYS_B_04", :"SYS_B_05", num_rows, blocks, NULL FROM ALL_TABLES T WHERE table_name=:"SYS_B_06" UNION SELECT :"SYS_B_07", a.table_owner, a.table_name, decode(a.uniqueness, :"SYS_B_08", :"SYS_B_09", :"SYS_B_10"), a.owner, a.index_name, :"SYS_B_11&q uot;, b.column_position, b.column_name, :"SYS_B_12", a.distinct_keys, a.leaf_blocks, NULL FROM ALL_INDEXES a, ALL_IND_COLUMNS b WHERE a.owner = b.index_owner AND a.index_name = b.index_name AND a.table_owner=:"SYS_B_13" AND a.table_name=:"SYS_B_14" UNION SELECT :"SYS_B_15", c.owner, c.synonym_name, decode(a.uniqueness, :"SYS_B_16", :"SYS_B_17", :"SYS_B_18"), a.owner, a.index_name, :"SYS_B_19", b.colu mn_position, b.column_name, :"SYS_B_20", a.distinct_keys, a.leaf_blocks, NULL FROM ALL_INDEXES a, ALL_IND_COLUMNS b, ALL_SYNONYMS c WHERE c.synonym_name=:"SYS_B_21" AND c.owner=:"SYS_B_22" AND c.table_name = a.table_name AND c.table_name = b.table_name AND c.table_owner= a.table_owner AND c.table_owner= b.table_owner AND a.owner = b.index_owner AND a.index_name = b.index_name ) ORDER BY :"SYS_B_23", :"SYS_B_24", :"SYS_B_25", : "SYS_B_26"
Does anyone know why it is so??
I have gathered System Statistics and data dictionary statistics also, but had same performance issue.
Thanks,
RajWe have a similar issue:
SELECT '', T.owner, T.table_name, TO_NUMBER(NULL), '', '', 0, TO_NUMBER(NULL), '', '', num_rows, blocks, NULL FROM ALL_TABLES...
It appears this kind of statement is being generated from MS Access 2007 as part of a translation to Oracle SQL. I suspect Access 2007 doesn't know about the 11gR2 system catalog changes.
The Oracle SQL Advisor indicates the following on the SQL statement comming from Acess 2007:
Restructure SQL An expensive cartesian product operation was found at line ID 5 of the execution plan. Consider removing the disconnected table or view from this statement or add a join condition which refers to it. A cartesian product should be avoided whenever possible because it is an expensive operation and might produce a large amount of data.
Restructure SQL An expensive "UNION" operation was found at line ID 1 of the execution plan. Consider using "UNION ALL" instead of "UNION", if duplicates are allowed or uniqueness is guaranteed. "UNION" is an expensive and blocking operation because it requires elimination of duplicate rows. "UNION ALL" is a cheaper alternative, assuming that duplicates are allowed or uniqueness is guaranteed.
I think application needs to upgrade to Access 2010 or Access 2007 needs a service pack.
There is also supposed to be a way to remove the system & sys catalog calls from Access 2007 on the PC this is coming from. -
Error while executing tuning task in 10gr2
10.2.0.5 on RHEL/5.
select name, status
from dba_sql_profiles
where status = 'ENABLED'
/ 2 3 4
no rows selected
SELECT task_name, EXECUTION_START,EXECUTION_END,status,ERROR_MESSAGE FROM dba_advisor_log WHERE task_name = '1nqbz1wytzjps_tuning_task';
TASK_NAME EXECUTION EXECUTION STATUS ERROR_MESS
1nqbz1wytzjps_tuning_task 24-JAN-13 24-JAN-13 COMPLETED
EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => '1nqbz1wytzjps_tuning_task');
ERROR at line 1:
ORA-13630: The task 1nqbz1wytzjps_tuning_task contains execution results and cannot be executed.
ORA-06512: at "SYS.PRVT_ADVISOR", line 1709
ORA-06512: at "SYS.DBMS_ADVISOR", line 186
ORA-06512: at "SYS.DBMS_SQLTUNE", line 1019
ORA-06512: at line 1
Elapsed: 00:00:00.02
1) I have already executed tuning task on Jan/24 and I'm getting above error while re-executing. What is the correct way to re-execute a tuning task ?
2) How to find whether a sql_profile is stale and how to re-profile it?
3) I understood that, sql profiles are stored in dictionary cache, If we flush shared pool, what happens to the sql profiles?
4) Automatic sql advisor suggest that to consider accepting sql profile. Before going to accept sql profile, How to keep sql_profile up-to-date? fyi..
1- SQL Profile Finding (see explain plans section below)
A potentially better execution plan was found for this statement.
Recommendation (estimated benefit: 99.65%)
- Consider accepting the recommended SQL profile.
execute dbms_sqltune.accept_sql_profile(task_name =>'1nqbz1wytzjps_tuning_task', replace => TRUE);
Thanks !Error: ORA-13630 (ORA-13630)
Text: The task %s contains execution results and cannot be executed.
Cause:The user attempted to execute a task that already contains
execution results.
Action:Reset the task to its initial state and retry the operation. -
Hi ,
I have certain doubts regarding the SQL_ID which is introduced since 10g in oracle :
1) Is SQL_ID unique for every SQL statement? Is it unique across databases? How is the sql_id for a statement decided?
2) Suppose my Sql statement runs at time A and get sql_id of 'abcd1234' . Again after a few days ( a fortnight for eg ) the same statement (not a single change in my sql statement ) runs on my database at time B,this time however the bounce of the database has been taken. Will the sql_id allotted for the statement this time be 'abcd1234' or some different?
3) I need this information on sql_id cos the sql adviser has suggested accepting a sql profile for a particular statement. However when i execute the command for accepting the profile,it shows the sql statement does not exist despite the same procedure which has the statement in it being executed very recently.
Is there any other way i can implement/execute the sql advisor.
Thanks a ton in advance,
Regards
rdxdba1) Is SQL_ID unique for every SQL statement? Is it unique across databases? How is the sql_id for a statement decided?SQL_ID is unique for every sql statement in the database and its a representation of the hash_value. Based on the sql statement its hash value is generated.
2) Suppose my Sql statement runs at time A and get sql_id of 'abcd1234' . Again after a few days ( a fortnight for eg ) the same statement (not a single change in my sql statement ) runs on my database at time B,this time however the bounce of the database has been taken. Will the sql_id allotted for the statement this time be 'abcd1234' or some different?If there is no change in the sql syntax/statement, its the same as it was then sql_id would be the same.
3) I need this information on sql_id cos the sql adviser has suggested accepting a sql profile for a particular statement. However when i execute the command for accepting the profile,it shows the sql statement does not exist despite the same procedure which has the statement in it being executed very recently.Is there any other way i can implement/execute the sql advisor.What are you running? Copy paste what you are doing to make it easier to understand.
Anand -
Hi Experts,
A query on our production box is running slow (takes almost 2 minutes to complete). Below is the query:
SELECT a.stage, a.instnum, a.reason1, b.stage AS cur_stage
FROM lot_tbl a, part_tbl b
WHERE a.lid = b.lid
AND (b.partid LIKE 'PH3253%'
OR b.partid LIKE 'PH3561%'
OR b.partid LIKE 'PH3631%'
OR b.partid LIKE 'PH3711%'
OR b.partid LIKE 'PH3721%')
AND b.lottype = 'PR'
AND a.triggertype = 'P'
AND a.action = 'H'
AND a.instnum >= b.curprcdcurinstnum
AND b.stageorder < '7970'
AND a.recflag <> 'D'
ORDER BY stage, reason1 ;Explain plan shows nested loops taking the bulk of the time as shown in the excerpt from the explain plan:
| 24 | NESTED LOOPS | | 11416 | 1036K|
6059 (1)| 00:01:13 |
|* 25 | TABLE ACCESS BY INDEX ROWID| MES_TBL_ACTL | 314 | 19782 |
168 (0)| 00:00:03 |
|* 26 | INDEX RANGE SCAN | MES_IDX_ACTL_PART | 1020 | |
4 (0)| 00:00:01 |
|* 27 | INDEX RANGE SCAN | MES_IDX_FUTA_LOT | 88 | |
1 (0)| 00:00:01 |When we analyzed this query using sqltrpt.sql (we have license for that), there was a sql profile recommendation with an slightly different explain plan (part of which is shown below):
| 24 | NESTED LOOPS | | 164 | 15252 |
188 (0)| 00:00:03 |
|* 25 | TABLE ACCESS BY INDEX ROWID| MES_TBL_ACTL | 314 | 19782 |
31 (0)| 00:00:01 |
|* 26 | INDEX SKIP SCAN | MES_IDX_ACTL_CLASS | 1 | |
31 (0)| 00:00:01 |
|* 27 | INDEX RANGE SCAN | MES_IDX_FUTA_LOT | 1 | |
1 (0)| 00:00:01 |Further details:
select num_rows,last_analyzed from dba_tables where table_name='lot_tbl';
NUM_ROWS LAST_ANALYZ
6850820 10-NOV-2011
select num_rows,last_analyzed from dba_tables where table_name='part_tbl';
NUM_ROWS LAST_ANALYZ
265360 10-NOV-2011
685260 18-OCT-2011The stats for the schemas are collected every week and there are not many changes to the above objects.
Can you please help in tuning the above query? I have tried passing various hints, but nothing seems to be working.
Also one observation is that the optimizer is returning the number of output rows as 26 in the explain plan where as aroung 5000 rows are fetched in reality. I can post full explain plans if desired.
Thanks and Regards,
Rajesh K.Hi Dom,
Please find the explain plan of the query run with the gather_plan_statistics hint :
| Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | Reads | OMem |
1Mem | Used-Mem |
PLAN_TABLE_OUTPUT
| 1 | SORT ORDER BY | | 1 | 26 | 5145 |00:01:40.35 | 25453 | 14770 | 619K|
472K| 550K (0)|
| 2 | CONCATENATION | | 1 | | 5145 |00:00:58.86 | 25453 | 14770 | |
| |
|* 3 | TABLE ACCESS BY INDEX ROWID | LOT_TBL | 1 | 1 | 491 |00:00:39.98 | 2529 | 1330 | |
| |
PLAN_TABLE_OUTPUT
| 4 | NESTED LOOPS | | 1 | 2 | 2609 |00:00:02.30 | 922 | 62 | |
| |
|* 5 | TABLE ACCESS BY INDEX ROWID| PART_TBL | 1 | 34 | 262 |00:00:00.01 | 386 | 0 | |
| |
|* 6 | INDEX RANGE SCAN | PART_IDX_PART | 1 | 111 | 448 |00:00:00.01 | 7 | 0 | |
| |
|* 7 | INDEX RANGE SCAN | LOT_IDX_LOT | 262 | 88 | 2346 |00:00:00.60 | 536 | 62 | |
| |
PLAN_TABLE_OUTPUT
|* 8 | TABLE ACCESS BY INDEX ROWID | LOT_TBL | 1 | 1 | 592 |00:00:01.61 | 1912 | 1087 | |
| |
| 9 | NESTED LOOPS | | 1 | 2 | 2566 |00:00:00.61 | 549 | 29 | |
| |
|* 10 | TABLE ACCESS BY INDEX ROWID| PART_TBL | 1 | 34 | 169 |00:00:00.01 | 197 | 0 | |
| |
|* 11 | INDEX RANGE SCAN | PART_IDX_PART | 1 | 111 | 246 |00:00:00.01 | 5 | 0 | |
PLAN_TABLE_OUTPUT
| |
|* 12 | INDEX RANGE SCAN | LOT_IDX_LOT | 169 | 88 | 2396 |00:00:00.21 | 352 | 29 | |
| |
|* 13 | TABLE ACCESS BY INDEX ROWID | LOT_TBL | 1 | 1 | 2573 |00:00:06.50 | 15411 | 9451 | |
| |
| 14 | NESTED LOOPS | | 1 | 2 | 23226 |00:00:05.62 | 3533 | 215 | |
| |
PLAN_TABLE_OUTPUT
|* 15 | TABLE ACCESS BY INDEX ROWID| PArt_TBL | 1 | 34 | 1114 |00:00:00.01 | 1213 | 0 | |
| |
|* 16 | INDEX RANGE SCAN | PART_IDX_PART | 1 | 111 | 1549 |00:00:00.01 | 18 | 0 | |
| |
|* 17 | INDEX RANGE SCAN | LOT_IDX_LOT | 1114 | 88 | 22111 |00:00:01.69 | 2320 | 215 | |
| |
|* 18 | TABLE ACCESS BY INDEX ROWID | LOT_TBL | 1 | 1 | 526 |00:00:00.65 | 1503 | 844 | |
| |
PLAN_TABLE_OUTPUT
| 19 | NESTED LOOPS | | 1 | 2 | 2458 |00:00:00.60 | 428 | 21 | |
| |
|* 20 | TABLE ACCESS BY INDEX ROWID| PART_TBL | 1 | 34 | 113 |00:00:00.01 | 191 | 0 | |
| |
|* 21 | INDEX RANGE SCAN | PART_IDX_PART | 1 | 111 | 226 |00:00:00.01 | 5 | 0 | |
| |
|* 22 | INDEX RANGE SCAN | LOT_IDX_LOT | 113 | 88 | 2344 |00:00:00.19 | 237 | 21 | |
PLAN_TABLE_OUTPUT
| |
|* 23 | TABLE ACCESS BY INDEX ROWID | LOT_TBL | 1 | 1 | 963 |00:00:05.06 | 4098 | 2058 | |
| |
| 24 | NESTED LOOPS | | 1 | 18 | 5028 |00:00:03.01 | 1931 | 75 | |
| |
|* 25 | TABLE ACCESS BY INDEX ROWID| PART_TBL | 1 | 314 | 495 |00:00:00.04 | 911 | 0 | |
| |
PLAN_TABLE_OUTPUT
|* 26 | INDEX RANGE SCAN | PART_IDX_PART | 1 | 1020 | 1088 |00:00:00.01 | 15 | 0 | |
| |
|* 27 | INDEX RANGE SCAN | LOT_IDX_LOT | 495 | 88 | 4532 |00:00:00.57 | 1020 | 75 | |
| |
Predicate Information (identified by operation id):
PLAN_TABLE_OUTPUT
3 - filter(("A"."RECFLAG"<>'D' AND "A"."ACTION"='H' AND "A"."TRIGGERTYPE"='P' AND "A"."INSTNUM">="B"."CURPRCDCURINSTNUM"))
5 - filter(("B"."LOTTYPE"='PR' AND "B"."STAGEORDER"<'7970'))
6 - access("B"."PARTID" LIKE 'PH3721%')
filter("B"."PARTID" LIKE 'PH3721%')
7 - access("A"."LOTID"="B"."LOTID")
8 - filter(("A"."RECFLAG"<>'D' AND "A"."ACTION"='H' AND "A"."TRIGGERTYPE"='P' AND "A"."INSTNUM">="B"."CURPRCDCURINSTNUM"))
10 - filter(("B"."LOTTYPE"='PR' AND "B"."STAGEORDER"<'7970'))
11 - access("B"."PARTID" LIKE 'PH3711%')
filter(("B"."PARTID" LIKE 'PH3711%' AND LNNVL("B"."PARTID" LIKE 'PH3721%')))
PLAN_TABLE_OUTPUT
12 - access("A"."LOTID"="B"."LOTID")
13 - filter(("A"."RECFLAG"<>'D' AND "A"."ACTION"='H' AND "A"."TRIGGERTYPE"='P' AND "A"."INSTNUM">="B"."CURPRCDCURINSTNUM"))
15 - filter(("B"."LOTTYPE"='PR' AND "B"."STAGEORDER"<'7970'))
16 - access("B"."PARTID" LIKE 'PH3631%')
filter(("B"."PARTID" LIKE 'PH3631%' AND LNNVL("B"."PARTID" LIKE 'PH3711%') AND LNNVL("B"."PARTID" LIKE 'PH3721%')))
17 - access("A"."LOTID"="B"."LOTID")
18 - filter(("A"."RECFLAG"<>'D' AND "A"."ACTION"='H' AND "A"."TRIGGERTYPE"='P' AND "A"."INSTNUM">="B"."CURPRCDCURINSTNUM"))
20 - filter(("B"."LOTTYPE"='PR' AND "B"."STAGEORDER"<'7970'))
21 - access("B"."PARTID" LIKE 'PH3561%')
filter(("B"."PARTID" LIKE 'PH3561%' AND LNNVL("B"."PARTID" LIKE 'PH3631%') AND LNNVL("B"."PARTID" LIKE 'PH3711%') AND
LNNVL("B"."PARTID" LIKE 'PH3721%')))
PLAN_TABLE_OUTPUT
22 - access("A"."LOTID"="B"."LOTID")
23 - filter(("A"."RECFLAG"<>'D' AND "A"."ACTION"='H' AND "A"."TRIGGERTYPE"='P' AND "A"."INSTNUM">="B"."CURPRCDCURINSTNUM"))
25 - filter(("B"."LOTTYPE"='PR' AND "B"."STAGEORDER"<'7970'))
26 - access("B"."PARTID" LIKE 'PH3253%')
filter(("B"."PARTID" LIKE 'PH3253%' AND LNNVL("B"."PARTID" LIKE 'PH3561%') AND LNNVL("B"."PARTID" LIKE 'PH3631%') AND
LNNVL("B"."PARTID" LIKE 'PH3711%') AND LNNVL("B"."PARTID" LIKE 'PH3721%')))
27 - access("A"."LOTID"="B"."LOTID")Running SQL Advisor (sqltrpt.sql) on this query is giving sql profile recommendation which shows the run time of this query as 12 secs:
Explain plan of the recommendation:
2- Using SQL Profile
Plan hash value: 1628846902
| Id | Operation | Name | Rows | Bytes |
Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 2106 | 191K|
976 (1)| 00:00:12 |
| 1 | SORT ORDER BY | | 2106 | 191K|
976 (1)| 00:00:12 |
| 2 | CONCATENATION | | | |
| |
|* 3 | tABLE ACCESS BY INDEX ROWID | LOT_TBL | 1 | 30 |
1 (0)| 00:00:01 |
| 4 | NESTED LOOPS | | 1336 | 121K|
149 (0)| 00:00:02 |
|* 5 | TABLE ACCESS BY INDEX ROWID|PART_TBL | 260 | 16380 |
19 (0)| 00:00:01 |
|* 6 | INDEX RANGE SCAN | PART_IDX_PART | 111 | |
1 (0)| 00:00:01 |
|* 7 | INDEX RANGE SCAN | LOT_IDX_LOT | 1 | |
1 (0)| 00:00:01 |
|* 8 | TABLE ACCESS BY INDEX ROWID |LOT_TBL | 1 | 30 |
1 (0)| 00:00:01 |
| 9 | NESTED LOOPS | | 68 | 6324 |
84 (0)| 00:00:02 |
|* 10 | TABLE ACCESS BY INDEX ROWID| PART_TBL | 130 | 8190 |
19 (0)| 00:00:01 |
|* 11 | INDEX RANGE SCAN | PART_IDX_PART | 111 | |
1 (0)| 00:00:01 |
|* 12 | INDEX RANGE SCAN | LOT_IDX_LOT | 1 | |
1 (0)| 00:00:01 |
|* 13 | TABLE ACCESS BY INDEX ROWID | LOT_TBL | 1 | 30 |
1 (0)| 00:00:01 |
| 14 | NESTED LOOPS | | 520 | 48360 |
518 (0)| 00:00:07 |
|* 15 | TABLE ACCESS BY INDEX ROWID| PART_TBL | 998 | 62874 |
19 (0)| 00:00:01 |
|* 16 | INDEX RANGE SCAN | PART_IDX_PART | 111 | |
1 (0)| 00:00:01 |
|* 17 | INDEX RANGE SCAN | LOT_IDX_LOT | 1 | |
1 (0)| 00:00:01 |
|* 18 | TABLE ACCESS BY INDEX ROWID | LOT_TBL | 1 | 30 |
1 (0)| 00:00:01 |
| 19 | NESTED LOOPS | | 18 | 1674 |
36 (0)| 00:00:01 |
|* 20 | TABLE ACCESS BY INDEX ROWID| PART_TBL | 34 | 2142 |
19 (0)| 00:00:01 |
|* 21 | INDEX RANGE SCAN | PART_IDX_PART | 111 | |
1 (0)| 00:00:01 |
|* 22 | INDEX RANGE SCAN | LOT_IDX_LOT | 1 | |
1 (0)| 00:00:01 |
|* 23 | TABLE ACCESS BY INDEX ROWID | LOT_TBL | 1 | 30 |
1 (0)| 00:00:01 |
| 24 | NESTED LOOPS | | 164 | 15252 |
188 (0)| 00:00:03 |
|* 25 | TABLE ACCESS BY INDEX ROWID| PART_TBL | 314 | 19782 |
31 (0)| 00:00:01 |
|* 26 | INDEX SKIP SCAN | PART_IDX_CLASS | 1 | |
31 (0)| 00:00:01 |
|* 27 | INDEX RANGE SCAN | LOT_IDX_LOT | 1 | |
1 (0)| 00:00:01 |
Predicate Information (identified by operation id):
3 - filter("A"."RECFLAG"<>'D' AND "A"."ACTION"='H' AND "A"."TRIGGERTYPE"='P
' AND
"A"."INSTNUM">="B"."CURPRCDCURINSTNUM")
5 - filter("B"."LOTTYPE"='PR' AND "B"."STAGEORDER"<'7970')
6 - access("B"."PARTID" LIKE 'PH3721%')
filter("B"."PARTID" LIKE 'PH3721%')
7 - access("A"."LOTID"="B"."LOTID")
8 - filter("A"."RECFLAG"<>'D' AND "A"."ACTION"='H' AND "A"."TRIGGERTYPE"='P
' AND
"A"."INSTNUM">="B"."CURPRCDCURINSTNUM")
10 - filter("B"."LOTTYPE"='PR' AND "B"."STAGEORDER"<'7970')
11 - access("B"."PARTID" LIKE 'PH3711%')
filter("B"."PARTID" LIKE 'PH3711%' AND LNNVL("B"."PARTID" LIKE 'PH3721%
12 - access("A"."LOTID"="B"."LOTID")
13 - filter("A"."RECFLAG"<>'D' AND "A"."ACTION"='H' AND "A"."TRIGGERTYPE"='P
' AND
"A"."INSTNUM">="B"."CURPRCDCURINSTNUM")
15 - filter("B"."LOTTYPE"='PR' AND "B"."STAGEORDER"<'7970')
16 - access("B"."PARTID" LIKE 'PH3631%')
filter("B"."PARTID" LIKE 'PH3631%' AND LNNVL("B"."PARTID" LIKE 'PH3711%
') AND
LNNVL("B"."PARTID" LIKE 'PH3721%'))
17 - access("A"."LOTID"="B"."LOTID")
18 - filter("A"."RECFLAG"<>'D' AND "A"."ACTION"='H' AND "A"."TRIGGERTYPE"='P
' AND
"A"."INSTNUM">="B"."CURPRCDCURINSTNUM")
20 - filter("B"."LOTTYPE"='PR' AND "B"."STAGEORDER"<'7970')
21 - access("B"."PARTID" LIKE 'PH3561%')
filter("B"."PARTID" LIKE 'PH3561%' AND LNNVL("B"."PARTID" LIKE 'PH3631%
') AND
LNNVL("B"."PARTID" LIKE 'PH3711%') AND LNNVL("B"."PARTID" LIKE '
PH3721%'))
22 - access("A"."LOTID"="B"."LOTID")
23 - filter("A"."RECFLAG"<>'D' AND "A"."ACTION"='H' AND "A"."TRIGGERTYPE"='P
' AND
"A"."INSTNUM">="B"."CURPRCDCURINSTNUM")
25 - filter("B"."PARTID" LIKE 'PH3253%' AND "B"."STAGEORDER"<'7970' AND LNNV
L("B"."PARTID"
LIKE 'PH3721%') AND LNNVL("B"."PARTID" LIKE 'PH3711%') AND LNNVL
("B"."PARTID" LIKE 'PH3631%')
AND LNNVL("B"."PARTID" LIKE 'PH3561%'))
26 - access("B"."LOTTYPE"='PR')
filter("B"."LOTTYPE"='PR')
27 - access("A"."LOTID"="B"."LOTID")Notice that an index skip scan of PART_IDX_CLASS which is on columns: COMCLASS and LOTTYPE is being used, which reduces the nested loops expense. But forcing index skip scan of that index through hint, the optimizer is not considering the index and is giving the same execution plan as before.
Thanks and Regards,
Rajesh K.
Maybe you are looking for
-
I have a new apple ID how do I get my new purchases to my normal itunes library
So I have a ipad and an ipod nano. I have always downloaded music on my ipad then synced my ipod to my pc. But i had to get and new apple ID. So when I got to sync my ipod. It does it with my old account. Ive tried deleting itunes and redownloading i
-
Dear All, while deactivating batch management i'm getting error message like. "Batch management requirement cannot be changed; choose "Display errors" Message no. M3530. The stock is zero and there is no open PR and PO. pl share ur inpu
-
Joining query with single row result
dear all, i have two tables create table item(item_id number primary key, item_desc varchar2(200)); create table item_properties(item_id number references item(item_id), property_name varchar2(20), property_value varchar2(100));i insert the following
-
WELL THEN WHAT IS A GOOD PROSUMER CAMCORDER TO BUY???
In response to the "do not buy hdd cameras" thread, I am now left quite confused. anyway, I would like to be pointed in the proper direction of a new prosumer ntsc camera for my video production company. we do indie music videos and shorts, and somet
-
Missing Quick Start features option in BIOs setup
I would like to enable Quick Start in Ideapad S10-3s. But the Lenovo Quick Start features option is not available in the BIOs configuration. I upgraded the BIOs to the latest version, still do not have the Quick Start features option in the BIOS con