oracle数据泵备份与恢复库

假如  导出库的用户名是tiger,密码是1  导入到用户名是scott,密码是1

 备份库

expdp tiger/1@orcl dumpfile=expdp.dmp DIRECTORY=dpdata1;    导出一个expdp.dmp文件。

导入库

创建用户

create user scott identified by 1;(必须执行)

dp方式

1、创建目录

create directory dpdata1 as 'd:\test\dump';(非必须执行,创建过一次目录就可以了)

2、查看管理理员目录(同时查看操作系统是否存在,因为Oracle并不关心该目录是否存在,如果不存在,则出错)

select * from dba_directories;   (非必须执行)

3、给scott用户赋予在指定目录的操作权限,最好以system等管理员赋予。

grant read,write on directory dpdata1 to scott;  (必须执行)

grant dba to scott;  (必须执行)

4、导入库

impdp scott/1@orcl dumpfile=expdp.dmp DIRECTORY=dpdata1 remap_schema=tiger:scott

注意:上面创建的目录地址是d:\test\dump ,导入时一定要把expdp.dmp文件放在这个目录下。

posted @ 2018-01-17 14:23  土豆Z120553  阅读(283)  评论(0编辑  收藏  举报