expdp/impdp

本文详细介绍了 Oracle 数据泵的各种操作方法,包括创建目录、给目录授权、不同模式下的数据导出(如用户模式、并行进程方式、表模式等)、查询条件模式下的数据导出、全库模式的数据导出,以及导入数据到目标数据库的不同方式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

创建目录                                                                                     
create directory dir as '/home/oracle/dir';                                                  
                                                                                             
给目录授权                                                                                   
grant read,write on directory dir to ydsr1011;                                               
                                                                                             
查看                                                                                         
select * from dba_directories;                                                               
-------------------------------------                                                        
源库导出数据                                                                                 
                                                                                             
用户模式                                                                                     
expdp scott/tiger@orcl schemas=ydsr1011 dumpfile=user.dmp directory=dir                      
                                                                                             
并行进程方式                                                                                 
expdp scott/tiger@orcl tables=emp,dept dumpfile=process.dmp directory=dir                    
                                                                                             
表模式                                                                                       
exedp scott/tiger@orcl directory=dir dumpfile=table.dmp tables=emp                           
                                                                                             
表空间模式                                                                                   
expdp system/oracle directory=dir dumpfile=tablespace.dmp tablespaces=temp,example           
                                                                                             
查询条件模式                                                                                 
expdp scott/tiger@orcl directory=dir dumpfile=select.dmp tables=emp querry='where deptno=20';
                                                                                             
全库模式                                                                                     
expdp system/oracle directory=dir dumpfile=full.dmp full=y                                   
                                                                                             
----------------------------------------------                                               
导入目标数据库                                                                               
                                                                                             
指定用户下                                                                                   
impdp scott/tiger directory=dir dumpfile=user.dmp schemas=scott;                             
                                                                                             
改变表owner                                                                                  
impdp system/oracle directory=dir dmpfile=table.dmp tables=scott.dept remap_schema=scott:syst
                                                                                             
表空间                                                                                       
impdp system/oracle DIRECTORY=dir DUMPFILE=tablespace.dmp TABLESPACES=example;               
                                                                                             
导入数据库                                                                                   
impdb system/oracle DIRECTORY=dir DUMPFILE=full.dmp FULL=y;                                  
                                                                                             
追加数据                                                                                     
impdp system/oracle DIRECTORY=1 DUMPFILE=expdp.dmp SCHEMAS=system TABLE_EXISTS_ACTION=append;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值