Applies To
All Users
Summary
This note provides different options to estimate the time required to Purge Large Number of Objects from Recycle Bin.
You can purge recycle bin using command: PURGE DBA_RECYCLEBIN
Solution
You can use any of the following methods to estimate the time for the purge :
1- Run the following statement at 5 minutes interval after the purge command execution , to estimate the time needed :
SQL> select sum(SPACE) from DBA_RECYCLEBIN;
then execute :
SQL>PURGE DBA_RECYCLEBIN;
Then after 5 minutes execute the select statement again :
SQL: select sum(SPACE) from DBA_RECYCLEBIN;
Now you know the difference between the first and the second select statement output , you can figure the time remaining .
For example if the first statement returned 200 and after 5 minutes it returned 160 , then it will finish in about 25 Minute.
Column SPACE in DBA_RECYCLEBIN is the Number of Database blocks used by the object .
or
2- You can monitor the progress of the purge by querying the view V$SESSION_LONGOPS.
V$SESSION_LONGOPS Displays the status of various operations that run for longer than 6 seconds (in absolute time).
TIMED_STATISTICS Must equal true and statistics_level = TYPICAL or ALL for V$SESSION_LONGOPS to be populated .
You should get the SID and SERIAL# for the session that will be executing the purge command ,
then run the PURGE DBA_RECYCLEBIN; command
then from another session run the following :
select SOFAR,TOTALWORK,SOFAR,UNITS,TIME_REMAINING from V$SESSION_LONGOPS where SID= and SERIAL#= ;
The column 'TOTALWORK' shows the total amount of work, of which the 'SOFAR' amount has been done up until now.
Also TIME_REMAINING column is the Estimate (in seconds) of time remaining for the operation to complete
You can then use it to estimate how much longer will your export/import take.
Attachments :