使用data pump驱动的外部表移动数据

使用data pump驱动的外部表移动数据数据库

好比咱们有一个报表的数据,准备从一个数据库A中移动到另外一个数据库B中,如何实现?oracle

这个问题,咱们使用带data pump驱动的外部表方式,很容易实现,具体方法以下:get

1.在A库中,使用data pump驱动建立一个外部表,把报表的数据所有卸载到指定数据文件中:it

1.1 建立一个目录io

create directory exp_dir as '/home/oracle/';table

grant read,write on directory exp_dir to hr;ast

1.2 把报表数据经过外部表方式卸载到exp_dir目录下面的两个文件下面:date

create table extab_emp_dpselect

(employee_id number(4),channel

last_name varchar2(30),

hire_date date,

salary number)

organization external

(type oracle_datapump

default directory exp_dir

location ('empdp.exp','empdp1.exp')

)

parallel

as

select employee_id,last_name,hire_date,salary from hr.employees;

1.3 查看/home/oracle/ 下,应该产生两个二精致文件:

ls /home/oracle/empdp*.exp

2.把 /home/oracle/empdp.exp,/home/oracle/empdp1.exp拷贝到B 库中

3.在B库上经过外部表方式,装载数据

3.1 建立一个目录

create directory exp_dir as '/home/oracle/';

grant read,write on directory exp_dir to hr;

3.2 装载数据

create table extab_emp_dp

(employee_id number(4),

last_name varchar2(30),

hire_date date,

salary number)

organization external

(type oracle_datapump

default directory exp_dir

location ('empdp.exp','empdp1.exp')

)

parallel

3.3 查看数据

select * from extab_emp_dp;

相关文章
相关标签/搜索