使用可视化工具plsql导出
plsql菜单栏----> Tools---->Export Tables
命令导出
倒出jojo用户下的数据:
exp jojo/1234@ORCL file=d:\daochu.dmp owner=jojo
导出出指定表的数据:
exp jojo/1234@ORCL file=d:\daochu.dmp tables=table1,table2
导出以**开头的表:
exp 用户名/用户密码@ORCL file=/usr/tmp/data.dmp tables=用户名.DEMO_%
加查询条件导出
exp jojo/1234@ORCL file=d:\daochu.dmp tables=(table1) query=\" where name ='jojo%'\"
导出时需要排除某些表,加上exclude参数
exclude=table:\"IN \(\'TB_TABLE1\', \'TB_TABLE2\'\, \'TB_TABLE3\'\, ...)\"
导出时like匹配排除某些表
exclude=table:\"like \'TB_TABLE1_%\'\",table:\"IN \(\'TB_TABLE2\', \'TB_TABLE2\'\, \'TB_TABLE2\'\)\"
imp命令导入dmp文件到数据库
使用可视化工具plsql导入
plsql菜单栏----> Tools---->import Tables
使用命令导如
plsql菜单栏----> Tools---->Export Tables
imp jojo/1234@ORCL file=/tmp/data.dmp full=y
忽略已经存在的表报错信息
imp jojo/1234@ORCL file=/tmps/data.dmp full=y ingore=y
若导出某个用户下的表时,需要排除某些表可用一下命令
imp jojo/1234file@ORCL file=test.dmp exclude=table:\"in ('A','B')\"