ÓÃoracle¶ÁÈ¡±¾µØÎļþ
ÓÃoracle¶ÁÈ¡±¾µØÎļþ
Ê×ÏÈÒªÔÚoracleÖд´½¨Îļþ¼Ð£¬È»ºó¸³ÓèÏàÓ¦µÄ¶ÁдȨÏÞ£¬È»ºóÊý¾Ý¿â²ÅÄܶÁȡϵͳÖеÄÎļþ
--´´½¨Îļþ¼Ð ²¢¸³ÓèȨÏÞ¸øÓû§
create or replace directory DIRNAME as 'D:\skybook2';
grant read,write on directory DIRNAME as to USERNAME;
GRANT EXECUTE ON utl_file TO USERNAME;
´´½¨³É¹¦¿ÉÒԲ鿴һÏÂ
--²é¿´ÏµÍ³ËùÓд´½¨µÄÎļþ¼Ð
select * from ALL_DIRECTORIES;
±àдһ¸ö¼òµ¥µÄ¶ÁÈ¡ÎļþµÄ´æ´¢¹ý³Ì
create or replace procedure loadfiledata(p_path varchar2, --ÎļþµÄ·¾¶ (ÉÏÎÄÖн¨Á¢µÄÎļþÃû DIRNAME)
p_filename varchar2 --ÎļþµÄÃû×Ö(Èç text.txt, test.jsp)
) as
v_filehandle utl_file.file_type; --¶¨ÒåÒ»¸öÎļþ¾ä±ú
v_text varchar2(100); --´æ·ÅÎı¾
v_name test_loadfile.name%type;
v_addr_jd test_loadfile.addr_jd%type;
v_region test_loadfile.region%type;
v_firstlocation number;
v_secondlocation number;
v_totalinserted number;
begin
if (p_path is null or p_filename is null) then
goto to_end;
end if;
v_totalinserted:=0;
/*open specified file*/
v_filehandle:=utl_file.fopen(p_path,p_filename,'r');
loop
begin
utl_file.get_line(v_filehandle,v_text);----½«ÎļþдÈëv_text
exception
when no_data_found then
exit;
end ;
v_firstlocation:=instr(v_text,',',1,1);
v_secondlocation:=instr(v_text,',',1,2);
v_name:=substr(v_text,1,v_firstlocation-1);
v_addr_jd:=substr(v_text,v_firstlocation+1,v_secondlocation-v_firstlocation-1);
v_region:=substr(v_text,v_secondlocation+1);
/*²åÈëÊý¾Ý¿â²
Ïà¹ØÎĵµ£º
1. Óαê: ÈÝÆ÷£¬´æ´¢SQLÓï¾äÓ°ÏìÐÐÊý¡£
2. ÓαêÀàÐÍ: ÒþʽÓα꣬ÏÔʾÓα꣬REFÓαꡣÆäÖУ¬ÒþʽÓαêºÍÏÔʾÓαêÊôÓÚ¾²Ì¬Óα꣨ÔËÐÐǰ½«ÓαêÓëSQLÓï¾ä¹ØÁª£©,REFÓαêÊôÓÚ¶¯Ì¬Óαê(ÔËÐÐʱ½«ÓαêÓëSQLÓï¾ä¹ØÁª)¡£
3. ......
oracle ÔõôÀ´±éÀúÒ»¸öÊ÷£¬Ïà±È½ÏÆäËû·½·¨£¬oracleµÄconnectÓï·¨¸üÄܱܺãÀûµÄ½â¾öÎÊÌâ¡£
Óï·¨¸ñʽ£º
select ...
from ...
start with...
connect by prior expr=expr
order siblings by ..
start with µÄ¹¦ÄÜÀàËÆÓÚwhere£¬Ö¸Ã÷´ÓÄĸö·ÖÖ§¿ªÊ¼±ãÀû£»
connect by Ö¸Ã÷¸¸½ÚµãºÍ×Ó½ÚµãµØÁ¬½Ó·½Ê½£¬¹Ø¼ü×Öprior·ÅÔÚ¸¸½Ú ......
Temporary TablesÁÙʱ±í
1¼ò½é
ORACLEÊý¾Ý¿â³ýÁË¿ÉÒÔ±£´æÓÀ¾Ã±íÍ⣬»¹¿ÉÒÔ½¨Á¢ÁÙʱ±ítemporary tables¡£ÕâЩÁÙʱ±íÓÃÀ´±£´æÒ»¸ö»á»°SESSIONµÄÊý¾Ý£¬
»òÕß±£´æÔÚÒ»¸öÊÂÎñÖÐÐèÒªµÄÊý¾Ý¡£µ±»á»°Í˳ö»òÕßÓû§Ìá½»commitºÍ»Ø¹örollbackÊÂÎñµÄʱºò£¬ÁÙʱ±íµÄÊý¾Ý×Ô¶¯Çå¿Õ£¬
µ«ÊÇÁÙʱ± ......
2010Äê05ÔÂ2ºÅ |
23:59·ÖÀࣺLinux&Unix
, ¹ÜÀíά»¤
| ±à¼
| ±êÇ©£º11g
¡¢grid
±¾Îijö×Ô “inthirties£¨ÄÐ
ÈËÈýÊ®£©
”²©¿Í£¬×ªÔØÇëÎñ±Ø×¢Ã÷×÷Õߺͱ£Áô³ö´¦¡£
11gÀï³öÏÖÁËÒ»¸öнÇÉ«¡£
Oracle Grid Infrastructure
http://downlo ......