Monday, April 27, 2015

10053 Trace for SQL statements available in cursor cache

Traditionally if we want to capture an optimizer trace for a sql statement then we would issue an
o   Alter session command to switch on a 10053 trace (alter session set events '10053 trace name context forever, level 12'; )
o   Then run the sql you want to capture the trace for
o   Once completed exit the session and look for trace in the USER_DUMP_DEST directory.
But what if the sql statement was actually a part of plsql package got executed and available in the cursor cache? In this case we can make use of the new feature dbms_sqldiag API available in the 11g and above to generate the 10053 trace file for us.
rajesh@ORA11G> create or replace procedure process_data
  2  as
  3  begin
  4     for x in (select owner,count(*) cnt
  5                             from big_table
  6                             group by owner)
  7     loop
  8             null ;
  9     end loop;
 10     $if $$debug $then
 11             for x in (select * from
 12                     table(dbms_xplan.display_cursor))
 13             loop
 14                     dbms_output.put_line(x.plan_table_output);
 15             end loop;
 16     $end
 17  end;
 18  /
 
Procedure created.
 
Elapsed: 00:00:00.24
rajesh@ORA11G> set timing off
rajesh@ORA11G> alter procedure
  2  process_data compile
  3  plsql_ccflags='debug:true';
 
Procedure altered.
 
rajesh@ORA11G> exec process_data;
SQL_ID  9gp5ypq76vhfa, child number 0
-------------------------------------
SELECT OWNER,COUNT(*) CNT FROM BIG_TABLE GROUP BY OWNER
 
Plan hash value: 1753714399
 
--------------------------------------------------------------------------------
| Id  | Operation          | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |           |       |       |  2714K(100)|          |
|   1 |  HASH GROUP BY     |           |    33 |   198 |  2714K  (1)| 00:09:34 |
|   2 |   TABLE ACCESS FULL| BIG_TABLE |   100M|   572M|  2710K  (1)| 00:09:33 |
--------------------------------------------------------------------------------
 
 
PL/SQL procedure successfully completed.
 
rajesh@ORA11G> @tkfilename.sql
D:\APP\179818\diag\rdbms\ora11g\ora11g\trace\ora11g_ora_81780.trc
 
rajesh@ORA11G> begin
  2     dbms_sqldiag.dump_trace
  3     ('9gp5ypq76vhfa',0,'Compiler');
  4  end;
  5  /
 
PL/SQL procedure successfully completed.
 
rajesh@ORA11G> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
 
Here is what the contents available in ora11g_ora_81780.trc file.
Enabling tracing for cur#=13 sqlid=a94wx68sy8n04 recursive
Parsing cur#=13 sqlid=a94wx68sy8n04 len=80
sql=/* SQL Analyze(70,0) */ SELECT OWNER,COUNT(*) CNT FROM BIG_TABLE GROUP BY OWNER
End parsing of cur#=13 sqlid=a94wx68sy8n04
Semantic Analysis cur#=13 sqlid=a94wx68sy8n04
OPTIMIZER INFORMATION
 
******************************************
----- Current SQL Statement for this session (sql_id=4cyv3hm6p9buu) -----
/* SQL Analyze(70,0) */ SELECT OWNER,COUNT(*) CNT FROM BIG_TABLE GROUP BY OWNER
----- PL/SQL Stack -----
----- PL/SQL Call Stack -----
  object      line  object
  handle    number  name
000007FF0C17C418       145  package body SYS.DBMS_SQLTUNE_INTERNAL
000007FF0C17C418     12098  package body SYS.DBMS_SQLTUNE_INTERNAL
000007FF0C1FAF00      1229  package body SYS.DBMS_SQLDIAG
000007FF174D9390         2  anonymous block
*******************************************
Legend
The following abbreviations are used by optimizer trace.
CBQT - cost-based query transformation
JPPD - join predicate push-down
....
....
 

Wednesday, April 22, 2015

Concurrent Execution of Union / Union all in 12c

Traditionally, set operators are processed in a sequential manner. Individual branches can be processed in serial or parallel, but only one branch at a time, one branch after another. It is also possible to execute the individual branches as concurrent,
1)      When at least one branch is local and it is considered being processed in parallel.
2)      Optimizer feature enable parameter is set to 12 and above.
This behavior is enabled by default in 12c and in 11g should be enabled explicitly using PQ_CONCURRENT_UNION hint.
Concurrent execution of branches can be identified by row source operation “PX SELECTOR” from explain plan.
rajesh@PDB1> create table t1 as select * from all_objects;
 
Table created.
 
