在使用oracle数据库的过程中,数据的导入和导出对于数据的迁移在所难免,因此基本导入导出命令今天做了下总结:
一、整个数据库(执行导出命令的用户必须是管理员)
导出:exp system/manager@TestDB file=E:\sampleDB.dmp full=y
导入:imp system/manager file=E:\sampleDB.dmp full=y ignore=y
二、某个(些)用户下所有的对象
导出:exp system/manager@TestDB file=E:\sampleDB.dmp owner=(user1,user2)
导入:imp system/manager file=E:\sampleDB.dmp log=seapark.log fromuser=(user1,user2)
三、指定的表
导出:exp system/manager@TestDB file=E:\sampleDB.dmp tables=(TableA,TableB)
导入:imp system/manager@testDB file=E:\sampleDB.dmp fromuser=user1 touser=user2
四、表结构
导出:exp system/manager@TestDB owner=user tables=(TableA,TableB) rows=n file=E:\sampleDB.dmp
导入:imp system/manger@testDB fromuser=user1 touser=user2 file=E:\sampleDB.dmp
五、特定表中的指定条件的记录
导出:exp system/manager@TestDB file=E:\sampleDB.dmp tables=(tableA) query=' where filed1='王五'
导入:exp system/manager@testDB file=E:\sampleDB.dmp table=tableA