oracle导入导出
1、查询当前创建的所有dmp导出目录
?? ?select * from dba_directories;
2、创建expdp导出目录(可不创建,选择已有目录,创建后使用上一命令检查是否创建成功,如果未成功,导出会报错)
?? ?create or replace directory dmp as 'D:/app/dmp';
3、创建之后需要授权
?? ?grant read,write on directory dmp to PUser;
4、导出(使用cmd命令编辑器)
?? ?expdp Test/JSxry@192.168.123.74/orcl? schemas=Test directory=DIRPATH dumpfile=Test20220623.dmp? logfile=Test.log;
5、导入
?? ?create user tuser_szhtest identified by tuser_szhtest default tablespace tuser;
?? ?grant connect, resource to tuser_szhtest;
?? ?create tablespace tuser datafile 'D:\user_data.dbf' size 1G autoextend on next 500m maxsize 20G extent management local;
?? ?impdp tuser_szhtest/tuser_szhtest@bsoft directory=DMP dumpfile=tuser20220408.dmp schemas=tuser