Skip to main content

ALTER OUTLINE

Description

This statement is used to add throttling rules and bind outlines. It only supports modifying outlines created using the SQL_TEXT option.

Syntax

ALTER OUTLINE outline_name ADD stmt [ TO target_stmt ];

Parameters

ParameterDescription
outline_nameThe name of the outline to be modified.
stmtA DML statement that typically includes hints and original parameters.
TO target_stmtIf TO target_stmt is not specified, it means that if the SQL statement, after parameterization, matches the stmt statement with hints removed, the SQL statement will be bound to the execution plan generated by the hints in stmt. If you want to fix the execution plan for a statement with hints, you need to use TO target_stmt to specify the original SQL statement.
Notice: When using target_stmt, the stmt and target_stmt statements must be identical after removing the hints.

Examples

  • Add a throttling rule using ALTER OUTLINE.

    ALTER OUTLINE ol_1 ADD SELECT /*+max_concurrent(1)*/ * FROM t1 WHERE c1 = 1 and c2 = ?;
    ALTER OUTLINE ol_1 ADD SELECT /*+max_concurrent(1)*/ * FROM t1 WHERE c1 = ? and c2 = 1;
  • Add an execution plan using ALTER OUTLINE.

    CREATE OUTLINE ol_2 ON SELECT /*+max_concurrent(1)*/ * FROM t1,t2 WHERE t1.c1 = 1;
    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 is specified using the CREATE OUTLINE statement, it cannot be added again when executing ALTER OUTLINE.

  • Similar to CREATE OUTLINE, you cannot specify both throttling rules and execution plans at the same time when using ALTER OUTLINE.