- flashback query : 특정 시점의 데이터의 상태를 조회하는 기능
- flashback table : 테이블 데이터를 특정 시점으로 복구
- flashback drop : 삭제된 테이블을 복구
- flashback version query : 특정 기간동안 데이터 변경내역 조회
- flashback transaction query : 트랜잭션 변경 내역과 관련 정보를 조회
- flashback database : 전체 데이터베이스를 특정 시점으로 복구
- flashback archive ( total recall ) : 데이터 베이스 내의 특정 테이블의 모든 변경이력을 책임지고 저장하는 기능
delete from emp;
commit;
-- 25/07/15 11:09:51.341000000 +09:00
select systimestamp from dual;
select *
from emp
as of timestamp to_timestamp('2025/07/15 11:05:00', 'RRRR/MM/DD HH24:MI:SS');
-- emp 테이블이 delete 되기 전의 데이터들이 있던 시간대를 조회해
-- emp_11_08 테이블 생성
create table emp_11_08
as
select *
from emp
as of timestamp to_timestamp('2025/07/15 11:05:00', 'RRRR/MM/DD HH24:MI:SS');
-- emp_11_08 테이블 조회
select * from emp_11_08;
-- delete 된 emp 테이블에 emp_11_08 테이블의 내용을 insert
insert into emp
select *
from emp_11_08;
-- emp 테이블 복구됨
select * from emp;
commit;
-- c##scott 테이블들을 분석하는 명령어
exec dbms_stats.gather_schema_stats('C##SCOTT');
create table table_list_11_21
as
select table_name, num_rows
from user_tables
where table_name in ('EMP', 'DEPT', 'SALGRADE','ORDERS','BONUS','EMP21','MARKET_2022');
select * from table_list_11_21;
delete from emp;
commit;
exec dbms_stats.gather_schema_stats('C##SCOTT');
select table_name, num_rows
from user_tables
where table_name in ('EMP', 'DEPT', 'SALGRADE','ORDERS','BONUS','EMP21','MARKET_2022');
insert into emp
select *
from emp_11_08;
commit;
select table_name, num_rows
from user_tables
where table_name in ('EMP', 'DEPT', 'SALGRADE','ORDERS','BONUS','EMP21','MARKET_2022');
delete from salgrade;
delete from emp21;
commit;
create table emp21_11_21
as
select *
from emp21
as of timestamp to_timestamp('2025/07/15 11:21:00', 'RRRR/MM/DD HH24:MI:SS');
select * from emp21_11_21;
insert into emp21
select *
from emp21_11_21;
select * from emp21;
commit;
-
create table sal_11_21
as
select *
from salgrade
as of timestamp to_timestamp('2025/07/15 11:21:00', 'RRRR/MM/DD HH24:MI:SS');
select * from sal_11_21;
insert into salgrade
select *
from sal_11_21;
select * from salgrade;
commit;
show parameter undo_retention