Oracle用数据泵转移SCHEMA(不同版本数据库)

11g上创建测试数据

SYS@ prod> create tablespace testtbs datafile size 10m ;
 
Tablespace created.
 
SYS@ prod> create user testuser default tablespace testtbs identified by testuser ;
 
User created.
 
SYS@ prod> grant connect , resource to testuser ;
 
Grant succeeded.
 
SYS@ prod> grant all on directory dumpdir to testuser ;
 
Grant succeeded.
 
SYS@ prod> create table testuser.test as select * from scott.emp ;
 
Table created.

11g上导出:

[oracle@dbsvr1 ~]$ expdp testuser/testuser directory=dumpdir schemas=testuser dumpfile=tttt.dmp version=10.2.0.1

 

10g上创建用户:

SYS@ prod> create directory dumpdir as '/home/oracle/' ;
 
Directory created.
 
SYS@ prod> create user testuser identified by testuser ;
 
User created.
 
SYS@ prod> grant connect , resource to testuser ;
 
Grant succeeded.
 
SYS@ prod> grant all on directory dumpdir to testuser ;
 
Grant succeeded.


10g上导入:

[oracle@db10g ~]$ impdp testuser/testuser remap_tablespace=testtbs:users directory=dumpdir dumpfile=tttt.dmp

 

注意两点:

版本不同导出时加version参数。

如果表原来所在的表空间在新的数据库上不存在,需要remap_tablespace参数。格式是旧:新。

 

如果是从10g向11g导数据则不需要version参数。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值