오라클자바커뮤니티에서 설립한 개발자실무교육6년차 오엔제이프로그래밍 실무교육센터
(신입사원채용무료교육, 오라클, SQL, 튜닝, 자바, 스프링,
Ajax, jQuery, 안드로이드, 아이폰, 닷넷, C#, ASP.Net) www.onjprogramming.co.kr
10g에서 DROP TABLE을 하게 되면 기본적으로 실제 그것을
DROP 하는 것보다 RECYCLE BIN에 이동 시키거나 이름을 바꾸게 됩니다. PURGE 옵션을 사용하게 되면 실제 테이블을 DROP 합니다.
이래의 예문을 보도록 합니다.
CREATE TABLE flashback_drop_test (
id NUMBER(10)
);
INSERT INTO flashback_drop_test (id) VALUES (1);
COMMIT;
DROP TABLE flashback_drop_test;
SHOW RECYCLEBIN
ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME
---------------- ------------------------------ ------------ -------------------
FLASHBACK_DROP_T BIN$TstgCMiwQA66fl5FFDTBgA==$0 TABLE 2004-03-29:11:09:07
EST
FLASHBACK TABLE flashback_drop_test TO BEFORE DROP;
SELECT * FROM flashback_drop_test;
ID
----------
1
Tables in the recycle bin can be queried like any other table:
DROP TABLE flashback_drop_test;
SHOW RECYCLEBIN
ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME
---------------- ------------------------------ ------------ -------------------
FLASHBACK_DROP_T BIN$TDGqmJZKR8u+Hrc6PGD8kw==$0 TABLE 2004-03-29:11:18:39
EST
SELECT * FROM "BIN$TDGqmJZKR8u+Hrc6PGD8kw==$0";
ID
----------
1
아래처럼 DROP된 후 … 다시 살려 내는데 다른 이름으로 복구 하는 것도 가능 합니다.
FLASHBACK TABLE flashback_drop_test TO BEFORE DROP RENAME TO flashback_drop_test_old;
아래는 몇가지 PURGE 옵션의 예 입니다.
PURGE TABLE tablename; -- Specific table.
PURGE INDEX indexname; -- Specific index.
PURGE TABLESPACE ts_name; -- All tables in a specific tablespace.
PURGE TABLESPACE ts_name USER username; -- All tables in a specific tablespace for a specific user.
PURGE RECYCLEBIN; -- The current users entire recycle bin.
PURGE DBA_RECYCLEBIN; -- The whole recycle bin.
아래는 RECYCLE BIN에 대한 몇 가지 제약 사항 입니다.
•Only available for non-system, locally managed tablespaces.
•There is no fixed size for the recycle bin. The time an object remains in the recycle bin can vary.
•The objects in the recycle bin are restricted to query operations only (no DDL or DML).
•Flashback query operations must reference the recycle bin name.
•Tables and all dependent objects are placed into, recovered and purged from the recycle bin at the same time.
•Tables with Fine Grained Access policies aer not protected by the recycle bin.
•Partitioned index-organized tables are not protected by the recycle bin.
•The recycle bin does not preserve referential integrity.
댓글 없음:
댓글 쓰기