문서의 이전 판입니다!
$ sqlplus / as sysdba
SQL> select instance_name from v$instance;
SQL> show user
export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
SQL> alter user scott identified by oracle account unlock;
SQL> grant execute on dbms_flashback to scott;
sqlplus scott/oracle
SQL> select systimestamp from dual;
SQL> select dbms_flashback.get_system_change_number() from dual;
SQL> create table emp2 as select * from emp;
SQL> select count(*) from emp2;
SQL> delete from emp2;
SQL> select count(*) from emp2;
SQL> select count(*) from emp2 as of scn <scn_number>;
SQL> insert into emp2 select * from emp2 as of scn <scn_number>;
SQL> select systimestamp from dual;
SQL> select count(1) from emp2;
SQL> delete from emp2 where deptno=30;
SQL> commit;
SQL> select systimestamp from dual;
SQL> select count(*) from emp2;
SQL> select count(*) from emp2 as of timestamp(to_timestamp('2015-06-20 16:42:00','YYYY-MM-DD HH24:MI:SS'));
SQL> select count(*) from emp2 as of timestamp(to_timestamp('2015-06-20 16:42:00','YYYY-MM-DD HH24:MI:SS')) where deptno=30;
SQL> insert into emp2 as select * from emp2 as of timestamp(to_timestamp('2015-06-20 16:42:00','YYYY-MM-DD HH24:MI:SS')) where deptno=30;