Oracle笔记:备份还原

本文介绍了Oracle数据库中两种主要的数据备份方法:物理备份和逻辑备份,并详细解释了传统工具exp/imp以及数据泵工具expdp/impdp的具体使用流程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

--------------备份还原--------------------
--物理备份
--逻辑备份
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,dept

2)数据泵工具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%


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

于大大大洋

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值