和普通法的本质的EXP有什么本质的区别么,现在数据泵好用么

Oracle 11G 用exp无法导出空表解决方法以及数据泵的使用_Oracle_第七城市
Oracle 11G 用exp无法导出空表解决方法以及数据泵的使用
一、&insert一行,再rollback就产生segment了。  该方法是在在空表中插入数据,再删除,则产生segment。导出时则可导出空表。二、&设置deferred_segment_creation 参数该参数值默认是TRUE,当改为FALSE时,无论是空表还是非空表,都分配segment。修改SQL语句:alter system set deferred_segment_creation=false scope=&  需注意的是:该值设置后对以前导入的空表不产生作用,仍不能导出,只能对后面新增的表产生作用。如需导出之前的空表,只能用第一种方法。三、&用以下这句查找空表  select 'alter table '||table_name||'' from user_tables where num_rows=0;  把查询结果导出,执行导出的语句,强行修改segment值,然后再导出即可导出空表,注意:数据库插入数据前,修改11g_R2参数可以导出空表查找空表select 'alter table '||table_name||'' from user_tables where num_rows=0&四、&oracle10g以上版本的expdp和impdp工具,用此工具也可以导出空的表&oracle expdp/impdp 用法详解1)&创建逻辑目录,该命令不会在操作系统创建真正的目录,最好以system等管理员创建。create directory db_bak as 'd:/test/dump';&2)&查看管理理员目录(同时查看操作系统是否存在,因为Oracle并不关心该目录是否存在,如果不存在,则出错)select * from dba_&3)&给system用户赋予在指定目录的操作权限,最好以system等管理员赋予。grant read,write on directory db_&4)&导出数据l&按用户导expdp system/manager@orcl schemas=system dumpfile=expdp.dmp DIRECTORY=db_bak l&并行进程parallelexpdp system/manager@orcl directory=db_bak dumpfile=system3.dmp parallel=40 job_name=system3l&按表名导expdp system/manager@orcl TABLES=emp,dept dumpfile=expdp.dmp DIRECTORY=db_l&按查询条件导expdp system/manager@orcl directory=db_bak dumpfile=expdp.dmp Tables=emp query='WHERE deptno=20';l&按表空间导expdp system/manager DIRECTORY=db_bak DUMPFILE=tablespace.dmp TABLESPACES=temp,l&导整个数据库expdp system/mtmadmin DIRECTORY=db_bak DUMPFILE=full.dmp FULL=y&5)&五、还原数据l&1)导到指定用户下impdp system/manager DIRECTORY=db_bak DUMPFILE=expdp.dmp SCHEMAS=l&2)改变表的ownerimpdp system/manager DIRECTORY=db_bak DUMPFILE=expdp.dmp TABLES=system.dept REMAP_SCHEMA=system:l&3)导入表空间impdp system/manager DIRECTORY=db_bak DUMPFILE=tablespace.dmp TABLESPACES=l&4)导入数据库impdb system/mtmadmin DIRECTORY=db_bak DUMPFILE=full.dmp FULL=y;l&5)追加数据impdp system/manager DIRECTORY=db_bak DUMPFILE=expdp.dmp SCHEMAS=system TABLE_EXISTS_ACTION=&&&
<a title="【BootStrap】【BootStrap】&meta http-eq
最新教程周点击榜
微信扫一扫温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
阅读(8360)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
在LOFTER的更多文章
loftPermalink:'',
id:'fks_094069',
blogTitle:'使用数据泵导出导入数据小结',
blogAbstract:'1、连接Oracle数据库SQL& conn / as sysdba已连接。2、创建一个操作目录SQL& create directory dump_dir as ‘/u01/dp\';3、注意同时需要使用操作系统命令在硬盘上创建这个物理目录,使用以下命令创建一个导出文件目录&[oracle@rhel4 u01]mkdir dp4、对导出文件目录授予读写权限SQL& grant read on directory dump_SQL& grant write on directory dump_4、使用命令expdp导出数据[oracle@rhel4 u01]$expdp scott/tiger',
blogTag:'',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:0,
publishTime:6,
permalink:'blog/static/',
commentCount:0,
mainCommentCount:0,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'',
hmcon:'0',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}VFP简答题_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
上传于||暂无简介
阅读已结束,如果下载本文需要使用1下载券
想免费下载本文?
定制HR最喜欢的简历
下载文档到电脑,查找使用更方便
还剩2页未读,继续阅读
定制HR最喜欢的简历
你可能喜欢数据泵和数据库备份_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
数据泵和数据库备份
上传于||暂无简介
你可能喜欢博客访问: 8654036
博文数量: 2744
注册时间:
ITPUB论坛APP
ITPUB论坛APP
APP发帖 享双倍积分
IT168企业级官微
微信号:IT168qiye
系统架构师大会
微信号:SACC2013
分类: Linux
数据泵在10g刚推出的时候,跨版本的问题并不明显,而等到11.2推出之后,数据泵同样存在处理跨版本的问题。
Oracle原始的EXP/IMP导出、导入工具的扩版本特性对于从8/9版本就接触数据库的人来说,应该是基本常识了——低版本导出,目标版本导入。
而对于数据泵来说,很多人并没有意识到这一点,事实上数据泵如果从低版本导出,高版本导入是不需要额外处理的,而大多数的需求不是版本相同,就是版本升级,因此很多人没有注意到数据泵的版本问题。
不过如果数据泵从高版本导入大低版本,如果不加处理,就会出现下面的错误:
[orat1@hpserver2 ~]$ expdp
test/test dumpfile=d_tmp:tab1.dp tables=tab1
Export: Release 11.2.0.3.0 -
Production on Mon Apr 27 09:50:10 2012
Copyright (c) , Oracle
and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g
Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "TEST"."SYS_EXPORT_TABLE_01": test/********
dumpfile=d_tmp:tab1.dp tables=tab1
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/STATISTICS/TABLE_STATISTICS
. . exported "TEST"."TAB1" 6.593 KB 63 rows
Master table "TEST"."SYS_EXPORT_TABLE_01" successfully
loaded/unloaded
******************************************************************************
Dump file set for TEST.SYS_EXPORT_TABLE_01 is:
/tmp/tab1.dp
Job "TEST"."SYS_EXPORT_TABLE_01" successfully completed at
11.2导入的文件,10.2直接导入报错:
[orat3@hpserver2 ~]$ impdp
test/test directory=d_tmp dumpfile=tab1.dp
Import: Release 10.2.0.4.0 - 64bit
Production on Monday,27 April, :25
Copyright (c) , Oracle.
All rights reserved.
Connected to: Oracle Database 10g
Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-39142: incompatible version number 3.1 in dump file
"/tmp/tab1.dp"
正确的方式是在高版本导出的时候指定导出的版本,比如导入版本为10204,那么在11.2上导出时通过VERSION=10.2.0.4,确保导出的数据和结构和低版本兼容。
[orat1@hpserver2 ~]$ expdp
test/test dumpfile=d_tmp:tab110204.dp tables=tab1 version=10.2.0.4
Export: Release 11.2.0.3.0 -
Production on Mon Apr 27 09:52:03 2012
Copyright (c) , Oracle
and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g
Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "TEST"."SYS_EXPORT_TABLE_01": test/********
dumpfile=d_tmp:tab110204.dp tables=tab1 version=10.2.0.4
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/STATISTICS/TABLE_STATISTICS
. . exported "TEST"."TAB1" 6.406 KB 63 rows
Master table "TEST"."SYS_EXPORT_TABLE_01" successfully
loaded/unloaded
******************************************************************************
Dump file set for TEST.SYS_EXPORT_TABLE_01 is:
/tmp/tab110204.dp
Job "TEST"."SYS_EXPORT_TABLE_01" successfully completed at
这样在10.2.0.4数据库上就可以直接导入了。
[orat3@hpserver2 ~]$ impdp
test/test directory=d_tmp dumpfile=tab110204.dp
Import: Release 10.2.0.4.0 - 64bit
Production on Monday, 27 April, :35
Copyright (c) , Oracle.
All rights reserved.
Connected to: Oracle Database 10g
Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "TEST"."SYS_IMPORT_FULL_01" successfully
loaded/unloaded
Starting "TEST"."SYS_IMPORT_FULL_01": test/********
directory=d_tmp dumpfile=tab110204.dp
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported "TEST"."TAB1" 6.406 KB 63 rows
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "TEST"."SYS_IMPORT_FULL_01" successfully completed at
阅读(5333) | 评论(0) | 转发(0) |
相关热门文章
给主人留下些什么吧!~~
请登录后评论。

我要回帖

更多关于 exp与expdp的区别 的文章

 

随机推荐