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

相关推荐
秋914 分钟前
ruoyi项目更换为mysql9.7.0数据库
数据库
Andya_net20 分钟前
MySQL | MySQL 8.0 权限管理实践-精确赋予库、表只读等权限
android·数据库·mysql
筑梦之路2 小时前
harbor数据库报错权限异常如何处理——筑梦之路
数据库·harbor
czlczl200209252 小时前
理解 MySQL 行锁:两阶段锁协议与热点更新优化
数据库·mysql
AllData公司负责人2 小时前
通过Postgresql同步到Doris,全视角演示AllData数据中台核心功能效果,涵盖:数据入湖仓,数据同步,数据处理,数据服务,BI可视化驾驶舱
java·大数据·数据库·数据仓库·人工智能·python·postgresql
哆啦A梦15883 小时前
20, Springboot3+vue3实现前台轮播图和详情页的设计
javascript·数据库·spring boot·mybatis·vue3
渣渣盟3 小时前
Mysql入门到精通全集(SQL99)包含关系运算,软考数据库工程师复习首选
数据库·mysql·oracle
dishugj4 小时前
HANA 数据库的核心进程架构
数据库
2301_782040454 小时前
CSS Flex布局中如何实现导航栏与Logo的左右分布_利用justify-content- space-between
jvm·数据库·python
.柒宇.4 小时前
Redis主从复制集群搭建详解
数据库·redis·缓存·主从复制