惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
小众软件
小众软件
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
博客园 - 三生石上(FineUI控件)
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
Microsoft Security Blog
Microsoft Security Blog
Y
Y Combinator Blog
A
About on SuperTechFans
The GitHub Blog
The GitHub Blog
U
Unit 42
H
Hackread – Cybersecurity News, Data Breaches, AI and More
云风的 BLOG
云风的 BLOG
IT之家
IT之家
MyScale Blog
MyScale Blog
V
Visual Studio Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
I
InfoQ
博客园 - 司徒正美

博客园 - lining

输出的客户端 - lining - 博客园 List<T> - lining - 博客园 DateTime 赋空值 配色达人速成 批处理文件,删除文件及文件夹 - lining - 博客园 Source Code中pfx的密码 查找所有有某一列的表 如何修改 app.config 的配置信息 用例的获得 如何oracle调试存储过程 C# 中String 和 string 有什么区别 ora-00997:非法使用LONG数据类型 oracle如何判断一个字符串是否为数字或日期 C# 中的计时器 populate a listbox on winform with values from database winform技巧,listbox绑定,value,text, - lining - 博客园 查看oracle执行计划 “Windows Workflow Foundation开发实战系列课程”中的数据库恢复 ASP.NET多语言版的开发
oracle数据导入导出imp/exp命令
lining · 2010-04-06 · via 博客园 - lining

oracle数据导入导出imp/exp就相当于oracle数据还原与备份。exp命令可以把数据从远程数据库服务器导出到本地的dmp文件,

imp命令可以把dmp文件从本地导入到远处的数据库服务器中。 利用这个功能可以构建两个相同的数据库,一个用来测试,一个用来正式使用。

执行环境:可以在sqlplus.exe或者dos(命令行)中执行,
dos中可以执行时由于 在oracle 8i 中  安装目录\ora81\bin被设置为全局路径,
该目录下有exp.exe与imp.exe文件被用来执行导入导出。
oracle用java编写,sqlplus.exe、exp.exe、imp.exe这两个文件有可能是被包装后的类文件。
sqlplus.exe 调用exp.exe、imp.exe所包裹的类,完成导入导出功能。

>>>>>>>>>>>>>>>>>>>>>>>>>>>>

数据导出:
1 将数据库test完全导出 用户名system 密码manager 导出到d:\daochu.dmp中
   exp system/manager test file=d:\daochu.dmp full=y


2 将数据库中system用户与sys用户的表导出
   exp system/manager test file=d:\daochu.dmp owner=(system sys)


3 将数据库中的表inner_notify、notify_staff_relat导出
     exp aichannel/aichannel testdb2 file= d:\data\newsmgnt.dmp tables=(inner_notify notify_staff_relat)

4 将数据库中的表table1中的字段filed1以" 00" 打头的数据导出
   exp system/manager test file=d:\daochu.dmp tables=(table1) query=\"  where filed1 like ' 00' \"


上面是常用的导出,对于压缩,既用winzip把dmp文件可以很好的压缩。
   也可以在上面命令后面 加上 compress=y 来实现。

>>>>>>>>>>>>>>>>>>>>>>>>>>>
数据的导入
1 将d:\daochu.dmp 中的数据导入 test数据库中。
   imp system/manager test  file=d:\daochu.dmp
   上面可能有点问题,因为有的表已经存在,然后它就报错,对该表就不进行导入。在后面加上 ignore=y 就可以了。

    imp aichannel/aichannel hust full=y  file=file= d:\data\newsmgnt.dmp ignore=y


2 将 d:\daochu.dmp中的表table1 导入
imp system/manager test  file=d:\daochu.dmp  tables=(table1)

(完)