admin 管理员组

文章数量: 1184232


2024年4月24日发(作者:sadie)

Data Pump

一、 Data Pump Export

要求:实现将scott用户的所有数据导出来

1.在操作系统的文件系统中创建文件夹

在oracle目录下创建导出位置的目录:

在目录D:oracleproduct10.2.0下创建TempDataPumpXfer目录

2.在oracle数据库创建目录,以system身份执行命令:

SQL> create directory DataDumpDir as

'D:oracleproduct10.2.0TempDataPumpDir';

3. 为目录授权,以system身份执行命令:

SQL> grant read, write on directory DataDumpDir to scott;

4. 执行命令:

cmd>expdp scott/xing directory=DataPumpDir dumpfile=dp_

logfile=dp_ schemas=scott;

或者:

新建D:oracleproduct10.2.0TempDataPumpDirdp_文件;

新建D:oracleproduct10.2.0TempDataPumpDirdp_文件,内容为:

directory= DataPumpDir

dumpfile=dp_

logfile=dp_

#schemas=scott (注:默认执行的是schemas类型,且执行的默认对象是

expdp命令中scott/xing对象。)

然后使用命令:

cmd>expdp scott/xing parfile =

D:oracleproduct10.2.0TempDataPumpDirdp_

以上四步为基本步骤。

注:可以使用network_link

编辑D:oracleproduct10.2.0TempDataPumpDirdp_文件:

directory=DataPumpDir

dumpfile=dp_

logfile=dp_

#schemas=scott

network_link=(事先要在Net Manage配置好)

然后使用命令:

cmd>expdp scott/xing@ parfile=E:appxingTempDataPump

Dirdp_

本人是把远程(10g)中的scott数据导入到本地(11g)的文件

目录中,结果在执行命令时提示:

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

UDE-00018: 数据泵客户机与数据库版本 10.2.0.1.0 不兼容

二、 Data Pump Import

注:执行Data Pump Import需先完成前面Data Pump Export的四个步骤;

另外执行Data Pump Import一般是在另外一台oracle数据库上,本人是在

(11g)上执行Data Pump Import的。

1. 以system身份创建新用户scott并授权:

SQL>grant resource, connect to scott identified by xing;

2. 执行命令:

cmd>impdp

parfile=E:appxingTempDataPumpDirdp_

system/xing


本文标签: 目录 创建 执行 用户 数据