您的位置:首页 > 数据库 > Oracle

Oracle之导入导出

2017-05-25 17:56 351 查看
模式介绍:

1.数据库模式:导入和导出整个数据库中的所有对象。

2.表空间模式:导入和导出一个或者多个指定的表空间中的所有对象。

3.用户模式:导入和导出一个用户模式中的所有对象。

4.表模式:导入和导出一个或者多个表或表分区。

注意:4中模式不能兼容,只能使用其中一种模式。

eg:exp system/123@orcl owner=scott tables=student file=c:\1.dmp log=c:\2.log

owner=scott tables=student 发生冲突

cmd -   help exp=y

导出表:

exp scott/123456@orcl tables=(emp,dept) file=c:\1.dmp log = c:\2.log(导出信息的日志文件)

导出scott用户的所有:

exp scott/123456@orcl owner=scott file=c:\1.dmp log = c:\2.log(导出信息的日志文件)

导入表:

imp scott/123@orcl tables=(student,emp) file=c:\1.dmp

imp scott/123@orcl  file=c:\1.dmp

imp scott/123@orcl  tables = student file=c:\1.dmp

导入别人的表:

exp scott/scott@orcl tables=(emp,dept) file=c:\1.dmp log = c:\2.log

imp scott/scott@orclfile=c:\1.dmp frouser=scott touser= user1;不可以

imp user1/user1@orcl file=c:\1.dmp
frouser=scott touser= user1; 可以

imp system/system@orcl file=c:\1.dmp
frouser=scott touser= user1; 可以

利用交互提示符:

cmd 

set orcl_sid=orcl

exp

回车

继续即可。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: