Search notes:

Oracle: Statement ID of an execution plan

Oracle allows to specify a statement id when a plan is explained with the explain plan statement.
The purpose of this id is to identify a given execution plan in the table plan_table: the value is found in the column statement_id:
explain plan
   set statement_id = 'st1'
for
   select
      foo, bar, baz
   from
      tab;

…
select … from plan_table where statement_id = 'st1';
The statement id can also be passed as an argument to dbms_xplan.display.
select * from dbms_xplan.display(statement_id => 'st1'));

Index