Purpose
This statement is supported only for outlines created by using the SQL_TEXT option. You can use this statement to add binding outlines and throttling rules.
Syntax
ALTER OUTLINE outline_name ADD stmt [ TO target_stmt ]
Parameters
| Parameter | Description |
|---|---|
| outline_name | The name of the outline to be modified. |
| stmt | A DML statement that contains hints and original parameters. |
| TO target_stmt | If you do not specify TO target_stmt, the database will bind the execution plan generated by the hints in stmt to the SQL statement parameterized from stmt only if the parameterized SQL statement is the same as the parameterized text of stmt after removing the hints. Notice When you use target_stmt, the stmt and target_stmt must be exactly the same after removing the hints. |
Examples
Add a throttling rule by using the
ALTER OUTLINEstatement.obclient> CREATE TABLE tbl1 (col1 NUMBER, col2 NUMBER); 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;You can create multiple throttling statements for the same signature.
obclient> CREATE TABLE tbl2 (col1 NUMBER, col2 NUMBER); obclient> CREATE OUTLINE olt_2 ON SELECT /*+max_concurrent(1)*/ c2,c1 FROM t1 WHERE c1 > 3 AND c2 = 1; obclient> ALTER OUTLINE olt_2 ADD SELECT /*+max_concurrent(2)*/ c2,c1 FROM t1 WHERE c1 > ? AND c2 = 1; obclient> ALTER OUTLINE olt_2 ADD SELECT /*+max_concurrent(2)*/ c2,c1 FROM t1 WHERE c1 > ? AND c2 = 2; obclient> ALTER OUTLINE olt_2 ADD SELECT /*+max_concurrent(0)*/ c2,c1 FROM t1 WHERE c1 > ? AND c2 = 3;
Considerations
Only one execution plan can be specified for the same
outline_name. If an execution plan is specified by using theCREATE OUTLINEstatement, you cannot add another execution plan by using theALTER OUTLINEstatement.Like the
CREATE OUTLINEstatement, theALTER OUTLINEstatement cannot specify both a throttling rule and an execution plan.When you execute the
ALTER OUTLINEstatement, theoutline_nameandsignaturemust match.
