1.导入import语句
imp username/password@dbname file=table_name.dmp log=XXX.log tables=table_name ignore=y
2. nohup语句(在后台不间断的运行命令)
nohup imp username/password@dbname file=XXX.dmp log=XXX.log tables=XXX > nohup_XXX.out &
ps -def | grep XXX(比如imp):查找进程,最后一行总是会grep自己
jobs -l 查看进程
kill -9 XXX (XXX是进程号) 终止后台运行的进程
3.导出语句exp
exp username/password@dbname file=table_name.dmp tables=table_name query=“where xxx_date<=‘20171117’”
条件导出(https://blog.youkuaiyun.com/tianmingt/article/details/52913280)
exp scott/tiger@vmddzzwpt file=e:\scott.dmp log=e:\scott.log tables=emp query =\“WHERE deptno=10 \”
exp scott/tiger@vmddzzwpt file=e:\scott.dmp log=e:\scott.log tables=emp query =\“WHERE to_char(hiredate,‘yyyy’)=‘1981’ \”
exp abc/abc tables=(tablename) query=\“where channel_id=\‘2\’\” file=newmobile.dmp log=expnewmobile.log
小于号,单引号,大于号,用在条件里面是必须要加转移符号\
4.删除del
delete from table_name where xxx<=‘20171117’ and status=“01”
5. ignore=y
oracle imp 导入可以使用 参数进行覆盖数据库,
如果不使用 ignore=y 参数在进行imp 导入时,就会 对已经存在的表就不会进行导入,
如果加上ignore=y 参数就会对已经存在的表中就也会进行导入(insert),
重复的数据不会覆盖,而是报错