--------------备份还原--------------------
--物理备份
--逻辑备份
1)传统工具: exp导出、imp导入
实质:调用sql指令,导入\导出数据,速度较慢
可以运行在客户端,也可以运行在服务器端,
在cmd窗口运行:
exp scott/tiger@vpmdb file=d:\xx.dmp
imp scott/tiger@vpmdb file=d:\xx.dmp exp scott/tiger@vpmdb file=d:\xx.dmp tables=emp,dept
imp scott/tiger@vpmdb file=d:\xx.dmp tables=emp,dept2)数据泵工具dump: expdp导出、impdp导入
实质:调用dbms_datameta包里面的过程,直接提取数据块速度较快
只能在服务器端使用
使用流程:
1、准备文件夹,即在磁盘上新建一个目录。
2、新建oracle目录
create directory ora_bak as 'd:\bak';
3、给用户授权,可以读写ora_bak的权限
grant read,write on directory ora_bak to scott;
4、导出数据
drop table scott.emp;
drop table scott.dept;
select * from scott.emp;
在cmd窗口运行:
expdp scott/tiger@vpmdb directory=bakdir dumpfile=xx.dmp
impdp scott/tiger@vpmdb directory=bakdir dumpfile=xx.dmp
expdp scott/tiger@vpmdb directory=bakdir dumpfile=xx1.dmp tables=(emp,dept)
expdp scott/tiger@vpmdb directory=bakdir dumpfile=xx1.dmp tables=%emp%