rajesh@PDB1> create table t2 as select * from all_objects;
 
Table created.
 
rajesh@PDB1> create table t3 as select * from all_objects;
 
Table created.
 
rajesh@PDB1>
rajesh@PDB1> delete from plan_table;
 
13 rows deleted.
 
rajesh@PDB1> explain plan for
  2  create table t4 as
  3  select * from (
  4  select * from t1 union all
  5  select * from t2 union all
  6  select * from t3 ) ;
 
Explained.
 
rajesh@PDB1> @xpdisplay
 
PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 402113709
 
-----------------------------------------------------------------------------------------
| Id  | Operation                        | Name | Rows  | Bytes | Cost (%CPU)| Time     |
-----------------------------------------------------------------------------------------
|   0 | CREATE TABLE STATEMENT           |      |   268K|    94M|  4635   (1)| 00:00:01 |
|   1 |  LOAD AS SELECT                  | T4   |       |       |            |          |
|   2 |   OPTIMIZER STATISTICS GATHERING |      |   268K|    94M|  2060   (1)| 00:00:01 |
|   3 |    VIEW                          |      |   268K|    94M|  2060   (1)| 00:00:01 |
|   4 |     UNION-ALL                    |      |       |       |            |          |
|   5 |      TABLE ACCESS FULL           | T1   | 89353 |     9M|   418   (1)| 00:00:01 |
|   6 |      TABLE ACCESS FULL           | T2   | 89354 |     9M|   418   (1)| 00:00:01 |
|   7 |      TABLE ACCESS FULL           | T3   | 89355 |     9M|   418   (1)| 00:00:01 |
-----------------------------------------------------------------------------------------
 
14 rows selected.
 
rajesh@PDB1> alter table t1 parallel 2;
 
Table altered.
 
rajesh@PDB1> delete from plan_table;
 
8 rows deleted.
 
rajesh@PDB1> explain plan for
  2  create table t4 as
  3  select * from (
  4  select * from t1 union all
  5  select * from t2 union all
  6  select * from t3 ) ;
 
Explained.
 
rajesh@PDB1> @xpdisplay
 
PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 3248033409
 
---------------------------------------------------------------------------------------
| Id  | Operation                          | Name     | Rows  | Bytes |    TQ  |IN-OUT|
---------------------------------------------------------------------------------------
|   0 | CREATE TABLE STATEMENT             |          |   268K|    94M|        |      |
|   1 |  LOAD AS SELECT                    | T4       |       |       |        |      |
|   2 |   PX COORDINATOR                   |          |       |       |        |      |
|   3 |    PX SEND QC (RANDOM)             | :TQ10000 |   268K|    94M|  Q1,00 | P->S |
|   4 |     OPTIMIZER STATISTICS GATHERING |          |   268K|    94M|  Q1,00 | PCWC |
|   5 |      VIEW                          |          |   268K|    94M|  Q1,00 | PCWP |
|   6 |       UNION-ALL                    |          |       |       |  Q1,00 | PCWP |
|   7 |        PX BLOCK ITERATOR           |          | 89353 |     9M|  Q1,00 | PCWC |
|   8 |         TABLE ACCESS FULL          | T1       | 89353 |     9M|  Q1,00 | PCWP |
|   9 |        PX SELECTOR                 |          |       |       |  Q1,00 | PCWP |
|  10 |         TABLE ACCESS FULL          | T2       | 89354 |     9M|  Q1,00 | PCWP |
|  11 |        PX SELECTOR                 |          |       |       |  Q1,00 | PCWP |
|  12 |         TABLE ACCESS FULL          | T3       | 89355 |     9M|  Q1,00 | PCWP |
---------------------------------------------------------------------------------------Note
-----
   - Degree of Parallelism is 2 because of table property
 
23 rows selected.
 
rajesh@PDB1>

Tuesday, April 14, 2015

Server error triggers for sql chasing

Very recently we had a production scenario where the client application produced ORA 22163 in the application logs, but doesn’t report the sql causing this issue. Application developers were asking can this sql causing ORA 22163 be identified in the database?
We took an approach of schema level server error triggers (again completely transparent to applications). Just created the below error_table along with the servererror trigger, with the help of DBA on Application schema. Then ran the application workload/scenario that is causing this error.  Once the error ORA 22163 occurs in the database, automatically the sqltext along with the error message will be stored into this error_Table.
rajesh@ORA10G> create table errors_table
  2  (dt date default sysdate,
  3   logon_user varchar2(30) default user,
  4   err_no number,
  5   err_msg varchar2(50),
  6   sql_txt varchar2(500) );
 
