导出一个用户下的所有表数据
导入一个用户下的所有表数据
Imp username/password file=file.dmp fromuser=user1 touser=user2 rows=y
Fromuser为备份数据库时的用户
一、数据导出(exp.exe)
1、将指定用户的数据全部导出:
将数据库orcl中scott用户的数据全部对象导出
exp scott/accp@orcl file=d:\daochu.dmp
2、将指定用户的指定表的数据导出:
将数据库orcl中的scott用户的表emp、dept导出
exp scott/accp@orcl file= d:\daochu.dmptables=(emp,dept)
3、将指定用户的指定表空间的数据导出:
将数据库orcl中的表空间testSpace导出
exp scott/accp@orcl file=d:\daochu.dmptablespaces=(testSpace)
二、数据导入(imp.exe)
1、把指定的数据文件全部导入到指定的用户中: full=y意思是值全部数据
将d:\daochu.dmp 中的数据导入 orcl数据库的system用户中,
imp scott/accp@orcl file=d:\daochu.dmp full=y
2、把指定的数据文件全部导入到指定的用户中:
如果导入时,数据表已经存在,将报错,对该表不会进行导入;加上ignore=y即可,表示忽略现有表,在现有表上追加记录。
imp scott/accp@orcl file=d:\daochu.dmp full=y ignore=y