본문 바로가기
스터디북

[10/14] 실습 - 3 FBDA

by 파이어볼러 2015. 10. 14.

======================================

Flashback Data Archive

=====================================


[root@lnx04 ~]# mkdir -p /u02/app/oracle/oradata/orcl

[root@lnx04 ~]# chown -R oracle.oinstall /u02



SYS@orcl>create tablespace fbda1

  2  datafile '/u02/app/oracle/oradata/orcl/fbda101a.dbf' size 11256k

  3  autoextend on next 10m maxsize unlimited

  4  ,'/u02/app/oracle/oradata/orcl/fbda101b.dbf' size 11256k

  5  autoextend on next 10m maxsize unlimited;


Tablespace created.


SYS@orcl>create tablespace fbda2

  2  datafile '/u02/app/oracle/oradata/orcl/fbda201a.dbf' size 11256k

  3  autoextend on next 10m maxsize unlimited,

  4  '/u02/app/oracle/oradata/orcl/fbda201.b.dbf' size 11256k

  5  autoextend on next 10m maxsize unlimited;


Tablespace created.


SYS@orcl>create user fbdauser
  2  identified by oracle
  3  default tablespace fbda1
  4  quota unlimited on fbda1
  5  quota unlimited on fbda2;

User created.

SYS@orcl>grant connect, resource, flashback archive administer to fbdauser;

Grant succeeded.

SYS@orcl>grant alter any table to fbdauser;

Grant succeeded.

SYS@orcl>conn fbdauser/oracle@orcl
Connected.
FBDAUSER@orcl>create flashback archive flal tablespace fbda1
  2  quota 1g retention 5 year;

Flashback archive created.

FBDAUSER@orcl>conn sys/oracle@orcl as sysdba


SYS@orcl>create flashback archive default fla2
  2  tablespace fbda1
  3  quota 1g
  4  retention 2 year;

Flashback archive created.

FBDAUSER@orcl>grant flashback archive
  2  on flal to hr;

Grant succeeded.

FBDAUSER@orcl>grant flashback archive on FLA2 to hr;


Grant succeeded.


FBDAUSER@orcl>conn hr/hr@orcl

Connected.

HR@orcl>alter table hr.employees flashback archive flal ;


Table altered.


HR@orcl>alter table hr.departments

  2  flashback archive ;


Table altered.


HR@orcl>!ps -ef | grep fbda | grep -v grep

oracle   30574     1  0 12:39 ?        00:00:00 ora_fbda_orcl


FBDAUSER@orcl>alter table hr.employees no flashback archive;

Table altered.