您的位置:首页 > 数据库 > Oracle

11、数据导出与导入

2016-04-22 16:00 489 查看
一、expdp导出数据

1、建立目录

create or replace directory dir_name as 'D:\...';

2、授权读写权限给用户

grant read,write on directory dir_name to user_name;

3、expdp命令导出

expdp user_name/password_name directory=dir_name dumpfile=file_name.dmp {tables=table_name1,table_name2... |

schemas=schemas_name | tablespaces=tablespace_name |full=y}

tables:要导出的表的名字。

schemas:要导出的模式的名字。

tablespaces:表空间的名字。

full:全部数据库

P346其余的参数(如query添加导出的where条件子句。)

二、impdp导入数据

impdp user_name/password_name directory=dir_name dumpfile=file_name.dmp  {tables=table_name1,table_name2... |

schemas=schemas_name | tablespaces=tablespace_name |full=y} [remap_schema=schema1:schema2]

remap_schema:将模式1导入到模式2中,也就是跨模式的数据导入导出。(模式的概念参考用户与安全。模式与用户是一一对

应关系。)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息