千家信息网

基于flashback_scn的expdp导出方法是什么

发表于:2025-02-01 作者:千家信息网编辑
千家信息网最后更新 2025年02月01日,本篇内容介绍了"基于flashback_scn的expdp导出方法是什么"的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅
千家信息网最后更新 2025年02月01日基于flashback_scn的expdp导出方法是什么

本篇内容介绍了"基于flashback_scn的expdp导出方法是什么"的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

在使用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.

Total System Global Area 835104768 bytes

Fixed Size 2257840 bytes

Variable Size 549456976 bytes

Database Buffers 281018368 bytes

Redo Buffers 2371584 bytes

Database mounted.

Database opened.

SQL> select current_scn from v$database;

CURRENT_SCN

-----------

21871307 (记为3号时间点)

SQL> conn scott/tiger;

Connected.

SQL> insert into t values(3);

1 row created.

SQL> commit;

Commit complete.

SQL> select current_scn from v$database;

CURRENT_SCN

-----------

21871340 (记为4号时间点)

SQL> select * from t;

NUM

----------

1

2

3

--现在开始做expdp导出

(1号时间点)

expdp scott/tiger directory=DATA_PUMP_DIR dumpfile=t1.dmp tables=t flashback_scn=21870773

(2号时间点)

expdp scott/tiger directory=DATA_PUMP_DIR dumpfile=t2.dmp tables=t flashback_scn=21870796

(3号时间点)

expdp scott/tiger directory=DATA_PUMP_DIR dumpfile=t3.dmp tables=t flashback_scn=21871307

(4号时间点)

expdp scott/tiger directory=DATA_PUMP_DIR dumpfile=t4.dmp tables=t flashback_scn=21871340

oracle@wang:/home/oracle$ expdp scott/tiger directory=DATA_PUMP_DIR dumpfile=t1.dmp tables=t

flashback_scn=21870773

Export: Release 11.2.0.4.0 - Production on Fri Mar 15 07:52:18 2019

Copyright (c) 1982, 2011, Oracle and/or its affiliates. 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

