iis服务器助手广告广告
返回顶部
首页 > 资讯 > 数据库 >基于flashback_scn的expdp导出方法是什么
  • 772
分享到

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

2024-04-02 19:04:59 772人浏览 薄情痞子
摘要

本篇内容介绍了“基于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导出方法是什么”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注编程网网站,小编将为大家输出更多高质量的实用文章!

您可能感兴趣的文档:

--结束END--

本文标题: 基于flashback_scn的expdp导出方法是什么

本文链接: https://www.lsjlt.com/news/64156.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • 基于flashback_scn的expdp导出方法是什么
    本篇内容介绍了“基于flashback_scn的expdp导出方法是什么”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能...
    99+
    2024-04-02
  • 数据库中expdp远程network_link导出的方法是什么
    这篇文章主要讲解了“数据库中expdp远程network_link导出的方法是什么”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“数据库中expdp远程net...
    99+
    2024-04-02
  • Oracle expdp导出时的并行度设置方法是什么
    本篇内容介绍了“Oracle expdp导出时的并行度设置方法是什么”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学...
    99+
    2024-04-02
  • 怎么确定一个dmp文件是exp导出的还是expdp导出的
    这篇文章给大家分享的是有关怎么确定一个dmp文件是exp导出的还是expdp导出的的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。DBMS_DATAPUMP.GET_DUMPFIL...
    99+
    2024-04-02
  • MySQL导出表的方法是什么
    MySQL导出表的方法有以下几种:1. 使用SELECT INTO OUTFILE语句导出表数据到文件中:```SE...
    99+
    2023-10-12
    MySQL
  • eclipse导出apk的方法是什么
    在Eclipse中导出APK文件的方法如下:1. 打开Eclipse,并选择要导出APK文件的工程。2. 在Eclipse工具栏上选...
    99+
    2023-08-25
    eclipse
  • oracle导出mongodb的方法是什么
    Oracle不直接支持导出数据到MongoDB,因为它们是不同类型的数据库。但是你可以使用一些中间工具来实现将Oracle数据导出到...
    99+
    2023-09-12
    oracle mongodb
  • plsql数据导出导入的方法是什么
    在PL/SQL中,可以使用以下方法导出和导入数据: 使用Oracle Data Pump工具进行导出和导入数据。Oracle D...
    99+
    2024-04-09
    plsql
  • Javascript模块导入导出的方法是什么
    这篇“Javascript模块导入导出的方法是什么”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“Javascript模块导入...
    99+
    2023-07-04
  • plsql导出数据的方法是什么
    在PL/SQL中,有多种方法可以导出数据,包括使用游标、存储过程、查询和使用工具等。以下是几种常用的导出数据的方法: 使用游标:...
    99+
    2024-04-09
    plsql
  • pycharm导出文件的方法是什么
    PyCharm导出文件的方法有以下几种:1. 使用快捷键:可以使用快捷键(如Ctrl + S)来保存当前编辑的文件。这将把文件保存到...
    99+
    2023-09-29
    pycharm
  • Mysql数据导出的方法是什么
    MySQL数据导出的方法主要有以下几种: 使用命令行工具导出:可以使用mysqldump命令,在命令行中执行类似于以下的命令: ...
    99+
    2023-10-26
    Mysql
  • Python django导出excel的方法是什么
    这篇文章主要讲解了“Python django导出excel的方法是什么”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Python django导出excel的方法是什么”吧!一、基础环境w...
    99+
    2023-06-25
  • plsql导出视图的方法是什么
    在PL/SQL中,可以使用以下方法导出视图:1. 使用CREATE VIEW语句创建视图。在PL/SQL中,可以使用CREATE V...
    99+
    2023-09-18
    plsql
  • SQL报表导出的方法是什么
    SQL报表导出的方法有多种,可以根据具体需求选择适合的方法,常见的方法包括:1. 使用数据库工具:常见的数据库工具如MySQL Wo...
    99+
    2023-09-15
    SQL
  • Hive数据导出的方法是什么
    这篇文章主要介绍“Hive数据导出的方法是什么”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“Hive数据导出的方法是什么”文章能帮助大家解决问题。一、数据导出是什么hive是一个依赖Hadoop集群...
    99+
    2023-07-06
  • redis导出到excel的方法是什么
    Redis是一个内存数据库,不直接支持将数据导出到Excel。但是可以通过编写脚本或使用第三方工具将数据从Redis导出到Excel...
    99+
    2023-09-11
    redis
  • plsql全库导出的方法是什么
    在PL/SQL中,有几种不同的方法可以用于导出整个数据库。 使用Oracle Data Pump实用程序:Oracle Data...
    99+
    2024-02-29
    plsql
  • oracle导出视图的方法是什么
    要导出Oracle数据库中的视图,可以使用Oracle SQL开发工具,如SQL Developer或者通过命令行工具,如expdp...
    99+
    2024-04-09
    oracle
  • prometheus数据导出的方法是什么
    Prometheus数据可以通过多种方式导出,其中最常见的方法包括: 使用PromQL查询语言从Prometheus服务器查询数据...
    99+
    2024-03-12
    Prometheus
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作