



1 row selected.


SQL ID: bk3p70gc73zat

=== Cursor statistics ===
old  12: where  sql_id = '&&lab_bad_sql_id'
new  12: where  sql_id = 'bk3p70gc73zat'

SQL_ID        PLAN_HASH_VALUE EXECUTIONS AVG_ELAPSED_MS AVG_BUFFER_GETS AVG_DISK_READS ROWS_PROCESSED
------------- --------------- ---------- -------------- --------------- -------------- --------------
bk3p70gc73zat      2392565234         75         49.148            9688              0             75

1 row selected.


=== Actual cursor plan ===
old   4:            '&&lab_bad_sql_id',
new   4:            'bk3p70gc73zat',

PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  bk3p70gc73zat, child number 0
-------------------------------------
SELECT /*+ gather_plan_statistics monitor full(o)
qb_name(DBACORNER_LAB_BAD) */ COUNT(*) FROM DBC_LAB_ORDERS O WHERE
O.CUSTOMER_ID = 4242 AND O.STATUS = 'COMPLETE'

Plan hash value: 2392565234

-----------------------------------------------------------------------------------------------
| Id  | Operation          | Name           | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-----------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |                |      1 |        |      1 |00:00:00.05 |    9688 |
|   1 |  SORT AGGREGATE    |                |      1 |      1 |      1 |00:00:00.05 |    9688 |
|*  2 |   TABLE ACCESS FULL| DBC_LAB_ORDERS |      1 |     30 |     48 |00:00:00.04 |    9688 |
-----------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter(("O"."CUSTOMER_ID"=4242 AND "O"."STATUS"='COMPLETE'))


21 rows selected.


=== Recent ASH activity ===
old  10: where  sql_id = '&&lab_bad_sql_id'
new  10: where  sql_id = 'bk3p70gc73zat'

ACTIVITY                                                         SQL_PLAN_LINE_ID SQL_PLAN_OPERATION             SQL_PLAN_OPTIONS                  SAMPLES
---------------------------------------------------------------- ---------------- ------------------------------ ------------------------------ ----------
ON CPU                                                                          2 TABLE ACCESS                   FULL                                    4

1 row selected.


=== Latest SQL Monitor report ===
old   2:          sql_id       => '&&lab_bad_sql_id',
new   2:          sql_id       => 'bk3p70gc73zat',

DBMS_SQLTUNE.REPORT_SQL_MONITOR(SQL_ID=>'BK3P70GC73ZAT',TYPE=>'TEXT',REPORT_LEVEL=>'ALL')
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL Monitoring Report

SQL Text
------------------------------
SELECT /*+ gather_plan_statistics monitor full(o) qb_name(DBACORNER_LAB_BAD) */ COUNT(*) FROM DBC_LAB_ORDERS O WHERE O.CUSTOMER_ID = 4242 AND O.STATUS = 'COMPLETE'

Global Information
------------------------------
 Status              :  DONE (ALL ROWS)
 Instance ID         :  1
 Session             :  OPS$AXION\CODEXSANDBOXOFFLINE (3029:56846)
 SQL ID              :  bk3p70gc73zat
 SQL Execution ID    :  16777290
 Execution Started   :  08/04/2026 03:34:53
 First Refresh Time  :  08/04/2026 03:34:53
 Last Refresh Time   :  08/04/2026 03:34:53
 Duration            :  .051467s
 Module/Action       :  DBACORNER_SQL_TUNING_LAB/PART1_BAD
 Service             :  orclpdb
 Program             :  sqlplus.exe
 Fetch Calls         :  1

Global Stats
=================================================
| Elapsed |   Cpu   |  Other   | Fetch | Buffer |
| Time(s) | Time(s) | Waits(s) | Calls |  Gets  |
=================================================
|    0.05 |    0.05 |     0.00 |     1 |   9688 |
=================================================

SQL Plan Monitoring Details (Plan Hash Value=2392565234)
====================================================================================================================================
| Id |      Operation       |      Name      |  Rows   | Cost |   Time    | Start  | Execs |   Rows   | Activity | Activity Detail |
|    |                      |                | (Estim) |      | Active(s) | Active |       | (Actual) |   (%)    |   (# samples)   |
====================================================================================================================================
|  0 | SELECT STATEMENT     |                |         |      |         1 |     +0 |     1 |        1 |          |                 |
|  1 |   SORT AGGREGATE     |                |       1 |      |         1 |     +0 |     1 |        1 |          |                 |
|  2 |    TABLE ACCESS FULL | DBC_LAB_ORDERS |      30 | 2676 |         1 |     +0 |     1 |       48 |          |                 |
====================================================================================================================================


1 row selected.

