现在的位置: 首页 > 综合 > 正文

Oracle 数据库导入导出

2013年08月04日 ⁄ 综合 ⁄ 共 691字 ⁄ 字号 评论关闭

使用 exp/imp 导入导出

开始exp/imp之前, 有以下几点需要注意:

1)此部分以 oracle 10g为例。

2)exp, imp 是操作系统下一个可执行的文件,存放在/ORACLE_HOME/bin目录下。

所以之间cmd 命令模式下执行就行了。(不需要先连接进sqlplus)

3)exp , imp 命令行后不要加 ";"号, 否则会报类似以下的错误
About to export specified users ...
EXP-00010: dbuser; is not a valid username
Export terminated successfully with warnings.

1. 导出指定用户的表.

实例:

exp system/password@orcl file=d:\dbuser.dmp owner=dbuser

2. 导入指定用户的表

imp system/password@orcl file=d:\work\bak\dbuser.dmp fromuser=dbuser full=y ignore=y

如果导入的db 没有对应的user和tablespace 的话, 则需要先创建:

create USER dbuserIdentified by password DEFAULT TABLESPACE "DBUSERSPACE"  ACCOUNT UNLOCK ;

create tablespace DBUSERSPACE datafile 'D:\oracle\product\10.2.0\db_1\dbs\DBUSERSPACE.DBF' size 30m autoextend on next 10m maxsize 100m extent management local;

抱歉!评论已关闭.