Oracle 导出数据库为dmp文件然后导入到数据库

发布时间2018/9/13 11:47:38

下载次数 0 次 访问量138 次


//创建目录
create or replace directory dump_dir as 'D:\dump\dir'

导出语句
expdp system/123456@TOPEVERY_HLEDB directory=TY_DIRdumpfile=hledb_all_bak_20161210.DMP  LOGFILE=hledb_all_bak_20161210.LOG full=y




导入


假设2个数据库为
  HLEPJDB
TOPEVERY_HLEDB


--创建表空间 根据实际导出的 数据库
CREATE TABLESPACE TBS_TYUM_IDX DATAFILE 'F:\app\WZDB_250\TBS_TYUM_IDX.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TY_KBMS_IDX DATAFILE 'F:\app\WZDB_250\TBS_TY_KBMS_IDX.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TY_KBMS DATAFILE 'F:\app\WZDB_250\TBS_TY_KBMS.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TYUM_SMS DATAFILE 'F:\app\WZDB_250\TBS_TYUM_SMS.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TYUM_PMI DATAFILE 'F:\app\WZDB_250\TBS_TYUM_PMI.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TYUM_FMP DATAFILE 'F:\app\WZDB_250\TBS_TYUM_FMP.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TYUM_SSO DATAFILE 'F:\app\WZDB_250\TBS_TYUM_SSO.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TYUM_UM DATAFILE 'F:\app\WZDB_250\TBS_TYUM_UM.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TYUM_UM_WWF DATAFILE 'F:\app\WZDB_250\TBS_TYUM_UM_WWF.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TYUM_GPRS DATAFILE 'F:\app\WZDB_250\TBS_TYUM_GPRS.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TYUM_PDA_UPDATE DATAFILE 'F:\app\WZDB_250\TBS_TYUM_PDA_UPDATE.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE SDE DATAFILE 'F:\app\WZDB_250\SDE.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE PERFSTAT DATAFILE 'F:\app\WZDB_250\PERFSTAT.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TYUM_EX DATAFILE 'F:\app\WZDB_250\TBS_TYUM_EX.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TT DATAFILE 'F:\app\WZDB_250\TT.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TY_WAP DATAFILE 'F:\app\WZDB_250\TBS_TY_WAP.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TYUM_UM_NEW DATAFILE 'F:\app\WZDB_250\TBS_TYUM_UM_NEW.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TYUM_UM_NEW_IDX DATAFILE 'F:\app\WZDB_250\TBS_TYUM_UM_NEW_IDX.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TYUM_FS DATAFILE 'F:\app\WZDB_250\TBS_TYUM_FS.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TYUM_FS_IDX DATAFILE 'F:\app\WZDB_250\TBS_TYUM_FS_IDX.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TY_FS DATAFILE 'F:\app\WZDB_250\TBS_TY_FS.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TY_FS_IDX DATAFILE 'F:\app\WZDB_250\TBS_TY_FS_IDX.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TY_KP DATAFILE 'F:\app\WZDB_250\TBS_TY_KP.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TY_KP_IDX DATAFILE 'F:\app\WZDB_250\TBS_TY_KP_IDX.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TY_KP_SS_DATA DATAFILE 'F:\app\WZDB_250\TBS_TY_KP_SS_DATA.DBF' size 100m autoextend on next 100m extent management local;
CREATE TABLESPACE TBS_TY_KP_SS_INDEX DATAFILE 'F:\app\WZDB_250\TBS_TY_KP_SS_INDEX.DBF' size 100m autoextend on next 100m extent management local;


--创建目录
create or replace directory TY_DUMP_DIR r as 'D:\dump\dir'

--导入1
impdp TY_FS/DEV_TY_FS@UM directory=TY_DUMP_DIR dumpfile=WZDB_ALL_BAK_20161130.DMP  LOGFILE=fsdb_all_bak_20161114.LOG full=y

impdp system/wanzhou123456@WZDB directory=TY_DUMP_DIR dumpfile=WZDB_ALL_BAK_20161130.DMP  LOGFILE=wzdb_all_bak_20161201.LOG full=y


--导入2
impdp system/123456@TOPEVERY_HLEDB directory=TY_DIR dumpfile=hledb_all_bak_20161210.DMP  LOGFILE=hledb_all_bak_20161210.LOG full=y
impdp system/123456@HLEPJDB directory=TY_DIR dumpfile=hlePJ_all_bak_20161210.DMP   LOGFILE=hledb_all_bak_20161210.LOG full=y











网友评论

发表评论

欢迎评论哦!