Linux 中 Oracle dmp 文件导入导出
对于本机安装了oracle 客户端,下述命令都可以在 dos 执行,当然 dmp 文件导出在本地。
但在实际研发时,没人愿意在本机上安装庞大的 oracle 软件,这时你需要使用 Xshell/puTTY..
远程工具连接到 Linux 进行操作,进行 Linux 上 dmp 文件的导入导出(以下导入导出路径替换为 Linux 路径)。
a. 将用户 system 用户表导出到指定路径 D 盘
exp system/password@SID file=d:/daochu.dmp full=y
b. 将用户 system 与 sys 用户的表导出到指定路径 D 盘
exp system/password@SID file=d:/daochu.dmp owner=(system,sys)
c. 将用户 system 中的表 table_A、table_B 导出到指定路径 D 盘
exp system/password@SID file= d:/daochu.dmp tables=(table_A,table_B)
d. 将用户 system 中的表 table1 中的字段 filed1 以"00"打头的数据导出
exp system/passwor@SID filed=d:/daochu.dmp tables=(table1) query=/" where filed1 like '00%'/"
对于压缩可以用 winzip 将 dmp 文件进行压缩,也可以在上面命令后面 加上 compress=y 来实现。
导出 DMP文件适用于大型数据库完整迁移,对迁移前后两者服务器数据库字符集要求一致,且对CLOB字段支持不太友好。
对于小数据的导出其实用 PLSQL 能做的更好,更快,导出的SQL也很直观。
e. 将 D:/daochu.dmp 中的数据导入 TEST 数据库中。
imp system/password@SID file=d:/daochu.dmp
imp system/password@HUST full=y file=d:/data/newsmgnt.dmp ignore=y
上面命令如果出现问题,假设有的表已存在,对该表可以不进行导入,后面添加 ignore=y。
f. 将 d:/daochu.dmp中的表table1 导入
imp system/passord@SID file=d:/daochu.dmp tables=(table1)
g.不同用户不同表空间的数据导入
impdp user2/pass2 directory=dumpdir dumpfile=user1.dmp remap_schema=user1:user2 remap_tablespace=user1:user2
1.remap_user 重新映射用户,格式:
source_user1:target_user1,source_user2:target_user2
2.remap_tablespace 重新映射表空间
remap_tablespace=tbs_a:tbs_b
3.remap_schema 重新映射数据归属用户
remap_schema=A:B
4.table_exists_action 表已经存在的动作 有效关键字: (SKIP), APPEND, REPLACE 和 TRUNCATE。
5.exclude=object_grant 跳过对象授权
相关文章
- linux开发常用命令
- Linux面试题(史上最全、持续更新、吐血推荐)
- 通过Backtrack Linux 来加强你的安全防御
- linux系统(CentOS7)虚拟机上安装oracle 11g,解决oracle图形界面卡住无法点击next问题
- Linux & Oracle 安装目录说明
- Linux命令之quota
- Oracle VM VirtualBox不能正常运行(电脑强行关机后,Linux不能正常运行)
- Linux 内核 启动时间
- Linux运维之——每日小技巧,使用awk命令截取每行的指定列数据
- Linux下启动/关闭Oracle
- 《Oracle高性能自动化运维》一一第1章 Linux下的Oracle
- 《Oracle高性能自动化运维》一一1.1 Linux简介
- Linux SVN直接删除版本库文件
- centos7安装mysql5.7.4(rpm安装版)与 MySQL5.7.4glibc版Linux安装
- 使用OCCI连接Linux下Oracle数据库
- 英语linux+英语firefox+英语Oracle OEM如何设置成显示日语
- 怎样手动的干净的删除linux上的ORACLE数据库
- Linux下Oracle的启动登陆命令、单实例启动、多实例启动
- 《Linux命令行与shell脚本编程大全 第3版》Linux命令行---35
- linux系统添加审计用户并进行权限控制