首先,以schemas方式導出用戶JCMS24的全部數據:
expdp system/system directory=data_pump_dir dumpfile=test_user.dmp schemas=JCMS24
說明:使用system導出是爲了導出JCMS24 schema中的全部內容,包括用戶創建和權限授予部分,使用用戶本身導出則不包含這些內容。
其次,drop用戶及其全部對象:
drop user JCMS24 cascade;
最後,以remap_tablespace方式導入test_user的全部內容:
impdp system/orcl directory=data_pump_dir dumpfile=test_user.dmp remap_tablespace=JCMS24:JCMS
查看導入的結果:
select username,default_tablespace,temporary_tablespace from dba_users where username='JCMS24';