预估 PURGE DBA_RECYCLEBIN 执行时间 v$SESSION_LONGOPS 6 秒限制

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 :

相关推荐
2401_871696528 小时前
苹果微软双修党福音:Navicat如何优化跨系统传输性能延迟
jvm·数据库·python
m0_493934538 小时前
生产环境SQL如何动态控制窗口的计算范围
jvm·数据库·python
djjdjdjdjjdj8 小时前
Golang Redis如何做分布式锁_Golang Redis分布式锁教程【详解】
jvm·数据库·python
河阿里8 小时前
Redis:命令行基础语法与实战
数据库·redis·bootstrap
2301_816660218 小时前
golang如何实现消息批量消费_golang消息批量消费实现策略
jvm·数据库·python
qq_189807038 小时前
SQL视图性能低怎么办_将普通视图转换为带索引的物化视图
jvm·数据库·python
yejqvow128 小时前
如何在 Supabase 中安全实现用户“鼓掌”计数(防刷、防重放、防越权)
jvm·数据库·python
m0_678485458 小时前
SQL利用窗口函数实现轻量级报表设计_实战技巧
jvm·数据库·python
m0_747854528 小时前
CSS实现卡片式布局_浮动元素与clearfix的应用
jvm·数据库·python
2401_835956818 小时前
如何处理SQL查询中的逻辑重叠:AND OR嵌套优先级
jvm·数据库·python