oracle 數據庫複製

場景:     數據庫

一、從OperateSystem用戶下將數據庫導入到新建立用戶LsOperateSystem用戶下,從Gsyl用戶下將數據庫導入到新建立用戶LsZhmz用戶下 建立命名空間和用戶LsOperateSystem,並受權oracle

 

create tablespace LsOperateSystem datafile 'E:\tools\tablespace\orcl\LsOperateSystem.DBF' size 50M autoextend on next 10m maxsize unlimited;

create user LsOperateSystem identified by 000000 default tablespace LsOperateSystem;

grant connect,resource to LsOperateSystem;

grant dba to LsOperateSystem;

 

建立命名空間和用戶LsOperateSystem,並受權ide

 

create tablespace LsZhmz datafile 'E:\tools\tablespace\orcl\LsZhmz.DBF' size 50M autoextend on next 10m maxsize unlimited;

create user LsZhmz identified by 000000 default tablespace LsZhmz;

grant connect,resource to LsZhmz;

grant dba to LsZhmz;

 

二、建立數據庫目錄,並受權給用戶spa

create directory oracleDB4 AS 'E:\oracleDB'; --(執行一次便可)

grant read ,write on directory oracleDB4 to LsOperateSystem; 

grant read ,write on directory oracleDB4 to LsZhmz; 

 

三、從原有用戶下導出數據庫code

expdp OperateSystem/000000@orcl schemas=OperateSystem directory=oracleDB4 dumpfile=OperateSystem.DMP logfile =OperateSystem.LOG;

expdp Gsyl/000000@orcl schemas=Gsyl directory=oracleDB4 dumpfile=Gsyl.DMP logfile =Gsyl.LOG;

 

四、將原有用戶導出的數據導入新用戶blog

impdp LsOperateSystem/000000 directory=oracleDB4 dumpfile=OperateSystem.dmp REMAP_SCHEMA=OperateSystem:LsOperateSystem EXCLUDE=USER full=y;

impdp LsZhmz/000000 directory=oracleDB4 dumpfile=Gsyl.dmp REMAP_SCHEMA=Gsyl:LsZhmz EXCLUDE=USER full=y;
相關文章
相關標籤/搜索