Starting "SCOTT"."SYS_EXPORT_TABLE_01": scott/******** directory=DATA_PUMP_DIR dumpfile=t1.dmp tables=t flashback_scn=21870773

Estimate in progress using BLOCKS method...

Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

Total estimation using BLOCKS method: 64 KB

Processing object type TABLE_EXPORT/TABLE/TABLE

. . exported "SCOTT"."T" 4.984 KB 0 rows

Master table "SCOTT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded

******************************************************************************

Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:

/u01/app/oracle/admin/DBdb/dpdump/t1.dmp

Job "SCOTT"."SYS_EXPORT_TABLE_01" successfully completed at Fri Mar 15 07:52:28 2019 elapsed 0 00:00:08

oracle@wang:/home/oracle$ expdp scott/tiger directory=DATA_PUMP_DIR dumpfile=t2.dmp tables=t

flashback_scn=21870796

Export: Release 11.2.0.4.0 - Production on Fri Mar 15 07:52:34 2019

Copyright (c) 1982, 2011, Oracle and/or its affiliates. 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

Starting "SCOTT"."SYS_EXPORT_TABLE_01": scott/******** directory=DATA_PUMP_DIR dumpfile=t2.dmp tables=t flashback_scn=21870796

Estimate in progress using BLOCKS method...

Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

Total estimation using BLOCKS method: 64 KB

Processing object type TABLE_EXPORT/TABLE/TABLE

. . exported "SCOTT"."T" 5 KB 1 rows

Master table "SCOTT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded

******************************************************************************

Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:

/u01/app/oracle/admin/DBdb/dpdump/t2.dmp

Job "SCOTT"."SYS_EXPORT_TABLE_01" successfully completed at Fri Mar 15 07:52:44 2019 elapsed 0 00:00:07

oracle@wang:/home/oracle$ expdp scott/tiger directory=DATA_PUMP_DIR dumpfile=t3.dmp tables=t

flashback_scn=21871307

Export: Release 11.2.0.4.0 - Production on Fri Mar 15 07:52:54 2019

Copyright (c) 1982, 2011, Oracle and/or its affiliates. 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

Starting "SCOTT"."SYS_EXPORT_TABLE_01": scott/******** directory=DATA_PUMP_DIR dumpfile=t3.dmp tables=t flashback_scn=21871307

Estimate in progress using BLOCKS method...

Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

Total estimation using BLOCKS method: 64 KB

Processing object type TABLE_EXPORT/TABLE/TABLE

. . exported "SCOTT"."T" 5.007 KB 2 rows

Master table "SCOTT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded

******************************************************************************

Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:

/u01/app/oracle/admin/DBdb/dpdump/t3.dmp

Job "SCOTT"."SYS_EXPORT_TABLE_01" successfully completed at Fri Mar 15 07:53:03 2019 elapsed 0 00:00:07

oracle@wang:/home/oracle$ expdp scott/tiger directory=DATA_PUMP_DIR dumpfile=t4.dmp tables=t

flashback_scn=21871340

Export: Release 11.2.0.4.0 - Production on Fri Mar 15 07:53:12 2019

Copyright (c) 1982, 2011, Oracle and/or its affiliates. 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

Starting "SCOTT"."SYS_EXPORT_TABLE_01": scott/******** directory=DATA_PUMP_DIR dumpfile=t4.dmp tables=t flashback_scn=21871340

Estimate in progress using BLOCKS method...

Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

Total estimation using BLOCKS method: 64 KB

Processing object type TABLE_EXPORT/TABLE/TABLE

. . exported "SCOTT"."T" 5.015 KB 3 rows

Master table "SCOTT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded

******************************************************************************

Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:

/u01/app/oracle/admin/DBdb/dpdump/t4.dmp

Job "SCOTT"."SYS_EXPORT_TABLE_01" successfully completed at Fri Mar 15 07:53:22 2019 elapsed 0 00:00:07

oracle@wang:/home/oracle$

--现在开始做impdp导出

(1号时间点)

drop table t purge;

impdp scott/tiger directory=DATA_PUMP_DIR dumpfile=t1.dmp

(2号时间点)

drop table t purge;

impdp scott/tiger directory=DATA_PUMP_DIR dumpfile=t2.dmp

(3号时间点)

drop table t purge;

impdp scott/tiger directory=DATA_PUMP_DIR dumpfile=t3.dmp

(4号时间点)

drop table t purge;

impdp scott/tiger directory=DATA_PUMP_DIR dumpfile=t4.dmp

"基于flashback_scn的expdp导出方法是什么"的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注网站,小编将为大家输出更多高质量的实用文章!

时间 数据 方法 内容 更多 知识 实用 学有所成 接下来 也就是 也就是说 信息 功能 动作 参数 困境 实际 情况 数据库 文章 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 如何保障网络安全3000字 县委办网络技术干啥 江苏科技大学互联网 比赛 五大行的软件开发哪家更牛 软件开发功能模块与功能点 软件开发编码证据 湖南省学计算机软件开发培训机构 视频服务器部署方案 惠州手机软件开发哪家好 网络安全圈外企 网络安全和爱国精神 数据库使用说明书籍 强化网络安全意识加强 网络安全信息的主要特性 火绒安全服务器版 智慧路灯软件软件开发 现在都不学关系数据库了吗 老大让我当软件开发组长 安徽智慧城管软件开发电话 内存数据库tt 中国土壤数据库维修 农村电影院宣传网络安全课 网络技术与游戏的发展趋势 江苏中小学生网络安全知识竞赛 软件数据库的版本在哪里看 GBASE数据库的字段注释 java数据库用来做什么 为什么网络安全考试一考就过 版权局 计算机软件开发能力 电脑网络安全模式黑屏
0