어떠한 이유로 인해 Recylebin 으로 drop 된 (실제로는 rename만 된것이지만) 객체들을 일정한 기간 만큼만 지우고자 하는 경우가 있을 것이다.


해당 경우 아래와 같이 하면 된다.


보기 예 1 )


- 7일이 경과한  Table 을 삭제하고자 할때


select 'purge table '||owner||'."'||OBJECT_NAME||'";' 

from dba_recyclebin where type='TABLE' and to_date(droptime,'YYYY-MM-DD:HH24:MI:SS')<sysdate-7;


'PURGETABLE'||OWNER||'."'||OBJECT_NAME||'";'

------------------------------------------------------------------------------------------------------------------------

purge table WMSYS."BIN$PgNXeTuLWoPgU24AEKyH3g==$0";

purge table WMSYS."BIN$PgRouDktJGngU24AEKx4sg==$0";

purge table WMSYS."BIN$PgTrksKrSP3gU24AEKzvyw==$0";

Elapsed: 00:00:00.02


보기 예 2 )


- 5분이 경과한 Table 을 삭제하고자 할때


select 'purge table '||owner||'."'||OBJECT_NAME||'";' 

from dba_recyclebin where type='TABLE' and to_date(droptime,'YYYY-MM-DD:HH24:MI:SS')<sysdate-(5/(24*60));


끝.

Posted by pat98

07-17 00:01
Flag Counter
Yesterday
Today
Total

글 보관함

최근에 올라온 글

달력

 « |  » 2025.7
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31

최근에 달린 댓글