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

相关推荐
听到微笑19 分钟前
Elasticsearch 如何存储与检索海量向量
数据库·elasticsearch
海浪仙人掌37 分钟前
速动比率怎么分析?速动比率分析有哪些注意事项?
大数据·数据库·人工智能
企业数字化笔记43 分钟前
固定资产历史数据怎么导入系统?Excel模板、字段映射和数据校验
android·java·数据库·后端
还是奇怪1 小时前
OpenAI GPT-5.6 构建指南拆解:创业公司如何用模型选择与 Responses API 降低 Agent 成本
java·数据库·人工智能·gpt
可涵不会debug1 小时前
LangChain 文本分割器详解:字符分割、Token 分割、硬约束递归分割实战
java·前端·数据库
风哥2号1 小时前
数据库教程FGMT21‑Oracle RAC+DG生产实战(1):Oracle19c/26ai for RHEL8/9安装配置+补丁
数据库·oracle
海鸥-w1 小时前
事务四大特性
数据库
旺仔不是程序员1 小时前
致命索引失效:索引列运算与函数索引不匹配
数据库·后端·面试
Htr_1 小时前
Cortex 使用指南:开源 API 知识层
前端·数据库·人工智能·重构·计算机外设
Roadinforest2 小时前
NoSQL的最终一致性:真的可靠吗?
数据库·nosql