Oracle数据泵备份还原笔记

topicis 为用户名,密码为topicis ,可根据实际情况自行替换

备份与还原前提:
1、存在逻辑备份和还原逻辑目录,可通过 select * from dba_directories; 进行查看,创建语句:
create directory BACK as ‘/opt/back’;

2、目录需具授权:
grant read,write on directory BACK to topicis;

备份源库:
expdp topicis/topicis directory=BACK dumpfile=topicis0723.dmp logfile=exp_topicis0723.log schemas=topicis

删除目标库用户及用户下所有表、函数、过程:
drop user topicis cascade;

创建用户并授权:
此操作仅针对于已经存在表空间及临时空间的情况
CREATE USER “TOPICIS” PROFILE “DEFAULT” IDENTIFIED BY “topicis” DEFAULT TABLESPACE “TOPICIS” TEMPORARY TABLESPACE “TOPICIS_TEMP” ACCOUNT UNLOCK;
grant dba to topicis;

还原语句:
impdp topicis/topicis directory=BACK dumpfile=topicis0723.dmp logfile=imp_topicis0723.log schemas=topicis

你可能感兴趣的:(数据库,oracle)