一、系统创建备份目录
[root@localhost /]# mkdir -p /data/backup_mes
二、给oracle分配权限
[root@localhost /]# chown -R oracle:oinstall /data/backup_mes/
三、创建dmp路径
SQL>create directory backup_MES as '/data/backup_mes';
GRANT READ,WRITE ON DIRECTORY backup_MES to yczboa;
四、导出备份
expdp MESPRD/Mes1qaz#EDC@127.0.0.1/mesorclprd DIRECTORY=backup_mes DUMPFILE=MESPRD_20200109.dmpdp logfile=MESPRD_20200109.log compression=all
五、导入备份
1、根据MES安装数据手册,创建表空间、用户、用户授权、对象授权(如果已存在,则不需要再创建)
SQL> create user MESPRD identified by "Mes1qaz#EDC" default tablespace MESPRD_TBSP temporary tablespace TEMP profile DEFAULT;
SQL> grant connect,dba,resource to MESPRD;
SQL> grant unlimited tablespace to MESPRD_TBSP with admin option;
2、导入(导入到QAS测试机中,导入和原表空间、用户相同,则需要重新创建表空间以及用户即可)
impdp MESPRD/Mes1qaz dumpfile=MESPRD_20200109.dmpdp logfile=SMESPRD_20200109_impdp.log DIRECTORY=backup_mes
文章评论