在使用10g后的Oracle data pump导出数据时,我们可以使用flashback_scn参数指定导出的时间点,这时
oracle会使用flashback query查询导出scn时的数据,flashback query使用undo,无需打开flashback database功能。
也就是说,只要undo信息不被覆盖,即使数据库被重启,仍然可以进行基于flashback_scn的导出动作。
--以scott用户做测试
oracle@wang:/home/oracle$sqlplus scott/tiger;
SQL*Plus: Release 11.2.0.4.0 Production on Fri Mar 15 07:43:24 2019
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> show user;
USER is "SCOTT"
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
21870773 (记为1号时间点)
SQL> create table t (num number);
Table created.
SQL> insert into t values(1);
1 row created.
SQL> commit;
Commit complete.
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
21870796 (记为2号时间点)
SQL> insert into t values(2);
1 row created.
SQL> commit;
Commit complete.
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
21870805
SQL> conn / as sysdba
Connected.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
<