導入
第一步:
查詢DIRECTORY對象
SELECT * FROM dba_directories;
第二步:
將dmp文件拷到指定位置
第三步:
新建一個用戶
drop user puyun_liangan cascade;
create user puyun_liangan
identified by sa;
– Grant/Revoke role privileges
grant dba to puyun_liangan;
grant resource to puyun_liangan ;
grant connect to puyun_liangan ;
第四步:
執行導入語句
impdp puyun_liangan/sa@localhost:1521/orcl DIRECTORY=DATA_PUMP_DIR DUMPFILE=PUYUN_LIANGAN_TEST.DMP remap_schema=puyun_liangan_test:puyun_liangan
或
impdp pbp/pbp@localhost:1521/orcl DIRECTORY=DATA_PUMP_DIR DUMPFILE=hg_20200208_pbp.DMP remap_schema=hg_20200208_pbp:pbp
二選一,爲模糊不清時有更多的對比
第五步:
執行更新語句,修改密碼爲puyun360
update org_userinfo
set spassword=‘c0433b643663cc83ccda9f0df07093f8’
,email=’’
,phone=’’;
第六步:
事務提交
修改D:\puyun\tomcat6\conf\Catalina\localhostproject中name
導出
模板:expdp 用戶名/密碼@IP:端口號/Sid directory=DATA_PUMP_DIR dumpfile=文件路徑.dmp
以下任選其一
--expdp puyun_cb_house/sa@localhost:1521/orcl DIRECTORY=DATA_PUMP_DIR DUMPFILE=puyun_cb_house_20190516.dmp logfile=puyun_cb_house_20190516.log schemas=puyun_cb_house version=11.2.0.1.0
exp puyun_cb_house/sa@localhost:1521/orcl owner=puyun_cb_house file=D:\db\puyun_cb_house_expdb_20190510.dmp log=D:\db\exp.log grants=y
pause
puyun_lens_erp_test
exp puyun_lens_erp_test/sa@localhost:1521/orcl owner=puyun_lens_erp_test file=C:\Users\35854\Desktop\船舶\db\puyun_cb_house_expdb_20190510.dmp log=C:\Users\35854\Desktop\船舶\db\exp.log grants=y
pause
exp puyun_cb_house/sa@localhost:1521/orcl owner=puyun_cb_house file=D:\db\puyun_cb_house_expdb_20190511.dmp log=D:\db\exp.log grants=y
pause
imp puyun_zc_house/sa@localhost:1521/orcl file=d:/puyun_cb_house_expdb_20190511.dmp
--impdp puyun_zc_house/sa@localhost:1521/orcl DIRECTORY=DATA_PUMP_DIR DUMPFILE=FANG.DMP remap_schema=fang:puyun_zc_house