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

相关推荐
二宝哥1 小时前
02.springboot项目对接国内模型实现对话聊天
数据库·人工智能·spring boot
秦时明月之君临天下1 小时前
MySQL purge 参数详解:innodb_purge_threads 与 innodb_purge_batch_size
数据库·mysql·1024程序员节
三垣网安1 小时前
某某大学心理健康教育平台弱口令及SQL注入漏洞
数据库·sql
打工仔折腾 AI1 小时前
AI Agent 工程化实战(二):5 分钟跑通 Deep Agent 并逐层拆解底层链路
java·数据库·人工智能·后端·python·langchain·ai agent 实战
Shaoshing2 小时前
MySQL视图
数据库
这个DBA有点耶2 小时前
测试全绿,上线三周数据没入账——那个95%的兼容度报告,漏掉的是边界
数据库·mysql·架构
1024奇点3 小时前
【仓颉语言入门 · 第二篇 第 15 课】
开发语言·数据库·ide·开源
疯狂学习GIS3 小时前
将谷歌地球引擎账号升级为Contributor与Partner层级的方法
java·数据库·人工智能
gf13211113 小时前
python_高德地图驾车时长查询
数据库·python·mysql
时间售卖铺3 小时前
MySQL 日志管理
运维·数据库·mysql·云原生