전문가를 위한 오라클 데이터베이스 아키텍처 (2014년)
플래시백 로그 0 0 54,265

by 구루비스터디 플래시백 로그 flashback log [2018.09.27]


플래시백 로그

플래시백이란

  • 백업과 아카이브 로그를 이용한 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>


"데이터베이스 스터디모임" 에서 2014년에 "전문가를 위한 오라클 데이터베이스 아키텍처 " 도서를 스터디하면서 정리한 내용 입니다.

- 강좌 URL : http://www.gurubee.net/lecture/4006

- 구루비 강좌는 개인의 학습용으로만 사용 할 수 있으며, 다른 웹 페이지에 게재할 경우에는 출처를 꼭 밝혀 주시면 고맙겠습니다.~^^

- 구루비 강좌는 서비스 제공을 위한 목적이나, 학원 홍보, 수익을 얻기 위한 용도로 사용 할 수 없습니다.

댓글등록
SQL문을 포맷에 맞게(깔끔하게) 등록하려면 code() 버튼을 클릭하여 작성 하시면 됩니다.
로그인 사용자만 댓글을 작성 할 수 있습니다. 로그인, 회원가입