'recover table'에 해당되는 글 1건

  1. 2016.03.06 RMAN recover table point in time

11g에선 Tablespace PITR만 가능했는데 12c에선 Table단위도 가능하게 되었다.

이를 간단히 테스트해본다.

 

1. 백업

$ rman target /

backup database;

 

2. 현재 시간 or scn 확인

SQL> select current_scn from v$database;

CURRENT_SCN
-----------
     665749


3. scott에서 emp, bonus truncate

$ sqlplus scott/tiger

SQL> truncate table emp;
SQL> truncate table bonus;

 

4. rman 에서 테이블 recover 실행

$ mkdir /oradata/aux

$ rman target /

recover table scott.emp, scott.bonus
until scn 665749
auxiliary destination '/oradata/aux'
remap table scott.emp:re_emp, scott.bonus:re_bonus;

※동일 명의 테이블이 있으면 에러나기 때문에 remap 해야함.

 

5. 확인 및 insert

$ sqlplus scott/tiger 

SQL> select * from re_emp;
SQL> select * from re_bonus;

SQL> insert into emp select * from re_emp;
SQL> insert into bonus select * from re_bonus;

Posted by neo-orcl
,