External Table
1)basic
1@@@@(192.168.0.60)create directory object dir60.
SQL> conn /as sysdba;
SQL> create directory dir60 as '/u01/app/oracle/directory/orcl/dir60';
SQL> grant read,write on directory dir60 to hr;
[oracle@station60 dir01]$ pwd
/u01/app/oracle/directory/orcl/dir60
2@@@@(192.168.0.60)create the external file.
SQL> conn hr/hr;
Connected.
SQL> ed
Wrote file afiedt.buf
1 create table emp_ext
2 (first_name, last_name, department_name)
3 organization external
4 (type oracle_datapump
5 default directory dir01
6 location ('emp1.exp','emp2.exp','emp3.exp')
7 )
8 parallel 3
9 as
10 select e.first_name,e.last_name,d.department_name
11 from hr.employees e, hr.departments d
12 where e.department_id=d.department_id and
13* d.department_name in('Marketing','Purchasing')
SQL> /
Table created.
@@@
@@@there are the datafiles generated by external tables.
[oracle@station60 dir60]$ ls
emp1.exp emp3.exp EMP_EXT_22099.log EMP_EXT_22362.log
emp2.exp EMP_EXT_22097.log EMP_EXT_22101.log
3@@@@(192.168.0.23)reviece and copy.
@@@
[root@station60 dir01]# scp -rp * 192.168.0.23:/u01/app/oracle/directory/orcl/dir23
@@@check the own of files
[root@station23 dir23]# chown -R oracle:oinstall /u01/app/oracle/directory
[root@station23 dir23]# ll
total 68
-rw-r----- 1 oracle oinstall 12288 Sep 22 17:36 emp1.exp
-rw-r----- 1 oracle oinstall 12288 Sep 22 17:36 emp2.exp
-rw-r----- 1 oracle oinstall 12288 Sep 22 17:36 emp3.exp
@@@
SQL> create table emp_ext1
( first_name varchar2(35),
last_name varchar2(35),
department_name varchar2(40))
organization external
(type oracle_datapump
default directory dir23
location('emp1.exp','emp2.exp','emp3.exp')
)
parallel 3;
SQL> select count(*) from emp_ext;
COUNT(*)
----------
8
@@@copy the external table to your oracle inside.
SQL> create table emp_ext_copy as select * from emp_ext;
SQL> select * from emp_ext_copy;
External Table
原创emperor_majesty 博主文章分类:B_Recovery ©著作权
文章标签 external table 文章分类 Oracle 数据库
上一篇:Sqlldr
下一篇:Shell for Oracle

-
elementUI table 表头 宽度 动态调整
elementUI table 表头宽度自适应
elementUI 宽度自适应 -
External Table Example02 like datapump
Transport and filter data between two database using externtal table.
oracle_datapump external table -
Using SQL*Loader to create an external table
下面的实验是有一个txt的文本文件,根据此文本文件,使用SQL*Loader创建一个
oracle sql 外部表 sed 文本文件