首先看官方文档上的解释:
Managing External Tables
Oracle Database allows you read-only access to data in external tables. External tables are definedas tables that do not reside in the database, and can be in any format forwhich an access driver is provided. By providing the database with metadatadescribing an external table, the database is able to expose the data in theexternal table as if it were data residing in a regular database table. Theexternal data can be queried directly and in parallel using SQL.
You can, for example, select, join, or sort externaltable data. You can also create views and synonyms for external tables.However, no DML operations (UPDATE,INSERT, orDELETE) are possible, and no indexes can be created, on external tables.
External tables also provide a framework to unload theresult of an arbitrary SELECT statement into aplatform-independent Oracle-proprietary format that can be used by Oracle DataPump.
实验测试:
1、 创建一个外部表
(1)元数据:
[oracle@mydb ~]$more prod_master.dat
6,6,6,6,6,600
7,7,7,7,7,700
(2) 建目录
sys@OCM> create directory dir_gyj as '/home/oracle'; Directory created. sys@OCM> grant read,write on directory dir_gyj to gyj; Grant succeeded.
(3)创建外部表
gyj@OCM> CREATE TABLE ext_gyj_costs 2 ( 3 "CHANNEL_ID" NUMBER, 4 "PROD_ID" NUMBER, 5 "PROMO_ID" NUMBER, 6 "TIME_ID" NUMBER, 7 "UNIT_COST" NUMBER, 8 "UNIT_PRICE" NUMBER 9 ) 10 ORGANIZATION external 11 ( 12 TYPE oracle_loader 13 DEFAULT DIRECTORY dir_gyj 14 ACCESS PARAMETERS 15 ( 16 FIELDS TERMINATED BY "," LDRTRIM 17 REJECT ROWS WITH ALL NULL FIELDS 18 ( 19 "CHANNEL_ID" CHAR(255) 20 TERMINATED BY ",", 21 "PROD_ID" CHAR(255) 22 TERMINATED BY ",", 23 "PROMO_ID" CHAR(255) 24 TERMINATED BY ",", 25 "TIME_ID" CHAR(255) 26 TERMINATED BY ",", 27 "UNIT_COST" CHAR(255) 28 TERMINATED BY ",", 29 "UNIT_PRICE" CHAR(255) 30 TERMINATED BY "," 31 ) 32 ) 33 location 34 ( 35 'prod_master.dat' 36 ) 37 )REJECT LIMIT UNLIMITED; Table created. gyj@OCM> select * from ext_gyj_costs; CHANNEL_ID PROD_ID PROMO_ID TIME_ID UNIT_COST UNIT_PRICE ---------- ---------- ---------- ---------- ---------- ---------- 6 6 6 6 6 600 7 7 7 7 7 700
以上是小编为您精心准备的的内容,在的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索terminal
, database
, char
, number
, data
, tables
external
mysql ocp 1z0 883、1z0 047、ocp 047 解析、ocp047和051的区别、ocp 047,以便于您获取更多的相关知识。