首页 > 数据库技术 > 详细

oracle-11G转10G

时间:2021-02-24 23:14:30      阅读:42      评论:0      收藏:0      [点我收藏+]

先查询directory的地址 导出的文件必须放在此目录
select * from dba_directories;
找到directory_name的值 ,也可以新建一个
create directory test as ‘f:\test‘


11g 导出语句:EXPDP USERID=‘facial/facial@orcl‘ schemas=facial directory=test dumpfile=aa.dmp logfile=aa.log version=10.2.0.1.0
10g 导入语句:IMPDP USERID=‘facial/facial@orcl‘ schemas=facial directory=test dumpfile=aa.dmp logfile=aa.log version=10.2.0.1.0

EXPDP USERID=‘facial/facial@orcl‘ schemas=facial directory=TEST dumpfile=20150306.dmp logfile=20150306.log version=10.2.0.1.0 EXCLUDE=TABLE:\"IN(‘XT_LOG‘,‘PM_FILE‘)\"
IMPDP USERID=‘facial/facial@orcl‘ REMAP_SCHEMA=zyws:zyws REMAP_TABLESPACE=users:users directory=TEST dumpfile=20150409.DMP logfile=20150409.log

IMPDP USERID=‘AGY_QD/sdjxd@orcl‘ REMAP_SCHEMA=QD:QD REMAP_TABLESPACE=INSIDE:INSIDE directory=TEST dumpfile=20150409.DMP logfile=20150410.log exclude=TRIGGER


一、数据导出(exp.exe)
1、将数据库orcl完全导出,用户名system,密码accp,导出到d:\daochu.dmp文件中
exp system/accp@orcl file=d:\daochu.dmp full=y

2、将数据库orcl中scott用户的对象导出
exp scott/accp@orcl file=d:\daochu.dmp owner=(scott)

3、将数据库orcl中的scott用户的表emp、dept导出
exp scott/accp@orcl file= d:\daochu.dmp tables=(emp,dept)

4、将数据库orcl中的表空间testSpace导出
exp system/accp@orcl file=d:\daochu.dmp tablespaces=(testSpace)

二、数据导入(imp.exe)
1、将d:\daochu.dmp 中的数据导入 orcl数据库中。
imp system/accp@orcl file=d:\daochu.dmp full=y

2、如果导入时,数据表已经存在,将报错,对该表不会进行导入;加上ignore=y即可,表示忽略现有表,在现有表上追加记录。
imp scott/accp@orcl file=d:\daochu.dmp full=y ignore=y

3、将d:\daochu.dmp中的表emp导入
imp scott/accp@orcl file=d:\daochu.dmp tables=(emp)

三、注意
1、导入语句中加入transform=segment_attributes:n参数。该参数可与忽略expdp导出时附带的相关表空间和存储子句约束。
2、IGNORE=Y oracle导入数据库时忽略错误继续执行下去

3、将d:\daochu.dmp中的表emp导入
imp scott/accp@orcl file=d:\daochu.dmp tables=(emp)

oracle-11G转10G

原文:https://www.cnblogs.com/xiufengd/p/14443161.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!