Oracle数据泵导出导入(expdp/impdp)

一、创建表空间

create tablespace atp
logging
datafile 'D:\oracle\oradata\orcl\atp.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;

二、创建用户

-- Create the user
create user ATP
default tablespace ATP
temporary tablespace TEMP
profile DEFAULT
identified by atp;
-- Grant/Revoke role privileges
grant connect to ATP;
grant dba to ATP;
grant resource to ATP;
-- Grant/Revoke system privileges
grant create any view to ATP;
grant select any sequence to ATP;
grant select any table to ATP;
grant unlimited tablespace to ATP;

三、导出

1、创建逻辑目录,该命令不会在操作系统创建真正的目录,最好以system等管理员创建。
create directory expdp_dir as 'D:\home\Oracle\dump';
2、给scott用户赋予在指定目录的操作权限,最好以system等管理员赋予。
grant read,write on directory expdp_dir to scott;
3、在windows中创建目录“D:\home\Oracle\dump”
4、导出命令
1)按用户导出:expdp system/1@orcl directory=expdp_dir dumpfile=0526NETOBDC.dmp logfile=0526NETOBDC.log schemas=netobdc
2)按表名导出:expdp system/1@orcl directory=expdp_dir dumpfile=0526NETOBDC.dmp logfile=0526NETOBDC.log TABLES=emp,dept
3)导出整个数据库:expdp system/1@orcl directory=expdp_dir dumpfile=0526NETOBDC.dmp logfile=0526NETOBDC.log FULL=y

四、导入

1、创建逻辑目录,该命令不会在操作系统创建真正的目录,最好以system等管理员创建。
create directory impdp_dir as 'D:\home\Oracle\impdp_dir';
2、给scott用户赋予在指定目录的操作权限,最好以system等管理员赋予。
grant read,write on directory impdp_dir to scott;
3、在windows中创建目录“D:\home\Oracle\impdp_dir”然后将导出的dmp包拷贝到此目录下
4、导入命令
1)导入到指定用户下:impdp bdc_atp/bdc_atp@orcl directory=impdp_dir dumpfile=0526ATP.dmp logfile=0526ATP.log schemas=bdc_atp
2)导入到不同的用户下:impdp bdc_atp/bdc_atp@orcl directory=impdp_dir dumpfile=0526ATP.dmp logfile=0526ATP.log remap_schema=atp:bdc_atp
3)导入整个数据库:impdp bdc_atp/bdc_atp@orcl directory=impdp_dir dumpfile=0526ATP.dmp logfile=0526ATP.log FULL=y

转载于:https://www.cnblogs.com/Tandongmu/p/9111912.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值