预估 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 :

相关推荐
尽兴-2 小时前
Git 分支管理核心命令科普指南
数据库·git·分支管理·代码仓库
XDHCOM2 小时前
Redis本地化实现策略与应用问题解析,如何配置Redis本地化,常见问题解决
数据库·redis·缓存
RDCJM2 小时前
C#数据库操作系列---SqlSugar完结篇
网络·数据库·c#
小陈工2 小时前
Python Web开发入门(一):虚拟环境与依赖管理,从零搭建纯净开发环境
开发语言·前端·数据库·git·python·docker·开源
jnrjian2 小时前
crosscheck restore uncatalog archivelog 检查 恢复 归档日志
数据库·dba
霖霖总总2 小时前
[Redis小技巧29]从 Setnx 到 Redlock:Redis 分布式锁的演进之路与生产级实践
数据库·redis·分布式
-ONLY-¥2 小时前
MySQL备份恢复全攻略
数据库·oracle
一个天蝎座 白勺 程序猿2 小时前
源网荷储实时互动需求下,时序数据库如何赋能新型电力系统?
数据库·时序数据库
笑梦无境3 小时前
mysql基础篇二(多年前整理)
数据库·mysql