티스토리 뷰

DB

[Oracle] 커밋 후 데이터 복원 하는 방법

나뜨루다 2022. 10. 6. 12:57
728x90

커밋을 했지만 데이터를 복원해야할 경우 사용하는 방법 

SELECT * 
FROM 테이블명 AS OF TIMESTAMP(SYSTIMESTAMP-INTERVAL '15' MINUTE) -- 15분 
WHERE 조건

where절에 insert, update, delete에 사용했던 그대로 조건을 걸어주면 된다. 

-- 분 단위 
select *
  from 테이블명 as of timestamp(systimestamp-interval '10' minute) where..;

-- 시 단위 
select * 
  from 테이블명 as of timestamp(systimestamp-interval '1' hour) where..;

-- 일 단위 
select * 
  from 테이블명 as of timestamp(systimestamp-interval '1' day) where..;

 

 

 

 

출처: https://july7k.tistory.com/182 [Coding JOAH:티스토리]