oracleÍⲿ±í£¨External Table£©µÄʹÓÃ
ÔÎĵØÖ·£ºhttp://arvinnan.javaeye.com/blog/308638
²Î¿¼
http://www.blogjava.net/wxqxs/archive/2008/10/13/237180.html?opt=admin
http://hi.baidu.com/ray315/blog/item/153c97a33cd26caacbefd0de.html
¶¨Òå
External tables access data in
external sources
as if it were in a table in the database.
You can connect to the database and create metadata for the external table
using DDL
.
The DDL for an external table consists of two parts:
one part that describes the Oracle
column types
, and
another part (the access parameters) that describes the mapping of
the external data to the Oracle
data columns.
u
´´½¨µÄÓï·¨ÀàËÆÓÚ£º "CREATE TABLE ... ORGANIZATION EXTERNAL"
u
Êý¾ÝÔÚÊý¾Ý¿âµÄÍⲿ×éÖ¯£¬ÊDzÙ×÷ϵͳÎļþ¡£
u
²Ù×÷ϵͳÎļþÔÚÊý¾Ý¿âÖеıêÖ¾ÊÇ
ͨ¹ýÒ»¸öÂ߼Ŀ¼À´Ó³Éä
µÄ¡£
u
Êý¾ÝÊÇ
Ö»¶Á
µÄ¡££¨Íⲿ±íÏ൱ÓÚÒ»¸öÖ»¶ÁµÄÐé±í£©
u
²»¿ÉÒÔÔÚÉÏÃæÔËÐÐÈκΠDML ²Ù×÷
£¬
²»¿ÉÒÔ´´½¨Ë÷Òý
¡£
u
¿ÉÒÔ²éѯ²Ù×÷ºÍÁ¬½Ó
¡£¿ÉÒÔ²¢ÐвÙ×÷¡£
½¨Á¢Íⲿ±íµÄ²½Öè
£º
1¡¢´´½¨ÒÔ“,”·Ö¸ôµÄÎļþ“TestTable.csv”ÖÁ“D:\Test
”
2¡¢´´½¨Ò»¸öDirectory£º
create
directory
TestTable_dir
as
'D:\Test'
;
3¡¢´´½¨Ò»¸öÍⲿ±í£º
create
table
TestTable(
ID
varchar2
(
10
),
 
Ïà¹ØÎĵµ£º
1¡¢ÊýÖµÐͳ£Óú¯Êý
¡¡
¡¡º¯Êý¡¡¡¡·µ»ØÖµ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÑùÀý¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÏÔʾ
ceil(n) ´óÓÚ»òµÈÓÚÊýÖµnµÄ×îСÕûÊý¡¡¡¡select ceil(10.6) from dual; 11
floor(n) СÓÚµÈÓÚÊýÖµnµÄ×î´óÕûÊý¡¡ select ceil(10.6) from dual; 10
mod(m,n) m³ýÒÔnµÄÓàÊý,Èôn=0,Ôò·µ»Øm select mod(7,5) from dual; 2
p ......
1.Ñ¡ÓÃÊʺϵÄOracleÓÅ»¯Æ÷
OracleµÄÓÅ»¯Æ÷¹²ÓÐ3ÖÖ£º
a.RULE(»ùÓÚ¹æÔò)
b.COST(»ùÓڳɱ¾)
c.CHOOSE(Ñ¡ÔñÐÔ)
ÉèÖÃȱʡµÄÓÅ»¯Æ÷£¬¿ÉÒÔͨ¹ý¶Ôinit.oraÎļþÖÐOPTIMIZER_MODE²ÎÊýµÄ
¸÷ÖÖÉùÃ÷£¬ÈçRULE¡¢COST¡¢CHOOSE¡¢ALL_ROWS¡¢FIRST_ROWS¡£Ä㵱ȻҲÔÚSQL¾ä¼¶»òÊǻỰ(session)¼¶¶ÔÆä½øÐи²
¸Ç¡£
ΪÁËʹÓûùÓڳɱ¾µÄÓÅ»¯Æ ......
1.´´½¨Óû§£º ÐèÒªDBAµÄȨÏÞ£¬Óï¾ä create user Óû§Ãû identified by ÃÜÂë¡£ eg. create user joe identified by m123; 2.¸ü¸ÄÃÜÂ룺 passw Óû§Ãû 3.ɾ³ýÓû§£º ÐèÒªDBAµÄȨÏÞ£¬Èç¹ûÓÃÆäËûÓû§È¥É¾³ýÔòÐèÒª¾ßÓÐdrop userµÄȨÏÞ¡£ drop user Óû§Ãû [cascade]; (Èç¹ûÓû§ÒѾ´´½¨±íÁË£¬ÔòÓÃc ......
¸ÅÊö
ÐéÄâרÓÃÊý¾Ý¿â (VPD) ÌṩÁ˽ÇÉ«ºÍÊÓͼÎÞ·¨ÌṩµÄÐм¶·ÃÎÊ¿ØÖÆ¡£¶ÔÓÚ»¥ÁªÍø·ÃÎÊ£¬ÐéÄâרÓÃÊý¾Ý¿â¿ÉÒÔÈ·±£ÔÚÏßÒøÐеĿͻ§Ö»ÄÜ¿´µ½ËûÃÇ×Ô¼ºµÄÕÊ»§¡£Web Íйܹ«Ë¾¿ÉÒÔÔÚͬһ Oracle Êý¾Ý¿âÖÐά»¤¶à¸ö¹«Ë¾µÄÊý¾Ý£¬µ«Ö»ÔÊÐíÿ¸ö¹«Ë¾²é¿´Æä×ÔÉíÊý¾Ý¡£
ÔÚÆóÒµÄÚ²¿£¬ÐéÄâÊý¾Ý¿â¿ÉÔÚÓ¦ÓóÌÐò²¿Êð·½Ãæ½µµÍÓµÓгɱ¾¡£¿ÉÒÔÔÚÊý ......
ºÎΪLOB£¿
lobΪoracleÊý¾Ý¿âµÄÒ»¸ö´ó¶ÔÏóÊý¾ÝÀàÐÍ,¿ÉÒÔ´æ´¢³¬¹ý4000bytesµÄ×Ö·û´®£¬¶þ½øÖÆÊý¾Ý£¬OSÎļþµÈ´ó¶ÔÏóÐÅÏ¢.×î´ó¿É´æ´¢µÄÈÝÁ¿¸ùoracleµÄ°æ±¾ºÍoracle ¿é´óСÓйØ.
ÓÐÄǼ¸Öֿɹ©Ñ¡ÔñµÄLOBÀàÐÍ?
Ä¿Ç°ORACLEÌṩÁËCLOB£¬NCLOB£¬BLOB£¬BFILE¹²ËÄÖÖLOBÀàÐÍ,CLOB,NLOBΪ´ó×Ö·û´®ÀàÐÍ,NLOBΪ¶àÓïÑÔ¼¯×Ö·ûÀàÐÍ,ÀàËÆÓÚNV ......