1.´´½¨Ä¿Â¼directory(½ÇÉ«system/sys)
create directory
hello_file as
'd:\dupmfile';
--²é¿´ËùÓÐÒÑ´´½¨µÄdirectory
--select * from dba_directories;
--drop directoryɾ³ý·¾¶ÓõÄ.
--drop directory exp_dir;
2.´´½¨±í¿Õ¼ä(¿ÉÒÔʹÓÃÆäĬÈϱí¿Õ¼ä)
2.1´´½¨ÁÙʱ±í¿Õ¼ä
create temporary tablespace
hello_temp
tempfile
'f:\oracle\data\hello_temp.dbf'
size 1024m
autoextend on
next 32m
extent management local;
2.2´´½¨Êý¾Ý±í¿Õ¼ä
create tablespace
hello_data
logging
datafile
'f:\oracle\data\hello_data.dbf'
size 512m
autoextend on
next 32m
extent management local;
3.´´½¨Óû§²¢Ð޸ıí¿Õ¼ä
conn system/system@orcl;
--ɾ³ý֮ǰÓû§
drop user
hello_user cascade;
--´´½¨Óû§£¨Èç¹ûÓбí¿Õ¼ä£¬Ôò¼ÓÉÏ£©
create user
hello_user identified by
pass default;-- tablespace hello_data temporary tablespace hello_temp;
4.¸³È¨ÏÞ
--Óû§µÄȨÏÞ
grant resource,connect,dba to
hello_user;
--Ŀ¼µÄȨÏÞ
grant read,write on directory
hello_file to
hello_user;
5.µ¼³ö
expdp original_user/pass@orcl directory=hello_file dumpfile=data20141014.dmp schemas=original_user
--µ¼³öµ½Ëù½¨µÄdirectoryµÄĿ¼ÏÂd:\dupmfile
6.µ¼Èë
--remap_tablespace¸Ä±í¿Õ¼ä
--remap_schema½«original_userÓû§µ¼Èëµ½hello_userÖУ¬Èç¹ûÓû§ÃûÏàͬ£¬Õâ¾ä¿ÉÒÔÊ¡ÂÔ
--data20141014.dmpµ¼³öµÄÊý¾Ý¿âÎļþÃû
impdp hello_user/pass@orcl directory=
hello_filedumpfile=
data20141014.dmp remap_tablespace=
original_data:hello_data remap_schema=original_user:hello_user