中国开发网: 论坛: 数据库: 贴子 873226
DeepBlue:Stored Outlines
Creating Stored Outlines
1.SQL> ALTER SESSION SET create_stored_outlines = CATEGORY_NAME;
(The Oracle Server creates stored outlines automatically when you set this parameter to TRUE or to a category name. When the parameter is set to TRUE, the DEFAULT category )
SQL> SELECT ... ;
SQL> SELECT ... ;

2.SQL> CREATE OR REPLACE OUTLINE OUTLINE_NAME
FOR CATEGORY CATEGORY_NAME ON
SELECT ......


Using Stored Outlines

SQL> ALTER SESSION SET use_stored_outlines = CATEGORY_NAME;
(USE_STORED_OUTLINES must be set to TRUE or a category name:- If it is set to TRUE, then outlines from the DEFAULT category are used.- If it is set to a category name, then the outlines from that category are used. If there is no matching outline in that category but there is one in the DEFAULT category, then that outline is used.)

SQL> SELECT ...

Note: Setting CURSOR_SHARING to FORCE or SIMILAR prevents any outlines that are generated with literals from being used if they were generated with CURSOR_SHARING set to EXACT. To use stored outlines with CURSOR_SHARING=FORCE or SIMILAR, the outlines must be generated with CURSOR_SHARING set to FORCE or SIMILAR and with the CREATE_STORED_OUTLINES parameter.



Data Dictionary Information

SQL> SELECT name, category, used, sql_text FROM user_outlines;

SQL> SELECT node, hint FROM user_outline_hints WHERE name = ...;

SQL> SELECT sql_text, outline_category FROM v$sql WHERE ...;



Maintaining Stored Outlines
• Use DBMS_OUTLN to:
– Drop unused outlines
– Drop categories of outlines
– Rename a category
• Use ALTER OUTLINE to:
– Rename an outline
– Rebuild an outline
– Change the category of an outline
• Outlines are stored in the OUTLN schema

dbms_outln.drop_unused;

dbms_outln.update_by_cat('default','CATEGORY_NAME');

dbms_outln.drop_by_cat('CATEGORY_NAME');



Public Versus Private Outlines
Public outlines--Used when USE_STORED_OUTLINES is set to TRUE or a category
Private outlines--Used when USE_PRIVATE_OUTLINES is set to TRUE or a category


执行力=流程+计划+组织

把理想变成计划,
把计划变成步骤,
把步骤变成行动,
把行动变成成果。

好語說盡人必易之。規矩行盡人必繁之。福若受盡緣必孤。勢若使盡禍必至。

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录