Table created.
 
Elapsed: 00:00:00.06
rajesh@ORA10G> create or replace trigger catch_errors
  2  after servererror on rajesh.schema
  3  declare
  4     pragma autonomous_transaction ;
  5     sql_txt ora_name_list_t;
  6     l_stmt long;
  7  begin
  8     for i in 1..ora_sql_txt(sql_txt)
  9     loop
 10             l_stmt := l_stmt || sql_txt(i);
 11     end loop;
 12
 13     for i in 1..ora_server_error_depth
 14     loop
 15             insert into errors_table
 16             (logon_user, err_no, err_msg,sql_txt)
 17             values(ora_login_user, ora_server_error(i),
 18                     ora_server_error_msg(i), l_stmt );
 19     end loop;
 20     commit;
 21  end;
 22  /
 
Trigger created.
 
Elapsed: 00:00:00.09
rajesh@ORA10G> select * from errors_table;
 
no rows selected
 
Elapsed: 00:00:00.01
rajesh@ORA10G> select * from emp55;
select * from emp55
              *
ERROR at line 1:
ORA-00942: table or view does not exist
 
 
Elapsed: 00:00:00.07
rajesh@ORA10G>
rajesh@ORA10G> column dt noprint
rajesh@ORA10G> select * from errors_table;
 
LOGON_USER     ERR_NO ERR_MSG                                  SQL_TXT
---------- ---------- ---------------------------------------- ----------------------
RAJESH            942 ORA-00942: table or view does not exist  select * from emp55
 
1 row selected.
 
Elapsed: 00:00:00.01
rajesh@ORA10G>

Friday, April 3, 2015

Out of place mview refresh in 12c

Start with 12c a new mechanism of refreshing mviews available, this refresh creates one or more outside tables, executes the refresh statements on the outside tables, and then switches the materialized view or affected materialized view partitions with the outside tables. An out-of-place refresh achieves high availability during refresh, especially when refresh statements take a long time to finish.
rajesh@PDB1> create table t as select * from all_objects a;
 
Table created.
 
Elapsed: 00:00:06.14
rajesh@PDB1>
rajesh@PDB1> create materialized view t_mv
  2  build immediate
  3  refresh on demand
  4  enable query rewrite
  5  as
  6  select owner, count(*)
  7  from t
  8  group by owner ;
 
Materialized view created.
 
Elapsed: 00:00:00.54
rajesh@PDB1>
rajesh@PDB1> insert into t
  2  select * from all_objects a
  3  where rownum <=5;
 
5 rows created.
 
Elapsed: 00:00:00.88
rajesh@PDB1> commit;
 
Commit complete.
 
Elapsed: 00:00:00.01
rajesh@PDB1>
rajesh@PDB1> begin
  2     dbms_mview.refresh('T_MV','C',
  3             atomic_refresh=>false,
  4             out_of_place=>true);
  5  end;
  6  /
 
PL/SQL procedure successfully completed.
 
