以下整库操作需要拥有管理员权限的用户
其中 user为用户名
password为密码
orcl为数据库实例名
命令行导出
整库导出
exp user/password@orcl full=y file=文件名及路径
有时候只想导出单个用户表空间的表只需要加上 owner=admin
exp user/password@orcl owner=admin file=文件名及路径
导出指定的表 tables=(tableName,tableName1)
exp user/password@orcl owner=admin file=文件名及路径 tables=(tableName,tableName1)
命令行导入
imp user/password@orcl file=导入的文件路径 full=y
导入的过程中可能遇到相同的数据,可以加上 ignore=y 忽略掉重复数据只导入新数据
imp user/password@orcl file=导入的文件路径 full=y ignore=y
导入指定表
imp user/password@orcl file=导入的文件路径 ignore=y tables=(tableName,tableName1)
以上只是在服务端进行的操作,有时候想直接在本地导出导入呢?
只需要加入ip地址和端口号就可以了
exp user/password@192.168.1.1:1521/orcl owner=库所有者 file=文件名及路径
imp user/password@192.168.1.1:1521/orcl file=文件名及路径 full=y ignore=y