Register now and start sharing your code snippets.
-->

How to generate an Oracle statspack report and an explain plan for a query

SQL posted about 1 year ago by christian

   1  -- Connect
   2  
   3  sqlplus <username>/<password>@<database>
   4  
   5  -- Generate statspack report
   6  
   7  @?/rdbms/admin/spreport.sql
   8  
   9  -- Find execution plan for a specific query
  10  @?/rdbms/admin/sprepsql.sql
  11  
  12  Specify the Begin and End Snapshot Ids
  13  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  14  Enter value for begin_snap: 1
  15  Begin Snapshot Id specified: 1
  16  
  17  Enter value for end_snap: 2
  18  End   Snapshot Id specified: 2
  19  
  20  
  21  Specify the Hash Value
  22  ~~~~~~~~~~~~~~~~~~~~~~
  23  Enter value for hash_value: 2967942512
  24  Hash Value specified is: 2967942512

Tagged oracle, explain plan, statspack