expdp怎么导出分区表导出的某些分区

博客访问: 1709240
博文数量: 196
博客积分: 3409
博客等级: 中校
技术积分: 3848
注册时间:
认证徽章:
● ITPUB名人堂嘉宾
● ChinaUnix社区博客专家
● ChinaUnix社区Oracle板块版主
● 优酷网认证音乐牛人:EricGuitar
● SDOUG 核心成员
IT168企业级官微
微信号:IT168qiye
系统架构师大会
微信号:SACC2013
分类: Oracle
创建一个包含BLOB字段的分区表,并使用数据泵进行导出,查看该表是如何被导出的。
操作过程:
创建hash分区表,包含blob类型的字段,分两个分区,分别称为“part_1”和“part_2”,当然也可以指定更多的分区,在此次测试中,数据量和分区数不是我们主要关心的对象,因此只建2个分区。
SQL& create table wallpaper(id int,paper blob)
partition by hash(id)
(partition part_1,
partition part_2)
Table created.
插入数据,数据为事先上传到操作系统目录中的,并在数据库里把存放文件的目录设置为目录对象。
SQL& declare
for i in 1..6 loop
insert into wallpaper(id,paper)
values(i,empty_blob())
returning paper into l_
l_bfile :=bfilename('PAPERPATH',i||'.jpg');
dbms_lob.fileopen(l_bfile);
dbms_lob.loadfromfile(l_blob,l_bfile,dbms_lob.getlength(l_bfile));
dbms_lob.fileclose(l_bfile);
PL/SQL procedure successfully completed.
查看blob字段大小:
SQL& select id,dbms_lob.getlength(paper) blen from wallpaper;
---------- ----------
2 & &1254041
6 & & 514649
1 & &3043204
3 & & 191283
4 & & 127974
6 rows selected.
查看分区内信息分布:
SQL& select id from wallpaper partition(part_1);
----------
SQL& select id from wallpaper partition(part_2);
----------
[oracle@dbserver dmp]$ expdp eric/gao directory=DUMP_FILE_DIR dumpfile=eric_blob.dmp
Export: Release 11.2.0.1.0 - Production on Fri May 29 19:42:08 2015
Copyright (c) , Oracle and/or its affiliates. &All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "ERIC"."SYS_EXPORT_SCHEMA_01": &eric/******** directory=DUMP_FILE_DIR dumpfile=eric_blob.dmp&
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 6.312 MB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "ERIC"."WALLPAPER":"PART_2" & & & & & & & & 3.212 MB & & & 3 rows
. . exported "ERIC"."WALLPAPER":"PART_1" & & & & & & & & 1.744 MB & & & 3 rows
. . exported "ERIC"."MUSIC_EMP":"PART_1" & & & & & & & & 5.531 KB & & & 8 rows
. . exported "ERIC"."MUSIC_EMP":"PART_2" & & & & & & & & & 5.5 KB & & & 6 rows
. . exported "ERIC"."SUMMARY" & & & & & & & & & & & & & &5.539 KB & & & 4 rows
Master table "ERIC"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for ERIC.SYS_EXPORT_SCHEMA_01 is:
& /tmp/dmp/eric_blob.dmp
Job "ERIC"."SYS_EXPORT_SCHEMA_01" successfully completed at 19:43:05
我们可以看到有2个分区表都被按照分区单独导出了。因此,在数据量比较大的情况下,可以考虑使用分区表方案,需要确定使用何种类型的分区表以及索引。
阅读(1338) | 评论(0) | 转发(0) |
相关热门文章
给主人留下些什么吧!~~
请登录后评论。君,已阅读到文档的结尾了呢~~
如何导入和导出oracle的分区表数据
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
如何导入和导出Oracle的分区表数据
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer-4.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口Oracle(5)
测试环境:oracle Release 10.2.0.1.0 , 建分区数据oracle_sid=ascii ,  无分区数据库oracle_sid=ocp10g
1.在ascii数据库中建立3个tablespaces:tbs1,tbs2,tbs3;
SQL& create tablespace tbs1 datafile 'tbs1_data1' size 10M;
Tablespace created.
SQL& create tablespace tbs2 datafile 'tbs2_data1' size 10M;
Tablespace created.
SQL& create tablespace tbs3 datafile 'tbs3_data1' size 10M;
Tablespace created.
2.建立分区数据库表tbs_t:
SQL& create table tbs_t(a int ) partition by range(a)
  2  (
  3  partition tbs1 values less than (100),
  4  partition tbs2 values less than (200),
  5  partition tbs3 values less than (maxvalue));
Table created.
3.在tbs_t中插入数据commit后数据:
SQL& select * from tbs_t;
         A
----------
         1
         2
         3
       100
       101
       102
       103
       202
       402
       502
       602
11 rows selected.
4.使用expdp导出数据表tbs_t:
E:/tmp&expdp scott/tiger directory=dump_dest tables=tbs_t parallel=2
Export: Release 10.2.0.1.0 - Production on Wednesday, 20 April, :46
Copyright (c) , Oracle.  All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Starting &SCOTT&.&SYS_EXPORT_TABLE_01&:  scott/******** directory=dump_dest tables=tbs_t parallel=2
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 192 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported &SCOTT&.&TBS_T&:&TBS1&                      4.937 KB       3 rows
. . exported &SCOTT&.&TBS_T&:&TBS2&                      4.945 KB       4 rows
. . exported &SCOTT&.&TBS_T&:&TBS3&                      4.945 KB       4 rows
Master table &SCOTT&.&SYS_EXPORT_TABLE_01& successfully loaded/unloaded
******************************************************************************
Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:
  E:/TMP/EXPDAT.DMP
Job &SCOTT&.&SYS_EXPORT_TABLE_01& successfully completed at 16:41:55
5.将产生的”E:/TMP/EXPDAT.DMP”文件导入无分区数据库ocp10g;
SQL& select instance_name from v$
INSTANCE_NAME
----------------
SQL& select tablespace_name from dba_
TABLESPACE_NAME
------------------------------
UNDO_SMALL
10 rows selected.
E:/tmp&impdp scott/tiger dumpfile=expdat.dmp directory=dump_dest remap_tablespace=tbs1:usertbs remap_tablespace=tbs2:usertbs remap_tablespace=tbs3:usertbs
Import: Release 10.2.0.1.0 - Production on Wednesday, 20 April, :09
Copyright (c) , Oracle.  All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Master table &SCOTT&.&SYS_IMPORT_FULL_01& successfully loaded/unloaded
Starting &SCOTT&.&SYS_IMPORT_FULL_01&:  scott/******** dumpfile=expdat.dmp directory=dump_dest remap_tablespace=tbs1:usertbs remap_tablespace=tbs2:use
rtbs remap_tablespace=tbs3:usertbs
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported &SCOTT&.&TBS_T&:&TBS1&                      4.937 KB       3 rows
. . imported &SCOTT&.&TBS_T&:&TBS2&                      4.945 KB       4 rows
. . imported &SCOTT&.&TBS_T&:&TBS3&                      4.945 KB       4 rows
Job &SCOTT&.&SYS_IMPORT_FULL_01& successfully completed at 16:47:22
6.imp数据成功:
SQL& conn scott/tiger
Connected.
SQL& select * from tbs_t;
         A
----------
         1
         2
         3
       100
       101
       102
       103
       202
       402
       502
       602
11 rows selected.
注:此方法只能在impdp命令中使用,imp命令没有此选项及能不
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:66430次
排名:千里之外
原创:26篇
(5)(3)(5)(4)(3)(6)(1)}

我要回帖

更多关于 exp导出分区表 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信