Elapsed: 00:00:23.11
rajesh@PDB1>
 
 
With these settings the session will create a new table with a name of the form RV$xxxxxx where xxxxxx is the hexadecimal version of the new object id, insert the new data into that table (though not using the /*+ append */ hint), create the indexes on that table (again with names like RV$xxxxxx - where xxxxxx is the index's object_id). Once the new data has been indexed Oracle will do some name-switching in the data dictionary (shades of exchange partition) to make the new version of the materialized view visible. A quirky detail of the process is that the initial create of the new table and the final drop of the old table don't show up in the trace file, although the commands to drop and create indexes do appear. (The original table, though it's dropped after the name switching, is not purged from the recyclebin.) The impact on undo and redo generation is significant
 
And the trace file shows me this
 
********************************************************************************
 
SQL ID: a2myrwrykjmd2 Plan Hash: 0
 
drop table "RAJESH"."RV$16D83"
 
 
call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        2      0.00       0.00          0          0          0           0
Execute      2      0.06       0.18          0          1          2           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        4      0.06       0.18          0          1          2           0
 
Misses in library cache during parse: 2
Optimizer mode: ALL_ROWS
Parsing user id: 103     (recursive depth: 1)
 
Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  reliable message                                1        0.00          0.00
  enq: RO - fast object reuse                     1        0.00          0.00
********************************************************************************
 
SQL ID: 7vh7psa1x25g2 Plan Hash: 1064870033
 
CRE
 
 
call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.06          0         27          0           0
Execute      1      0.03       0.02          0         33          3           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.03       0.09          0         60          3           0
 
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 103     (recursive depth: 1)
Number of plan statistics captured: 1
 
Rows (1st) Rows (avg) Rows (max)  Row Source Operation
---------- ---------- ----------  ---------------------------------------------------
         0          0          0  LOAD AS SELECT  (cr=0 pr=0 pw=0 time=282 us)
         0          0          0   OPTIMIZER STATISTICS GATHERING  (cr=0 pr=0 pw=0 time=193 us)
         0          0          0    HASH GROUP BY (cr=0 pr=0 pw=0 time=135 us)
         0          0          0     FILTER  (cr=0 pr=0 pw=0 time=6 us)
         0          0          0      TABLE ACCESS FULL T (cr=0 pr=0 pw=0 time=0 us cost=418 size=536076 card=89346)
 
********************************************************************************
 
SQL ID: a3xs164hn3m3t Plan Hash: 47235625
 
INSERT INTO "RAJESH"."RV$16D83" ("OWNER","COUNT(*)") SELECT "T"."OWNER",
  COUNT(*) FROM "T" "T" GROUP BY "T"."OWNER"
 
 
call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.01       0.00          0          0          0           0
Execute      1      0.04       0.06          0       1512         42          26
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.06       0.06          0       1512         42          26
 
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 103     (recursive depth: 1)
Number of plan statistics captured: 1
 
Rows (1st) Rows (avg) Rows (max)  Row Source Operation
---------- ---------- ----------  ---------------------------------------------------
         0          0          0  LOAD TABLE CONVENTIONAL  RV$16D83 (cr=1511 pr=0 pw=0 time=53720 us)
        26         26         26   HASH GROUP BY (cr=1509 pr=0 pw=0 time=36496 us cost=420 size=156 card=26)
     89351      89351      89351    TABLE ACCESS FULL T (cr=1509 pr=0 pw=0 time=13055 us cost=418 size=536076 card=89346)
 
********************************************************************************
 
/* MV_REFRESH (CIDX) */ CREATE UNIQUE INDEX "RAJESH"."RV$16D84" ON "RAJESH"."RV$16D83" (SYS_OP_MAP_NONNULL("OWNER"))
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "DATA_12C"
 
call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          1          1           0
Execute      1      0.01       0.03          0          9         45           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.01       0.03          0         10         46           0
 
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 103     (recursive depth: 1)
Number of plan statistics captured: 1
 
Rows (1st) Rows (avg) Rows (max)  Row Source Operation
---------- ---------- ----------  ---------------------------------------------------
         1          1          1  INDEX BUILD UNIQUE RV$16D84 (cr=12 pr=0 pw=0 time=23852 us)(object id 0)
        26         26         26   SORT CREATE INDEX (cr=7 pr=0 pw=0 time=388 us)
        26         26         26    TABLE ACCESS FULL RV$16D83 (cr=7 pr=0 pw=0 time=143 us cost=2 size=66 card=1)
 
********************************************************************************
 
SQL ID: 24jzz1qu842c0 Plan Hash: 0
 
LOCK TABLE  FOR INDEX "RAJESH"."RV$16D84" IN EXCLUSIVE MODE  NOWAIT
 
 
call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      0.00       0.00          0          0          0           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.00       0.00          0          0          0           0
 
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 103     (recursive depth: 2)
********************************************************************************
 
SQL ID: d41ntutwcktng Plan Hash: 0
 
DROP INDEX RAJESH.RV$16D84
 
 
call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          1           0
Execute      1      0.07       0.16          1          1          9           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.07       0.16          1          1         10           0
 
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 103     (recursive depth: 1)
 
Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  reliable message                                2        0.00          0.00
  enq: RO - fast object reuse                     1        0.00          0.00
  db file sequential read                         1        0.00          0.00
  enq: CR - block range reuse ckpt                1        0.00          0.00
********************************************************************************
 
declare
   stmt varchar2(200);
   cnt number;
BEGIN
     if sys.dbms_standard.dictionary_obj_type = 'USER' THEN
       stmt := 'DELETE FROM SDO_GEOM_METADATA_TABLE ' ||
     ' WHERE SDO_OWNER = :owner ';
       EXECUTE IMMEDIATE stmt USING sys.dbms_standard.dictionary_obj_name;
       stmt := 'DELETE FROM SDO_MAPS_TABLE ' ||
    ' WHERE SDO_OWNER = :owner ';
       EXECUTE IMMEDIATE stmt USING sys.dbms_standard.dictionary_obj_name;
       stmt := 'DELETE FROM SDO_CACHED_MAPS_TABLE ' ||
    ' WHERE SDO_OWNER = :owner ';
       EXECUTE IMMEDIATE stmt USING sys.dbms_standard.dictionary_obj_name;
       stmt := 'DELETE FROM SDO_STYLES_TABLE ' ||
    ' WHERE SDO_OWNER = :owner ';
       EXECUTE IMMEDIATE stmt USING sys.dbms_standard.dictionary_obj_name;
       stmt := 'DELETE FROM SDO_THEMES_TABLE ' ||
   ' WHERE SDO_OWNER = :owner ';
       EXECUTE IMMEDIATE stmt USING sys.dbms_standard.dictionary_obj_name;
       stmt := 'DELETE FROM SDO_LRS_METADATA_TABLE ' ||
   ' WHERE SDO_OWNER = :owner ';
       EXECUTE IMMEDIATE stmt USING sys.dbms_standard.dictionary_obj_name;
       stmt := 'DELETE FROM SDO_TOPO_METADATA_TABLE ' ||
   ' WHERE SDO_OWNER = :owner ';
       EXECUTE IMMEDIATE stmt USING sys.dbms_standard.dictionary_obj_name;
       stmt := 'DELETE FROM SDO_ANNOTATION_TEXT_METADATA ' ||
   ' WHERE F_TABLE_SCHEMA = :owner ';
       EXECUTE IMMEDIATE stmt USING sys.dbms_standard.dictionary_obj_name;
    end if;
end;
 
call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        2      0.01       0.08          0          0          0           0
Execute      2      0.00       0.00          0          0          0           2
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        4      0.01       0.08          0          0          0           2
 
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 79     (recursive depth: 2)
********************************************************************************
 
DECLARE
  stmt    VARCHAR2(256);
BEGIN
  IF  sys.dbms_standard.dictionary_obj_type = 'USER'  THEN
    stmt := 'DELETE FROM SDO_NETWORK_METADATA_TABLE WHERE SDO_OWNER = :name';
    EXECUTE IMMEDIATE stmt using NLS_UPPER(sys.dbms_standard.dictionary_obj_name);
    stmt := 'DELETE FROM SDO_NETWORK_CONSTRAINTS WHERE SDO_OWNER = :name';
    EXECUTE IMMEDIATE stmt using NLS_UPPER(sys.dbms_standard.dictionary_obj_name);
    stmt := 'DELETE FROM SDO_NETWORK_LOCKS_WM WHERE SDO_OWNER = :name';
    EXECUTE IMMEDIATE stmt using NLS_UPPER(sys.dbms_standard.dictionary_obj_name);
    stmt := 'DELETE FROM SDO_NETWORK_USER_DATA WHERE SDO_OWNER = :name';
    EXECUTE IMMEDIATE stmt using NLS_UPPER(sys.dbms_standard.dictionary_obj_name);
    --lrg-3417773
    stmt := 'DELETE FROM SDO_NETWORK_HISTORIES WHERE OWNER = :name';
    EXECUTE IMMEDIATE stmt using NLS_UPPER(sys.dbms_standard.dictionary_obj_name);
    stmt := 'DELETE FROM SDO_NETWORK_TIMESTAMPS WHERE OWNER = :name';
    EXECUTE IMMEDIATE stmt using NLS_UPPER(sys.dbms_standard.dictionary_obj_name);
    stmt := 'DELETE FROM SDO_NETWORK_FEATURE WHERE SDO_OWNER = :name';
    EXECUTE IMMEDIATE stmt using NLS_UPPER(sys.dbms_standard.dictionary_obj_name);
  END IF;
END ;
 
call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        2      0.01       0.01          0          0          0           0
Execute      2      0.00       0.00          0          0          0           2
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        4      0.01       0.01          0          0          0           2
 
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 79     (recursive depth: 2)
 
 
 
********************************************************************************
 
After refresh completed, dropped segments still exists in recyclebin.
 
rajesh@PDB1> select object_name,original_name,operation,type,
  2    related,base_object,purge_object
  3  from user_recyclebin ;
 
OBJECT_NAM ORIGINAL_N OPERATION  TYPE          RELATED BASE_OBJECT PURGE_OBJECT
---------- ---------- ---------- ---------- ---------- ----------- ------------
BIN$5OO3BQ RV$16D83   DROP       TABLE           93571       93571        93571
 
1 row selected.
 
Elapsed: 00:00:00.18
rajesh@PDB1> select to_number('16D83','xxxxx') from dual ;
 
TO_NUMBER('16D83','XXXXX')
--------------------------
                     93571
 
1 row selected.
 
Elapsed: 00:00:00.00
rajesh@PDB1>