Stored outlines hints in diff query...
hello all,
I am on 10.2.0.3 i had a question on stored outline....i create the below stored outline in our dummy env....but my question is how can i use the hints used by stored outline in my query that i was use in my other env ....just use all the hints from this stroed outlines in other env...
CREATE OUTLINE emp_dept FOR CATEGORY scott_outlines
ON SELECT e.empno, e.ename, d.dname FROM emp e, dept d WHERE e.deptno = d.deptno;
-- Check the outline as been created correctly.
COLUMN name FORMAT A30
SELECT name, category, sql_text FROM user_outlines WHERE category = 'SCOTT_OUTLINES';
NAME CATEGORY
SQL_TEXT
EMP_DEPT SCOTT_OUTLINES
SELECT e.empno, e.ename, d.dname FROM emp e, dept d WHERE e.deptno = d.deptno
1 row selected.
-- List the hints associated with the outline.
COLUMN hint FORMAT A50
SELECT node, stage, join_pos, hint FROM user_outline_hints WHERE name = 'EMP_DEPT';
NODE STAGE JOIN_POS HINT
1 1 0 NO_EXPAND(@"SEL$1" )
1 1 0 PQ_DISTRIBUTE(@"SEL$1" "E"@"SEL$1" NONE NONE)
1 1 0 USE_MERGE(@"SEL$1" "E"@"SEL$1")
1 1 0 LEADING(@"SEL$1" "D"@"SEL$1" "E"@"SEL$1")
1 1 0 NO_STAR_TRANSFORMATION(@"SEL$1" )
1 1 0 NO_FACT(@"SEL$1" "E"@"SEL$1")
1 1 0 NO_FACT(@"SEL$1" "D"@"SEL$1")
1 1 2 FULL(@"SEL$1" "E"@"SEL$1")
1 1 1 INDEX(@"SEL$1" "D"@"SEL$1" ("DEPT"."DEPTNO"))
1 1 0 NO_REWRITE(@"SEL$1" )
1 1 0 NO_REWRITE(@"SEL$1" )
11 rows selected.so how would i use the 11 hints that i got from this hint...in my other DB....so now in my other DB i was a query like
SELECT /* hints hints hints */ e.empno, e.ename, d.dname FROM emp e, dept d WHERE e.deptno = d.deptno;
where hints are below ...
NO_EXPAND(@"SEL$1" )
PQ_DISTRIBUTE(@"SEL$1" "E"@"SEL$1" NONE NONE)
USE_MERGE(@"SEL$1" "E"@"SEL$1")
LEADING(@"SEL$1" "D"@"SEL$1" "E"@"SEL$1")
NO_STAR_TRANSFORMATION(@"SEL$1" )
NO_FACT(@"SEL$1" "E"@"SEL$1")
NO_FACT(@"SEL$1" "D"@"SEL$1")
FULL(@"SEL$1" "E"@"SEL$1")
INDEX(@"SEL$1" "D"@"SEL$1" ("DEPT"."DEPTNO"))
NO_REWRITE(@"SEL$1" )
NO_REWRITE(@"SEL$1" )
is that even do-able if so, how would my new query look like with all the hints ??
yes i understand i need to hand code that into the sql...thats exactly what i want....
how would i use the below hints from stored outline in my query ???
NO_EXPAND(@"SEL$1" )
PQ_DISTRIBUTE(@"SEL$1" "E"@"SEL$1" NONE NONE)
USE_MERGE(@"SEL$1" "E"@"SEL$1")
LEADING(@"SEL$1" "D"@"SEL$1" "E"@"SEL$1")
NO_STAR_TRANSFORMATION(@"SEL$1" )
NO_FACT(@"SEL$1" "E"@"SEL$1")
NO_FACT(@"SEL$1" "D"@"SEL$1")
FULL(@"SEL$1" "E"@"SEL$1")
INDEX(@"SEL$1" "D"@"SEL$1" ("DEPT"."DEPTNO"))
NO_REWRITE(@"SEL$1" )
NO_REWRITE(@"SEL$1" )
Similar Messages
-
Parallel query hint with stored outlines
Hi,
Can I use parallel query hint with stored outlines.
Regards
MMUI'm not quite sure what you're asking, since stored outlines themselves implement hints to try to maintain plan stability.
If you're asking if stored outlines will utililze the parallel query hints I'd have to assume "yes" but would test the idea anyway.
Message was edited by:
riedelme -
Hi,
The database version is 10204.
I have a query which is running fine in TEST but not in PRODUCTION.
I have created the outline, however have a doubt.
The difference in the query in TEST and PROD is that the schema in TEST differs from the schema in PROD.
However object names remain the same.
Would the outline still work in PROD?
select * from crmprd.table1 ...........
select * from db3.table1 ......Rgds,
SanjayNo, that won't work
>
There is a one-to-one correspondence between SQL text and its stored outline. If you specify a different literal in a predicate, then a different outline applies. To avoid this, replace literals in applications with bind variables
>
See Using Plan Stabilility in the Database Performance Tuning Guide.
http://docs.oracle.com/cd/B19306_01/server.102/b14211/outlines.htm
The outline association is based on a hash of the SQL text and the hash won't match. That is why the above excerpt suggests using bind variables; it makes the hash the same even though the actual value of the bind can be different at run time. -
Stored Outlines on 10g as was on 9i
Hi everyone,
I built lots of stored outlines in 9i for our production database. The interface to do that by then was the java client/server enterprise manager.
When I upgraded to 10g the only outlines I could find was the sql advisor from the web enterprise manager, but it do not let me customize the plans the way I did on 9i.
I found out to be a packaged called dbms_sqltune, I wasn't able to do much with that package its kinda a way complex and less pratical.
How do I create a stored outlines on 10g?
Many will ask why to force a execution plan as the optimizer is very good? Well, in my experience sometimes the optimizer just don't know "business rules" enought to find the best execution plan for a report, he can guess on the cardinality of the columns but he can't guess that if a report is build to sales dept. then they will only use the 1000 and 1005 contracts on 99% of the cases that will represent a very small part of a huge table. To complete the scenario, many vendors do not open the code for us to "hint" their queries, so stored outlines was the way to go on those (many on my case) cases.
Thanks in advance for comments!
Ricardo RodriguezRicardo,
Allow me to say a few words as I read your question just now.
Stored outlines will do exactly what you mentioned.Stored outlines are used to make sure that optimizer wont go for another plan from what you had opted.That's the basic goal in making and conceptulating outlines.The same concept is also there in 11g with Sql Plan Baselines.Therefore, stored outlines and SQL plan baselines are used to:
- ensure that a given execution plan is always used
- do SQL tuning without changing the code of the application
Stored outlines are indeed there in 10g.Please see this line here for 10gR2,
http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/outlines.htm#sthref1341
Now in the EM,there is no option(atleast I havenot seen one) to create them as the idea to use stored outlines never really got so popular.I agree those who use it,they like it very much but on a generic part, they were actualy a problem.Too many restrictions are there to implement and use them.
In 10g, this funcionality seems to be missing, you cannot 'hand made' a exection plan for the query anymore, you could just click on the advice of the sql advisor and pray to him find an solution.
In 10g the concept is enhanced a step further.Its always a bad idea to "hard-code" a plan for optimizer taking away its decision making sense.So Oracle is promoting for the same reasons which were there for outlines i.e. the query is a part of vendor application,you don't want to chance n number of parameters to tune one query only,they formulated stored profiles to do the job which does the same job but doesn't hard code the plan.SQL profiles are designed to provide to the query optimizer the information like:
- execution environment (e.g. optimizer mode)
- object statistics
- corrections related to the estimations performed by the query optimizer
As you can see, the aim of a SQL profile is "only" to change the environment in which the query optimizer works. The idea is that by changing the environment the query optimizer should be able to generated a more efficient execution plan.
I guess you would be clear with the part now.I wont even sya that outlines store the plan itself.Stored outlines, SQL plan baselines and SQL profile do not plans. They store hints which can be used to make up a plan.Yes the option in 10g from GUI is to just create Stored Profiles but not Stored Outlines which stands as a manualy done task.
Just my 2 cents on the topic.
Aman.... -
Use Stored Outlines to replace ANALYZE with "do nothing" ?
Has anyone used Stored Outlines to replace statements like "ANALYZE TABLE abc COMPUTE STATISTICS" ?
Say you have an application that issues a number of 'ANALYZE TABLE' statements at different times during a batch run and you want some of the ANALYZE calls to succeed (eg for tables 'stu' and 'xyz') but others to "do nothing" (eg for table 'abc').
Could you replace "ANALYZE TABLE abc COMPUTE STATISTICS" with a (for example) "select 'x' from dual" call ?Hemant K Chitale wrote:
Has anyone used Stored Outlines to replace statements like "ANALYZE TABLE abc COMPUTE STATISTICS" ?
Say you have an application that issues a number of 'ANALYZE TABLE' statements at different times during a batch run and you want some of the ANALYZE calls to succeed (eg for tables 'stu' and 'xyz') but others to "do nothing" (eg for table 'abc').
Could you replace "ANALYZE TABLE abc COMPUTE STATISTICS" with a (for example) "select 'x' from dual" call ?
If i understood it right, you seem to mean query rewrite.
As you know already, stored outline is a series of hints to guide optimizer to emulate previous plan.
It cannot be used to replace query text itself.
Advanced query rewrite(10g) seems to be promising, but it can only be used for select statement.
Dion Cho
PS) Rewriting query is very powerful, but very dangerous both for performance and security.
That is maybe the reason why Oracle does not provide those kinds of functionality. -
SQL Profiles or STORED OUTLINE
Hi,
on 10g R2, any query to know
the SQL Profiles in DB ?
Or the STORED OUTLINES ?
Thanks.Hi,
You can get the details from the DBA_SQL_PROFILES. there are futher sys tables which can give some details
SQL Profiles hints from SQLPROF$ATTR,SQLPROF$ and SQLPROF$DESC
- Pavan Kumar N
Oracle 9i/10g - OCP
http://oracleinternals.blogspot.com/ -
Hi,
is anyone using stored outlines within SAP?
Would you pleas share your experience with it's implementation.
Thanks
VolkerVolker Borowski wrote:>
> >
YukonKid wrote:
> > If you go for outlines you would need to
> >
> > a) capture the query exactly as it is executed by the application, hints and all
> > yk
> http://forums.sdn.sap.com/post!reply.jspa?messageID=8458029
> Hi YK,
>
> this would be a major "gotcha".
> My statement has bind variables and I am not able to force the plan
> to the correct one by invalidating an index.
> I either need a hint (which will not be in the generated code) or
> change the sequence of the tables in the from clause.
>
> So in both ways the stored outline would refer to a statement,
> that is literally diffrent.
>
> So if I got you correctly, I will not be able to like the plan of a statement to a diffrent one?
no - it works the other way round:
Statement A -> worse plan
you would make it to use the more efficient plan (i.e. using session parameters and such)
capture that plan and use it on Statement A.
>
>
> The change I'd have to do would be
>
> :
> FROM
> table1 T_00,
> table2 T_01,
> table3 T_02,
> table4 T_03,
> table5 T_04,
> table6 T_05,
> table7 T_06,
> table8 T_07,
> WHERE
> :
>
> to
>
> :
> FROM
> table2 T_01,
> table3 T_02,
> table1 T_00,
> table4 T_03,
> table5 T_04,
> table6 T_05,
> table7 T_06,
> table8 T_07,
> WHERE
> :
>
> Now as for the SQL Syntax, this make absolutely no diffrence.
> But the plan changes to effectively 50% less consistent gets (~12000 -> ~6500)
> and the total optimizer costs for both plans are identical.
>
> So I would like to link the plan for statement 2 to the literal statement 1.
If you have control over the statement check out the ORDERED hint and forget stored outlines
SELECT /*+ ORDERED */ ....FROM ....WHERE
tables get joined in the order of the from clause.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements006.htm#SQLRF50601
But same applies: Don't try to be more clever than the CBO (99% of the time he is smarter than you)....
>
> Volker -
Performance Tuning Issues: UNION and Stored Outlines
Hi,
I have two questions,
Firstly I have read this:
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14211/sql_1016.htm#i35699
What I can understand is using UNION ALL is better than UNION.
The ALL in UNION ALL is logically valid because of this exclusivity. It allows the plan to be carried out without an expensive sort to rule out duplicate rows for the two halves of the query.
Can someone explain me the following sentences.
Secondly my Oracle Database 10g is on FIRST_ROWS_1, how can stored outlines help in reducing I/O cost and response time in general?Please explain.
Thank you,
AdithUnion ALL and Union
SQL> select 1, 2 from dual
union
select 1, 2 from dual;
| Id | Operation | Name | Rows | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 2 | 6 (67)| 00:00:01 |
| 1 | SORT UNIQUE | | 2 | 6 (67)| 00:00:01 |
| 2 | UNION-ALL | | | | |
| 3 | FAST DUAL | | 1 | 2 (0)| 00:00:01 |
| 4 | FAST DUAL | | 1 | 2 (0)| 00:00:01 |
11 rows selected.
SQL>select 1, 2 from dual
union all
select 1, 2 from dual;
| Id | Operation | Name | Rows | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 2 | 4 (50)| 00:00:01 |
| 1 | UNION-ALL | | | | |
| 2 | FAST DUAL | | 1 | 2 (0)| 00:00:01 |
| 3 | FAST DUAL | | 1 | 2 (0)| 00:00:01 |
10 rows selected.
Adith -
Hi experts,
i have an issues with stored outlines.i am on oracle 9.2.0.1
i created and outline as
CREATE OR REPLACE OUTLINE JOB1 FOR CATEGORY JOB_TBL2 ON
SELECT EMPLID FROM PS_JOB WHERE ACTION LIKE :1
then
ALTER SESSION SET use_stored_outlines=JOB_TBL2;
after that if i run the query SELECT EMPLID FROM PS_JOB WHERE ACTION LIKE :1 then my stored outline is used
but if i run as SELECT EMPLID FROM PS_JOB WHERE ACTION LIKE 'HIR' it doesnot use stored outline.
i test with both cursor sharing =similar\exact
Please help.Loading at non lev0 members and aggregating with SET AGGMISSIG OFF may protect the data at non lev0 combinatioons that time.
It will not protect the data permanantly as future calc operations has always a chance to overwrite that data.
Follow the below prctices
1) Load high at the non lev0 combination
2) Run the push down calculation to allocate this data to lev0 combinations.
3) Aggregate the data.
Second approch is
If you dont like to tie this data to the any available lev0 members for any reasons.Consider the below hierarchy
---PG
-------PG1
-------PG2
-------PG3
You want to load data at PG member level and dont like to tie for any of the members PG1, PG2 and PG3.
Then add a place holder member PG_I as a sibling to PG3 and load the data to that PG_I.
Then you can see the expected data at PG with out loading high and applying conditions. -
Stored outlines & plan stability
I am trying to use stored outlines, for plan stability (Oracle 8i).
Oracle documents says that; the query from my
application must literally match to the one
in stored outline (OL$ table). Does that mean
that the parameter value(s) also should
match ??
Example: The following query was stored
in OL$ table, thru stored outlines procedure.
select cust_name, sum(revenue)
from accounts
where country_code = '225'
and account_type = 'C'
group by cust_name;
Now my question: Is it necessary that my application should throw exact same query,
including parameter values (i.e.country_code)
to take advantage of the store outline ?
If I pass country_code = '436', does it make use of the stored outline or not ?
Any input is highly appreciated, since this option is very useful in my application
context.
thanks and regards
subbuThe stored outline need not take the same parameter values .we can give different parameter values.In your case if country_code = '436', it makes use of stored outline.
-
Stored Outlines & Restore Table Stats
Hi all,
I would like to know how restoring of table stats change execution plans when stored outlines are in place?
DB version is 10.2.0.4.
NAME TYPE VALUE
optimizer_dynamic_sampling integer 0
optimizer_features_enable string 10.2.0.4
optimizer_index_caching integer 0
optimizer_index_cost_adj integer 65
optimizer_mode string FIRST_ROWS_10
optimizer_secure_view_merging boolean TRUE
query_rewrite_enabled string TRUE
star_transformation_enabled string FALSE
Following actions were done last month:
1. dbms_stats.gather_table_stats(schema IMANAGE, Table DIT_TRUSTEE)
2. dbms_stats.lock_table_stats(schema IMANAGE, Table DIT_TRUSTEE)
3. Once the desired execution plan for Query 1 (e.g. sql_id=ah8nzqhyu7xh4) was in V$SQL and was used by query, I created a Stored Outline using DBMS_OUTLN.create_outline, and enabled outline by setting use_stored_outlines to the desired outline category.
4. Every thing remained fine for almost 30-35 days
Today, there was another query (e.g. sql_id=7anr84k12d5rt, using same DIT_TRUSTEE table) whose query plan got changed. This query didn't have any stored outline in place and was performing without any problem earlier. So, I gathered stats for the same table (DIT_TRUSTEE) after unlocking its stats. It didn't help. So, I thought to restore old stats against which query used to perform better while also rebuilt some indexes. After the restore of table stats (DIT_TRUSTEE) to a date which was earlier than the date of creation of 1st stored outline, the execution plan of query 1 (e.g. sql_id=ah8nzqhyu7xh4) got changed. Can we know the reason why it got changed? I was under the impression that any change in stats doesn't impact the execution plan if stored outline is in place for a query. But it looked like this wasn't the case.
It would be good if someone can explain or share their experiences.
regards,
AnjumHi,
The query against SQL_ID=ah8nzqhyu7xh4 is:
SELECT imanage.DIT_TRUSTEE.CREATED_TIME, imanage.DIT_TRUSTEE.DIT_CLASS, imanage.DIT_TRUSTEE.DOES_PASSWORD_EXPIRE, imanage.DIT_TRUSTEE.DOMAIN, imanage.DIT_TRUSTEE.FORCE_PASSWORD_CHANGE, imanage.DIT_TRUSTEE.HOME_LIBRARY, imanage.DIT_TRUSTEE.IS_DELETED, imanage.DIT_TRUSTEE.IS_ENABLED, imanage.DIT_TRUSTEE.IS_LEAF_NODE, imanage.DIT_TRUSTEE.LABEL_F21011, imanage.DIT_TRUSTEE.LOGIN_LOCKOUT_TIME, imanage.DIT_TRUSTEE.MODIFIED_TIME, imanage.DIT_TRUSTEE.PARENT_TRUSTEE_RSID, imanage.DIT_TRUSTEE.PASSWORD_F21015, imanage.DIT_TRUSTEE.PASSWORD_FAIL_COUNT, imanage.DIT_TRUSTEE.PASSWORD_MODIFIED_TIME, imanage.DIT_TRUSTEE.RDN, imanage.DIT_TRUSTEE.REPLICATION_ID, imanage.DIT_TRUSTEE.SID, imanage.DIT_TRUSTEE.SYNCHRONIZE_ID, imanage.DIT_TRUSTEE.SYNCHRONIZED_TIME, imanage.DIT_TRUSTEE.TRUSTEE_TYPE, imanage.DIT_TRUSTEE.UID_F21024, imanage.DIT_TRUSTEE.WORKSPACE_LIBRARY, imanage.DIT_TRUSTEE.WORKSPACE_RSID, imanage.DIT_TRUSTEE.IS_WORKSPACE_LIBRARY_INHERITED, imanage.DIT_TRUSTEE.IS_HOME_LIBRARY_INHERITED, imanage.DIT_TRUSTEE.S_CCSSBL_LBRRY_LST_NHRT_F60326, imanage.DIT_TRUSTEE.NAME_FIRST, imanage.DIT_TRUSTEE.NAME_MIDDLE, imanage.DIT_TRUSTEE.NAME_LAST, imanage.DIT_TRUSTEE.NAME_FULL, imanage.DIT_TRUSTEE.NAME_SUFFIX, imanage.DIT_TRUSTEE.NAME_SALUTATION, imanage.DIT_TRUSTEE.GENDER, imanage.DIT_TRUSTEE.JOB_TITLE, imanage.DIT_TRUSTEE.ANNIVERSARY, imanage.DIT_TRUSTEE.BIRTHDATE, imanage.DIT_TRUSTEE.ASSISTANT_RSID, imanage.DIT_TRUSTEE.LOCALE_LANGUAGE, imanage.DIT_TRUSTEE.LOCALE_COUNTRY, imanage.DIT_TRUSTEE.LOCALE_TIMEZONE, imanage.DIT_TRUSTEE.EMAIL_1, imanage.DIT_TRUSTEE.EMAIL_2, imanage.DIT_TRUSTEE.EMAIL_3, imanage.DIT_TRUSTEE.EMAIL_FORMAT_1, imanage.DIT_TRUSTEE.EMAIL_FORMAT_2, imanage.DIT_TRUSTEE.EMAIL_FORMAT_3, imanage.DIT_TRUSTEE.IM_ID, imanage.DIT_TRUSTEE.PHONE_HOME, imanage.DIT_TRUSTEE.PHONE_BUSINESS, imanage.DIT_TRUSTEE.PHONE_MOBILE, imanage.DIT_TRUSTEE.PHONE_PAGER, imanage.DIT_TRUSTEE.PHONE_OTHER, imanage.DIT_TRUSTEE.FAX_HOME, imanage.DIT_TRUSTEE.FAX_BUSINESS, imanage.DIT_TRUSTEE.FAX_OTHER, imanage.DIT_TRUSTEE.MAILING_ADDRESS, imanage.DIT_TRUSTEE.BA_DEPARTMENT, imanage.DIT_TRUSTEE.BA_LOCATION, imanage.DIT_TRUSTEE.BA_COMPANY, imanage.DIT_TRUSTEE.BA_STREET_1, imanage.DIT_TRUSTEE.BA_STREET_2, imanage.DIT_TRUSTEE.BA_POBOX, imanage.DIT_TRUSTEE.BA_CITY, imanage.DIT_TRUSTEE.BA_STATE, imanage.DIT_TRUSTEE.BA_COUNTRY, imanage.DIT_TRUSTEE.BA_POSTAL_CODE, imanage.DIT_TRUSTEE.HA_STREET_1, imanage.DIT_TRUSTEE.HA_STREET_2, imanage.DIT_TRUSTEE.HA_POBOX, imanage.DIT_TRUSTEE.HA_CITY, imanage.DIT_TRUSTEE.HA_STATE, imanage.DIT_TRUSTEE.HA_COUNTRY, imanage.DIT_TRUSTEE.HA_POSTAL_CODE, imanage.DIT_TRUSTEE.WP_HOME, imanage.DIT_TRUSTEE.WP_BUSINESS, imanage.DIT_TRUSTEE.WP_OTHER, imanage.DIT_TRUSTEE.NE_DELIVERY_MODE_IMMEDIATE, imanage.DIT_TRUSTEE.NE_DELIVERY_MODE_SUMMARY, imanage.DIT_TRUSTEE.NE_USER_PREFERENCE, imanage.DIT_TRUSTEE.NE_USER_SUMMARY_TIME, imanage.DIT_TRUSTEE.NE_COPY_TO_ASSISTANT, imanage.DIT_TRUSTEE.IS_EXTERNAL, imanage.DIT_TRUSTEE.IS_IS_EXTERNAL_INHERITED, imanage.DIT_TRUSTEE.NOTES, imanage.DIT_TRUSTEE.LOCATION_RSID, imanage.DIT_TRUSTEE.IS_ALL_IP_VALID, imanage.DIT_TRUSTEE.LAST_LOGON_TIME, imanage.DIT_TRUSTEE.S_HM_PG_WRKSPC_NHR_F4294966291, imanage.DIT_TRUSTEE.S_PRFRNCS_FCLTY_NH_F4294966292, imanage.DIT_TRUSTEE.HOME_PAGE_WORKSPACE, imanage.DIT_TRUSTEE.PREFERENCES_FACILITY, imanage.DIT_TRUSTEE.P_NEW_ITEM_INDICATOR, imanage.DIT_TRUSTEE.P_PWD_QUESTION, imanage.DIT_TRUSTEE.P_PWD_ANSWER, imanage.DIT_TRUSTEE.X_ECF_USER, imanage.DIT_TRUSTEE.X_DEPARTMENTS, imanage.DIT_TRUSTEE.X_TP_CLASSIFICATION, imanage.DIT_TRUSTEE.X_IMR_ENABLED_TIME, imanage.DIT_TRUSTEE.X_CAN_MANAGE_COI, imanage.DIT_TRUSTEE.X_CAN_ADD_THIRD_PARTY, imanage.DIT_TRUSTEE.X_IS_SECURITY_ADMINISTRATOR, imanage.DIT_TRUSTEE.X_IS_A_AND_S_DIRECT_LOAD, imanage.DIT_TRUSTEE.X_IS_ECF_DIRECT_LOAD, imanage.DIT_TRUSTEE.X_IS_NATIVE_REPOSITORY, imanage.DIT_TRUSTEE.X_CLIENT_CATEGORY, imanage.DIT_TRUSTEE.X_IS_ECF2_USER, imanage.DIT_TRUSTEE.X_IS_ECF2_ADMIN, imanage.DIT_TRUSTEE.X_CWS_UNIT, imanage.DIT_TRUSTEE.X_XCHANGING_ID, imanage.DIT_TRUSTEE.X_IS_DOCUMENT_FILE_VIEWER, imanage.DIT_TRUSTEE.X_IS_CWS_USER
FROM imanage.DIT_TRUSTEE
WHERE ((imanage.DIT_TRUSTEE.WORKSPACE_RSID = :"SYS_B_0") AND (UPPER(imanage.DIT_TRUSTEE.RDN) = :1)) ORDER BY imanage.DIT_TRUSTEE.NAME_FIRST ASC, imanage.DIT_TRUSTEE.NAME_LAST ASC, imanage.DIT_TRUSTEE.UID_F21024 ASC, imanage.DIT_TRUSTEE.RDN ASC
which shows the bind vars in place.
while definition of index IX_DIT_TRUSTEE_6 is:
CREATE INDEX "IMANAGE"."IX_DIT_TRUSTEE_6" ON "IMANAGE"."DIT_TRUSTEE" ("WORKSPACE_RSID", "DIT_CLASS", "SID") TABLESPACE "REPOS_INDX" PCTFREE 10INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 512K BUFFER_POOL DEFAULT) LOGGING LOCAL
Now, I below details explaining the index it started using despite outline in place:
SQL> select sql_id, HASH_VALUE, CHILD_NUMBER, users_executing from v$sql where PLAN_HASH_VALUE=2563299851;
SQL_ID HASH_VALUE CHILD_NUMBER USERS_EXECUTING
ah8nzqhyu7xh4 1034155524 1 0
SQL> SELECT hash_value, child_number, sql_text FROM v$sql WHERE sql_id='ah8nzqhyu7xh4';
HASH_VALUE CHILD_NUMBER
SQL_TEXT
1034155524 1
SELECT imanage.DIT_TRUSTEE.CREATED_TIME, imanage.DIT_TRUSTEE.DIT_CLASS, imanage.DIT_TRUSTEE.DOES_PASSWORD_EXPIRE, imanage.DIT_TRUSTEE.DOMAIN, imanage.DIT_TRUSTEE.FORCE_PASSWORD_CHANGE, imanage.DIT_TRU
STEE.HOME_LIBRARY, imanage.DIT_TRUSTEE.IS_DELETED, imanage.DIT_TRUSTEE.IS_ENABLED, imanage.DIT_TRUSTEE.IS_LEAF_NODE, imanage.DIT_TRUSTEE.LABEL_F21011, imanage.DIT_TRUSTEE.LOGIN_LOCKOUT_TIME, imanage.D
IT_TRUSTEE.MODIFIED_TIME, imanage.DIT_TRUSTEE.PARENT_TRUSTEE_RSID, imanage.DIT_TRUSTEE.PASSWORD_F21015, imanage.DIT_TRUSTEE.PASSWORD_FAIL_COUNT, imanage.DIT_TRUSTEE.PASSWORD_MODIFIED_TIME, imanage.DIT
_TRUSTEE.RDN, imanage.DIT_TRUSTEE.REPLICATION_ID, imanage.DIT_TRUSTEE.SID, imanage.DIT_TRUSTEE.SYNCHRONIZE_ID, imanage.DIT_TRUSTEE.SYNCHRONIZED_TIME, imanage.DIT_TRUSTEE.TRUSTEE_TYPE, imanage.DIT_TRUS
TEE.UID_F21024, imanage.DIT_TRUSTEE.WORKSPACE_LIBRARY, imanage.DIT_TRUSTEE.WORKSPACE_RSID, imanage.DIT_TRUSTEE.IS_WORKSPACE_LIBRARY_INHERITED, imanage.DIT_TRUSTEE.IS_HOME_LIBRARY_INHERITED, imanage.DI
SQL> SELECT * FROM table(DBMS_XPLAN.DISPLAY_CURSOR('ah8nzqhyu7xh4',1));
PLAN_TABLE_OUTPUT
SQL_ID ah8nzqhyu7xh4, child number 1
SELECT imanage.DIT_TRUSTEE.CREATED_TIME, imanage.DIT_TRUSTEE.DIT_CLASS,
imanage.DIT_TRUSTEE.DOES_PASSWORD_EXPIRE, imanage.DIT_TRUSTEE.DOMAIN,
imanage.DIT_TRUSTEE.FORCE_PASSWORD_CHANGE, imanage.DIT_TRUSTEE.HOME_LIBRARY,
imanage.DIT_TRUSTEE.IS_DELETED, imanage.DIT_TRUSTEE.IS_ENABLED,
imanage.DIT_TRUSTEE.IS_LEAF_NODE, imanage.DIT_TRUSTEE.LABEL_F21011,
imanage.DIT_TRUSTEE.LOGIN_LOCKOUT_TIME, imanage.DIT_TRUSTEE.MODIFIED_TIME,
imanage.DIT_TRUSTEE.PARENT_TRUSTEE_RSID, imanage.DIT_TRUSTEE.PASSWORD_F21015,
imanage.DIT_TRUSTEE.PASSWORD_FAIL_COUNT, imanage.DIT_TRUSTEE.PASSWORD_MODIFIED_TIME,
imanage.DIT_TRUSTEE.RDN, imanage.DIT_TRUSTEE.REPLICATION_ID, imanage.DIT_TRUSTEE.SID,
imanage.DIT_TRUSTEE.SYNCHRONIZE_ID, imanage.DIT_TRUSTEE.SYNCHRONIZED_TIME,
imanage.DIT_TRUSTEE.TRUSTEE_TYPE, imanage.DIT_TRUSTEE.UID_F21024,
imanage.DIT_TRUSTEE.WORKSPACE_LIBRARY, imanage.DIT_TRUSTEE.WORKSPACE_RSID,
imanage.DIT_TRUSTEE.IS_WORKSPACE_LIBRARY_INHERITED,
imanage.DIT_TRUSTEE.IS_HOME_LIBRARY_INHERITED, imanage.DI
Plan hash value: 2563299851
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 4 (100)| |
| 1 | SORT ORDER BY | | 1 | 248 | 4 (25)| 00:00:01 |
|* 2 | TABLE ACCESS BY INDEX ROWID| DIT_TRUSTEE | 1 | 248 | 3 (0)| 00:00:01 |
|* 3 | INDEX RANGE SCAN | DIT_TRUSTEE_TST1_IDX | 1 | | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - filter("DIT_TRUSTEE"."WORKSPACE_RSID"=:SYS_B_0)
3 - access("DIT_TRUSTEE"."SYS_NC00096$"=:1)
Note
- outline "SYS_OUTLINE_13100417531513606" used for this statement
38 rows selected.
Definition of index DIT_TRUSTEE_TST1_IDX is:
CREATE INDEX "IMANAGE"."DIT_TRUSTEE_TST1_IDX" ON "IMANAGE"."DIT_TRUSTEE" (UPPER("RDN")) TABLESPACE "REPOS_INDX" PCTFREE 10 INITRANS 2 MAXTRANS 255STORAGE ( INITIAL 512K BUFFER_POOL DEFAULT) LOGGING LOCAL
I didnt want the query to use index DIT_TRUSTEE_TST1_IDX as it performs bad for the customer as compare to index IX_DIT_TRUSTEE_6
The question arises here is that can we force an index to be used as part of stored outline because when we created outline, it was using index IX_DIT_TRUSTEE_6. -
I have some stored outlines that aren't being used and I can't figure out why.
Not sure what the best next step is.
Unfortunately, this is 8.1.7.4 - appreciate it's an old version, it's upgrading imminently.
The production database has some statistics - a really crap situation which again is on the path to being rectified.
Some queries have been developed which work ok against a development database where all objects have some representative statistics.
Not surprisingly, these queries do not work at all well against a production-like database where only some objects have statistics, and some of those are stale (the CBO makes up some defaults and not surprisingly gets bad paths).
So, the idea was to:
- Capture stored outlines for queries against "good" database
- Export
- Import to "bad" database
- Enable stored outline usage at a session level in the "bad" database
- See the queries run acceptably.
Unfortunately, in the "bad" database, the stored outlines are not being used.
- I have set "alter session set use_stored_outlines=....."
- I have flushed the shared pool to make sure
- I can tell from performance that outlines are not being used
- I can see from a 10046 and 10053 trace that stored outlines are not being used
- I can see from v$sql that the outline_category is null
- I can see from outln.ol$ that the queries are there and not being used
- I can see in outln.ol$hint that all the hints are there and nothing has got corrupted or rejected from imp/exp.
- I can see from v$sql that the hash_value of the SQL matches the hash_value of the SQL in ol$.
What could / should my next steps be to determine what is going on ?Have never used outlines myself but answers to this question
http://www.freelists.org/archives/oracle-l/12-2006/msg00199.html
seems to indicate that both environments should match also for other parameters.
You can search also in the archives for the above mentioned list for outlines, I assume there were many threads of them, probably you can get some idea.
Gints Plivna
http://www.gplivna.eu -
Stored Outline for Bind Variable
Hi,
Please let me know the use of stored outline to maintain the same execution plan for a sql which contains bind variable.
I know how to use stored outline for a sql which does not contain bind variable. But I want the use of stored outline for sql where bind variables have been used. Please provide an example.
Thanks,
Mrinmoy
Edited by: user3001930 on Aug 10, 2010 11:22 PMNot sure as I don't use them myself, but on AskTom:
http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1396058400346694178
He says:
>
stored outlines are deprecated in 11g - replaced by query plan baselines.
http://download.oracle.com/docs/cd/B28359_01/server.111/b28318/sqlplsql.htm#sthref2589 -
How much performance is impacted if the Stored outline is used globally?
Hi,
One of the queries that we are having problem with and we are trying to use the Stored outline so that we freeze the execution plan. The vendor is telling us that it should set globally (ALTER SYSTEM not SESSION) , but we disagreed because this would have negative effect on our db performance. We ask to enable session only iusing LOGON trigger filtered by program/username nstead of system like below
Vendor preference: ALTER SYSTEM SET CREATE_STORED_OUTLINES=TRUE
We prefer: ALTER SESSION SET CREATE_STORED_OUTLINES=TRUE
BTW, we are on HP UX 10.2.0.3. Any recommendations or suggestions would be greatly appreciated. Thank you so much.
Rich.No Oracle version number.
No information as to the vendor or the product.
No information indicating why a stored outline might be of value in one or many cases.
And most importantly ... no evidence of testing to see if it really makes things better or worse.
Throw this into a test environment and validate your prejudices. There is no way we can possibly
know and there are no general rules when it comes to tuning other than the fact that only testing
on your hardware with your system has value. -
Do stored outlines work in Oracle 10.2.0.3?
I am using 10.2.0.3 on HP UNIX 11i. I set cursor_sharing=force.
I created a stored outline using:
alter session set create_stored_outlines='CUSTOM';
my sql_statement;
When I run the sql statement and verify in v$sql whether outline was used by looking at outline_category and yes outline is used.
But then I run dbms_stat on an underlying table and run my sql again, my plan has changed which means outline was not used. This is really baffling, if outline was used,
Plan should be same as what was produced when creating outline. Something is
Definitely wrong.After spending whole day, I narrowed down the proble. Stored outlines in 10.2.0.3
do not work anymore whith cursor_sharing=force. They, however, they work with
cusror_sharing=similar and cirsor_sahring=exact.
Maybe you are looking for
-
SFTP Issue in OSB invocation resulted in an error: java.util.NoSuchElement
I created a Proxy Service to do SFTP Poll to read the file from abcserver and its working fine . (OSB is on abc server). known_hosts file is present on OSB server. It has abcserverhostname,IP ssh-rsa AA................. == I created a business servic
-
I have contacted at&t and they did what was nessary to unlock my phone was told to backup my phone and did that so know I just need to restore my phone with ituens which ituenes will not let me do cause I get message can not connect to cause of no in
-
Invoking-sp-modaldialog-in-sharepoint-2013-hosted-apps
Hello All, I'm building a SharePoint 2013, SharePoint Hosted app project using the JSOM api. I have to make use of the SP.UI.ModalDialog to popup some content in the app. I have used the getScript method to load the sp.js, sp.runtime.js and SP.Reque
-
Hi Guys, Need your help regarding external tables, I'm using Oracle 10g. I have tried using external tables and almost all of them works except for one. It has a null data on the last field. Kindly check what am I missing. CREATE TABLE X_MHC_FCSDOC2P
-
Catch 22 with trust this device alltgether mayhem
whatever you do it is allways wrong