플래시백 로그

플래시백이란

  • 백업과 아카이브 로그를 이용한 Point In Time Recovery 를 보완하기 위해 등장한 방법
  • 특정한 이벤트에 대해 빠른 복구를 가능하게 함


기능 사용하려면

  • db_recovery_file_dest 가 지정되어 있어야 함
  • DB 는 아카이브 모드여야 함
  • flashback 모드를 Enable 시켜야 함

SQL> startup mount
ORACLE instance started.

Total System Global Area  238034944 bytes
Fixed Size                  2227136 bytes
Variable Size             180356160 bytes
Database Buffers           50331648 bytes
Redo Buffers                5120000 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> alter system set db_recovery_file_dest_size=1000M scope=both;

System altered.

SQL> alter system set db_recovery_file_dest='/app/oracle/fb_area' scope=both;

System altered.

SQL> alter database flashback on;

Database altered.

SQL>


사용


SQL> create table lim.fb_test as select level as c1 from dual connect by level <= 10;

Table created.

SQL> select systimestamp from dual;

SYSTIMESTAMP
---------------------------------------------------------------------------
13-OCT-14 04.52.38.823340 PM +09:00


SQL> truncate table fb_test;

Table truncated.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount

ORACLE instance started.

Total System Global Area  238034944 bytes
Fixed Size                  2227136 bytes
Variable Size             180356160 bytes
Database Buffers           50331648 bytes
Redo Buffers                5120000 bytes
Database mounted.
SQL> flashback database to timestamp to_timestamp('2014/10/13 16:52:38','yyyy/mm/dd hh24:mi:ss');

Flashback complete.

SQL> alter database open resetlogs;

Database altered.

SQL> select * from lim.fb_test;

        C1
----------
         1
         2
         3
         4
         5
         6
         7
         8
         9
        10

10 rows selected.

SQL>