180329 FLASHBACK DB 실습 1 (환경설정)
[oracle@localhost ORCL]$ cd flashback
[oracle@localhost flashback]$ ls
o1_mf_fcrysm57_.flb
[oracle@localhost flashback]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Mar 29 14:39:24 2018
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
SYS@orcl>show parameter db_recovery
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /u01/app/oracle/flash_recovery
_area
db_recovery_file_dest_size big integer 10G
SYS@orcl>show parameter db_flashback;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_flashback_retention_target integer 1440 (1440분하루치) alter system set 으로 수정할 수 있다.
ALTER SYSTEM SET db_flashback_retention_target = 2880 SCOPE=BOTH
SYS@orcl>select scn_to_timestamp(1863728) from dual; < EM에서 Lowest SCN in the flashback data 번호를 가져와서 실행하면
되돌릴 수 있는 과거 시간을 보여준다.(시간을 scn으로 저장)
SCN_TO_TIMESTAMP(1863728)
---------------------------------------------------------------------------
29-MAR-18 02.35.43.000000000 PM
현재를 보려면
SYS@orcl>select current_scn from v$database;
CURRENT_SCN
-----------
1864867
SYS@orcl>/
CURRENT_SCN ( 시간이 지날 수록 숫자가 올라간다 System Change Number인듯)
-----------
1864871
설정 완료!