expdp工具导出的步骤:
1、创建DIRECTORY
create directory dir_temp as 'D:\OracleTest\dir_temp';
2、授权
Grant read,write on directory dir_temp to scott;
--查看目录及权限
SELECT privilege, directory_name, DIRECTORY_PATH FROM user_tab_privs t, all_directories d
WHERE t.table_name(+) = d.directory_name ORDER BY 2, 1;
3、执行导出
expdp scott/tiger@orcl schemas=scott directory=dir_temp dumpfile =zhang.dmp logfile=zhang.log;
1、创建DIRECTORY
create directory dir_temp as 'D:\OracleTest\dir_temp';
2、授权
Grant read,write on directory dir_temp to scott;
--查看目录及权限
SELECT privilege, directory_name, DIRECTORY_PATH FROM user_tab_privs t, all_directories d
WHERE t.table_name(+) = d.directory_name ORDER BY 2, 1;
3、执行导出
expdp scott/tiger@orcl schemas=scott directory=dir_temp dumpfile =zhang.dmp logfile=zhang.log;
创建一个用户zhang,
//创建临时表空间
create temporary tablespace test_temp
tempfile 'D:\oracle\product\10.2.0\oradata\test_temp01.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;
create temporary tablespace test_temp
tempfile 'D:\oracle\product\10.2.0\oradata\test_temp01.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;
//创建数据表空间
create tablespace test_data
logging
datafile 'D:\oracle\product\10.2.0\oradata\test_data01.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;
create tablespace test_data
logging
datafile 'D:\oracle\product\10.2.0\oradata\test_data01.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;
//创建用户并指定表空间
create user zhang identified by zhang
default tablespace test_data
temporary tablespace test_temp;
create user zhang identified by zhang
default tablespace test_data
temporary tablespace test_temp;
用户创建好之后,赋予相关权限;
grant connect,resource to zhang;
Grant read,write on directory dir_temp to zhang;
grant imp_full_database to ZHANG;(这个是给予能进行导入操作的权限)
impdp工具导入的步骤:
impdp zhang/zhang DIRECTORY=dir_temp DUMPFI
LE=zhang.dmp logfile=zhang.log remap_schema=scott:zhang
LE=zhang.dmp logfile=zhang.log remap_schema=scott:zhang
即可导入表到不同用户。
按指定表名导入
impdp zhang/zhang DIRECTORY=dir_temp tables=scott.dept
DUMPFILE=zhang.dmp logfile=zhang.log remap_schema=scott:zhang
可导入指定表名。
以上,感谢
蒙昭良的个人空间,蓝紫博客园,和论坛各个网友,个人只是学习笔记总结。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26446098/viewspace-711555/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26446098/viewspace-711555/