51Testing软件测试论坛

标题: oracle导入导出笔记 [打印本页]

作者: xieweiguo11    时间: 2010-8-25 17:47
标题: oracle导入导出笔记
1、 导出包括:导出表、导出方案、导出数据库:导出使用exp命了来完成。
a) 导出表:使用命令提示符:
i. 导出自己的表
导出表必须要进入到oracle目录/bin目录 cd d;
Cd oracle\fsak\ff
Exp userid=scott/tiger@myoral tables=(emp,dept) file=d:\e1.dmp;
ii. 导出其他方案的表
需要dba的权限。
Exp userid=system/maager@myoral tables(scott.emp)file=d:\e2.mp
iii. 使用直接导出方式:速度比较快
Exp userid=system/manager@myoral tables(scoot.emp) file=d:\e5.dmp rows=n  driect=y
   
iv. 导出表的结构
Exp userid=scott/tiger@myoral tables(emp)file=d:\e3.dmp rows=n
b) 导出方案:
i. 导出自己的方案
Exp scoot/tiger@myoral owner=scott file=d:\scoot.dmp
ii. 导出其他方案
导出方案:需要exp_full_database权限,system可以导出任何方案
Exp system/manager@myoral owner=(system,scott)file=d:\system.dmp
c) 导出数据库:需要exp_full_database权限
Exp userid=system/manager@myoral full=y inctype=complete file=x.dmp;
Inctype是否增量备份:complete
2、 导入数据库:导入表、导入方案、导入数据库
选项如下:
Userid:咏仪制定执行导入操作的用户名,口令,连接字符串
Tables:用户至此那个执行导入操作的表
Formuser:用于指定源用户
Touser:用于指定目标用户
File:用于指定导入文件名
Full=y用于指定执行导入整个文件
Inctype:用于指定执行导入操作的增量类型
Rows:指定是否要导入表行
Ignore:如果表存在,则只导入数据
a) 导入表:
i. 导入自己的表
Imp userid=scott/tiger@myoral tables=(emp) file=d:\emp.dmp
ii. 导入表到其他用户
Imp userid=system/manager@myoral tables=(emp) file=d:\xx.dmp touser=scott
iii. 导入表结构
Imp userid=scott/tiger@myoral tables=(emp) file=d:\xxx.dmp rows=n
iv. 导入数据
Imp userid=scott/tiger@myoral tables=(emp) file=d:\xxx.dmp ignore=y
b) 导入方案
i. 导入自身的方案
imp userid=scott/tiger file=d:\xxx.dmp;
ii. 导入其他方案
Imp userid =system/manager file=d:\\xxx.dmp fromuser=system touser=scoot
c) 导入整个数据库
Imp userid=system/manager ffull=y file=d:\xx.dmp;
作者: 楠族开心果    时间: 2010-8-25 18:39
看的有点晕。。慢慢研究吧
作者: liuwj85    时间: 2010-8-31 14:22
同意楼上的,有点晕,比较低级还是用菜单导入导出……




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2