Purpose
You can use this statement to add bound outlines and throttling rules. This statement only supports outlines created by using SQL_TEXT.
Syntax
ALTER OUTLINE outline_name ADD stmt [ TO target_stmt]
Parameters
| Parameter | Description |
|---|---|
| outline_name | The name of the outline to be created. |
| stmt | It is generally a DML statement with hints and original arguments. |
| TO target_stmt | If TO target_stmt is not specified, when the parameterized SQL statement accepted by the database is the same as the parameterized text of stmt without a hint, the database binds the SQL statement to the hint in stmt to generate an execution plan. If you want to bind plans to statements that have hints, use TO target_stmt to specify the original SQL statement. Notice: When you specify target_stmt, you must ensure that stmt exactly matches target_stmt when hints are removed. |
Examples
Execute
ALTER OUTLINEto add throttling rules.obclient> CREATE OUTLINE outline1 ON SELECT /*+max_concurrent(1)*/ * FROM tbl1 WHERE col1 =1 AND col2 = 1; obclient> ALTER OUTLINE outline1 ADD SELECT /*+max_concurrent(1)*/ * FROM tbl1 WHERE col1 =1 AND col2 = ?; obclient> ALTER OUTLINE outline1 ADD SELECT /*+max_concurrent(1)*/ * FROM tbl1 WHERE col1 =? AND col2 = 1;Execute
ALTER OUTLINEto add an execution plan.obclient> CREATE OUTLINE outline2 ON SELECT /*+max_concurrent(1)*/ * FROM tbl1,tbl2 WHERE tbl1.col1 = 1; obclient> ALTER OUTLINE outline2 ADD SELECT /*+use_nl(tbl2)*/ * FROM tbl1,tbl2 WHERE tbl1.col1 = 1;
Considerations
Only one execution plan can be specified for the same
outline_name. If an execution plan has been specified by using theCREATE OUTLINEstatement, you cannot add the execution plan by executingALTER OUTLINE.Similar to
CREATE OUTLINE, when you useALTER OUTLINE, you cannot specify both the outline's limiting rule and execution plan simultaneously.When you execute the
ALTER OUTLINEstatement,outline_nameandsignaturemust match.