ORACLE directory Ŀ¼
Create directoryÈÃÎÒÃÇ¿ÉÒÔÔÚOracleÊý¾Ý¿âÖÐÁé»îµÄ¶ÔÎļþ½øÐжÁд²Ù×÷£¬¼«´óµÄÌá¸ßÁËOracleµÄÒ×ÓÃÐԺͿÉÀ©Õ¹ÐÔ¡£
ÆäÓ﷨Ϊ:
CREATE [OR REPLACE] DIRECTORY directory AS 'pathname';
±¾°¸Àý¾ßÌå´´½¨ÈçÏÂ:
create or replace directory exp_dir as '/tmp';
Ŀ¼´´½¨ÒԺ󣬾ͿÉÒ԰ѶÁдȨÏÞÊÚÓèÌØ¶¨Óû§£¬¾ßÌåÓï·¨ÈçÏÂ:
GRANT READ[,WRITE] ON DIRECTORY directory TO username;
ÀýÈç:
grant read, write on directory exp_dir to eygle;
´ËʱÓû§eygle¾ÍÓµÓÐÁ˶ԸÃĿ¼µÄ¶ÁдȨÏÞ¡£
ÈÃÎÒÃÇ¿´Ò»¸ö¼òµ¥µÄ²âÊÔ:
SQL> create or replace directory UTL_FILE_DIR as '/opt/oracle/utl_file';
Directory created.
SQL> declare
2 fhandle utl_file.file_type;
3 begin
4 fhandle := utl_file.fopen('UTL_FILE_DIR', 'example.txt', 'w');
5 utl_file.put_line(fhandle , 'eygle test write one');
6 utl_file.put_line(fhandle , 'eygle test write two');
7 utl_file.fclose(fhandle);
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> !
[oracle@jumper 9.2.0]$ more /opt/oracle/utl_file/example.txt
eygle test write one
eygle test write two
[oracle@jumper 9.2.0]$
ÀàËÆµÄÎÒÃÇ¿ÉÒÔͨ¹ýutl_fileÀ´¶ÁÈ¡Îļþ:
SQL> declare
2 fhandle utl_file.file_type;
3 fp_buffer varchar2(4000);
4 begin
5 fhandle := utl_file.fopen ('UTL_FILE_DIR','example.txt', 'R');
6
7 utl_file.get_line (fhandle , fp_buffer );
8 dbms_output.put_line(fp_buffer );
9 utl_file.get_line (fhandle , fp_buffer );
10 dbms_output.put_line(fp_buffer );
11 utl_file.fclose(fhandle);
12 end;
13 /
eygle test write one
eygle test write two
PL/SQL procedure successfully completed.
Ïà¹ØÎĵµ£º
¼ÙÉèÓÐÕÅ±í£¬½Ðtable1£¬ÀïÃæÓÐ5000ÍòÐÐÊý¾Ý£¬¼ÙÉèÔ¤¼ÆÈ«±íɨÃè1´ÎÐèÒª1¸öСʱ£¬ÎÒÃÇ´Ó¹ý³ÌÀ´¿´£º
1¡¢ÔÚ1µãÖÓ£¬ÓиöÓû§A·¢³öÁËselect * from table1;´Ëʱ²»¹Ü½«À´table1Ôõô±ä»¯£¬ÕýÈ·µÄ½á¹ûÓ¦¸ÃÊÇÓû§A»á¿´µ½ÔÚ1µãÖÓÕâ¸öʱ¿ÌµÄÄÚÈÝ¡£Õâ¸öÊÇûÓÐÒÉÎʵġ£
2¡¢ÔÚ1µã30·Ö£¬ÓиöÓû§BÖ´ÐÐÁËupdateÃüÁ¸üÐÂÁËtable1±íÖеĵ ......
delete from tbl_talbe
where (col1,col2,col3) in
(select col1,col2,col3
from tbl_table
group by col1,col2,col3
&nbs ......
ÍøÉÏÓкܶàµÄ×ÊÁÏ£¬²Î¿¼itput£¨http://space.itpub.net/471666/viewspace-215923£©µÄ¡£
OS : Redhat
DB : Oracle 10.2.0.4.0
1.ÐÞ¸Äjdk ÏÂÃæµÄ×ÖÌå¡£
[oracle@a ~]$ cd $ORACLE_HOME/jdk/jre/lib/
[oracle@a ~]]$ mv font.properties font.properties_bak
[oracle@a ~]]$
[oracle@a ~]]$ cp font.properties.zh_CN.R ......
--ÈÕÆÚת»»ºÁÃë
SELECT TO_NUMBER(TO_DATE('2005-03-29 12:30:45', 'YYYY-MM-DD HH24:MI:SS') -
TO_DATE('1970-01-01 8:0:0', 'YYYY-MM-DD HH24:MI:SS')) * 24 * 60 * 60 * 1000
from DUAL;
--ºÁÃëת»»ÈÕÆÚ
SELECT TO_CHAR(1112070645000 / (1000 * 60 * 60 * 24) +
TO_ ......