Purpose
This statement is used to add new binding rules, including execution plan binding and throttling rules, to an existing outline. It only supports modifying outlines created using SQL_TEXT.
Syntax
ALTER OUTLINE outline_name ADD stmt [ TO target_stmt ]
Parameters
Parameters |
Description |
|---|---|
| outline_name | Specifies the name of the outline to be modified. |
| stmt | It is generally a DML statement with hints and original parameters. |
| TO target_stmt | If not specified, TO target_stmt means that if the SQL statement accepted by the database after parameterization matches the parameterized text of stmt with hints removed, the SQL statement is bound to the execution plan generated by the hints in stmt. To ensure that a statement containing hints always uses the same plan, you must use the TO target_stmt to specify the original SQL statement. Note When using target_stmt strictly required when stmt and target_stmt Exactly match after removing the hint. |
Examples
Add throttling rules by using the
ALTER OUTLINEstatement.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;Add execution plans using
ALTER OUTLINE.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
You can specify at most one execution plan for the same
outline_name. If you specify an execution plan using theCREATE OUTLINEstatement, you cannot add it later by executingALTER OUTLINE.Similar to
CREATE OUTLINE, you cannot specify both throttling rules and execution plans when usingALTER OUTLINE.