Purpose
You can use this statement to add a bound outline and throttling rules. This statement supports only 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 modified. |
| 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> ALTER OUTLINE ol_1 ADD SELECT /*+max_concurrent(1)*/ * FROM t1 WHERE c1 = 1 and c2 = ?; obclient> ALTER OUTLINE ol_1 ADD SELECT /*+max_concurrent(1)*/ * FROM t1 WHERE c1 = ? and c2 = 1;Execute
ALTER OUTLINEto add an execution plan.obclient> CREATE OUTLINE ol_2 ON SELECT /*+max_concurrent(1)*/ * FROM t1,t2 WHERE t1.c1 = 1; obclient> ALTER OUTLINE ol_2 ADD SELECT /*+use_nl(t2)*/ * FROM t1,t2 WHERE t1.c1 = 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 the
CREATE OUTLINEstatement, you cannot specify both throttling rules and an execution plan when you execute theALTER OUTLINEstatement.