【练习】数据移动---parfile导出表中指定行:
要求:
①创建存放数据的文件;
②使用默认的bad文件生成方式;
③使用truncate选项方式。
1.准备条件:
[oracle@host03 ~]$ mkdir datadump
[oracle@host03 ~]$ ls
base.ctl base_data.bad base_data.dat base.log datadump
[oracle@host03 ~]$ cd datadump/
[oracle@host03 datadump]$ pwd
/home/oracle/datadump
[oracle@host03 datadump]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Tue Dec 13 22:15:05 2016 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 22:16:41 SYS@ORA11GR2>create or replace directory dir_dp as '/home/oracle/datadump'; Directory created. 22:22:30 SYS@ORA11GR2>grant read,write on directory dir_dp to scott; Grant succeeded. 22:22:59 SYS@ORA11GR2>exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@host03 datadump]$
2.导出指定表中的指定行:
[oracle@host03 datadump]$ expdp scott/tiger directory=dir_dp dumpfile=emp30.dmp tables=emp query="'where deptno=30'"; Export: Release 11.2.0.4.0 - Production on Tue Dec 13 22:26:51 2016 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=dir_dp dumpfile=emp30.dmp tables=emp query='where deptno=30'
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
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "SCOTT"."EMP" 8.25 KB 6 rows
Master table "SCOTT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:
/home/oracle/datadump/emp30.dmp
Job "SCOTT"."SYS_EXPORT_TABLE_01" successfully completed at Tue Dec 13 22:27:32 2016 elapsed 0 00:00:33 [oracle@host03 datadump]$ ls
emp30.dmp export.log--->如果没有指定生成log,会默认生成,下次会覆盖
3.parfile导出表中指定行:
[oracle@host03 datadump]$ vi par.txt userid=scott/tiger
directory=dir_dp
dumpfile=emp30_2.dmp
logfile=emp30_2.log
tables=emp
query='where deptno=30' [oracle@host03 datadump]$ expdp parfile=par.txt Export: Release 11.2.0.4.0 - Production on Tue Dec 13 22:36:52 2016 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/******** parfile=par.txt
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
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "SCOTT"."EMP" 8.25 KB 6 rows
Master table "SCOTT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:
/home/oracle/datadump/emp30_2.dmp
Job "SCOTT"."SYS_EXPORT_TABLE_01" successfully completed at Tue Dec 13 22:37:09 2016 elapsed 0 00:00:14
4.查看:
[oracle@host03 datadump]$ ls
emp30_2.dmp emp30_2.log emp30.dmp export.log par.txt
【练习】数据移动---parfile导出表中指定行:的更多相关文章
- mssql sqlserver 禁止删除数据表中指定行数据(转自:http://www.maomao365.com/?p=5323)
转自:http://www.maomao365.com/?p=5323 摘要:下文主要讲述,如何禁止删除数据表中指定行数据 最近收到用户一个需求,禁止所有人删除”表A”中,ID 为1.2.3.4.5的 ...
- Oracle生成查询包括对应于所有数据表记录语句中指定的字段名
应用:已知的字段名,表中的所有数据的查询数据库中包含的所有数据表的字段名 操作方法:指定字段名,用户数据库表,它可以执行以下查询 --Oracle生成查询包括对应于所有数据表记录语句中指定的字段名 d ...
- 设置listContrl中指定行的颜色
在MFC中 自己通过手动拖放CListCtrl控件来制作自己的表格: 目的: 将指定item的行更该颜色: 步骤: 1,在窗口中拖放CListCtrl控件, 单击右键 创建控件对象: CListCtr ...
- python 删除文件中指定行
代码适用情况:xml文件,循环出现某几行,根据这几行中的某个字段删掉这几行这段代码的作用删除jenkins中config.xml中在自动生成pipline报错的时的回滚 start = '<se ...
- 【linux】打印字符串中指定行
只打印第10行 关键在于当行数小于10时不输出. 用 head tail的关键问题是当行数小于10的时候用 head -n 10 只会打出前面的行,再用tail就错了. 所以要知道源文件一共有多少行. ...
- Delphi 快速读取TXT 指定行的数据
http://blog.csdn.net/MichaelJScofield/article/details/41869785 Delphi 快速读取TXT 指定行的数据 分类:Delphi个人挫品 ( ...
- 用JavaScript,获取Table中指定的行、列
前言: 先要谢谢George Wing的慷慨赠书<悟透JavaScript>,让我更加感受到了技术交流的重要性,呵呵~ 进入正题,面试题中有一题:如何通过JavaScript获取Table ...
- 读取memo中某行内容
方法1 可用以下代码读取Memo中指定行的内容: var aLine:String; begin aLine:=Memo1.Lines[2]; end; 在使用中,读取的行在Memo中需要保证 ...
- bat如何提取文本指定行的内容
背景:使用CTS框架运行完测试后,会在logs中生成devices_log和host_log,在results中生成相应的结果(报告).根据报告信息我们可以得知失败的用例,但是却不能知道为什么用例会失 ...
随机推荐
- Python开发入门与实战7-Django Form
7. Django Form 7.1. Form表单 Django带有一个form库,称为django.forms,这个库可以处理上一章提到的包括HTML表单的自动生成以及数据验证. 我们在inven ...
- tinymce 编辑器 上传图片
tinymce编辑器进行本地图片上传 首先下载tinymce.js之后 在form中添加一个<textarea>元素 给其一个id和name 然后就可以初始化编辑器了 tinymce.in ...
- 北大poj-1062
昂贵的聘礼 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 43523 Accepted: 12760 Descripti ...
- javascript之小积累-.-typeof与instanceof的区别
1.typeof 是获取一个变量或表达式的类型,返回的值通常是string, number, boolean, object(null, 数组, 对象), function, undefined,可以 ...
- 制作.frameWork的最全最真实的解决办法
这个制作流程 本博主 已经完全测试成功 我这边 制作的.frameWork 要接入游戏 我们游戏已经上架 所以这个东西完全可以用 http://www.cocoachina.com/bbs/read. ...
- UWP/Win10新特性系列—UserConsentVerifier
在UWP开发中,微软提供了新的用户许可验证方式-指纹(生物识别).Pin.密码验证.在爆料的新型Win10 Mobile移动设备中,会增加虹膜识别等先进的用户身份识别技术,微软现在统一了身份验证的AP ...
- HDU 4777 Rabbit Kingdom (2013杭州赛区1008题,预处理,树状数组)
Rabbit Kingdom Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)To ...
- html元素中id和name的区别
可以说几乎每个做过Web开发的人都问过,到底元素的ID和Name有什么区别阿?为什么有了ID还要有Name呢?! 而同样我们也可以得到最classical的答案:ID就像是一个人的身份证号码,而Nam ...
- 移动互联网实战--Web Restful API设计和基础架构
前言: 在移动互联网的大潮中, Web Restful API逐渐成为Web Server重要的一个分支. 移动端和服务端的交互, 主流的方式还是通过Http协议的形式来进行. 请求以Get/Post ...
- iOS下UITableView的单元格重用逻辑
终于有时间继续UITableView的接口调用顺序这篇文章了,之前测试过,模拟器都是按照height,cellForRow这样的顺序调用接口的,iOS8以前一直是这样,但是到了iOS8,这个顺序倒过来 ...