Oracle之导入导出

来源:互联网 发布:seo英语编辑 编辑:程序博客网 时间:2024/06/16 22:45

模式介绍:

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

回车

继续即可。



原创粉丝点击