ORACLE 命令行导入、导出表

Oracle数据导入导出imp/exp就相当与oracle数据还原与备份。

执行环境:可以在SQLPLUS.EXE或者DOS(命令行)中执行

 

数据导出:

1 将数据库ORCL完全导出,用户名system 密码system导出到D:\oracl.dmp中

/*
1、ORCL为通过Net Configuration Assistant配置的服务名
2、full=y 表示讲数据库ORCL完全导出,包含所有用户的数据(一般情况下不需要所有用户的数据)
*/
exp
system/system@ORCL file=d:\orcl.dmp full=y

2、将数据库中system用户与sys用户的表导出

exp system/system@ORCL file=d:\orcl.dmp owner=(system,sys)

3、导出数据库中指定的表table1和table2

exp system/system@ORCL file=d:\orcl.dmp tables=(table1,table2)

4、导出数据库中表table1中字段filed1以"00"打头的数据

 exp system/system@ORCL file=d:\orcl.dmp tables=(table1) query=\" where filed1 like  '00%'\"

 

数据导入有几点需要注意

1、要导入的数据库的版本如果低于导出的数据库,会报错。

2、数据库的编码格式要一致

数据导入:

1、将D:\orcl.dmp 导入 TEST数据库中

 imp system/system@TEST  file=d:\orcl.dmp

2、将d:\orcl.dmp中的表table1 导入

imp system/system@TEST  file=d:\orcl.dmp  tables=(table1) 

 

posted @ 2013-06-06 11:46  feeling_lwl  阅读(246)  评论(0)    收藏  举报